{
publicpartialclassLogin:
System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
}
protectedvoidImageButton1_Click(objectsender,ImageClickEventArgse)
{
try
{
if(this.IsValid)
{
TusersTableAdapterTuser=newTusersTableAdapter();
stringname=TextBox1.Text.Trim();
stringpas=TextBox2.Text.Trim();
varTuserrow=Tuser.Getusernamepas(name,pas).Single();
stringna=Tuserrow.Username.ToString();
stringid=Tuserrow.Id.ToString();
Session["myname"]=na;
Session["myid"]=id;
ArrayListAlist=newArrayList();
TpowerTableAdapterTpower=newTpowerTableAdapter();
varTpowerrow=Tpower.Getid(Tuserrow.Duty).Single();
if(Tpowerrow.Zhgl>0)
{
Alist.Add("Zhgl");
}
if(Tpowerrow.Zzrs>0)
{
Alist.Add("Zzrs");
}
if(Tpowerrow.Grbg>0)
{
Alist.Add("Grbg");
}
if(Tpowerrow.Wjgl>0)
{
Alist.Add("Wjgl");
}
if(Tpowerrow.Cggl>0)
{
Alist.Add("Cggl");
}
if(Tpowerrow.Kcgl>0)
{
Alist.Add("Kcgl");
}
if(Tpowerrow.Xsgl>0)
{
Alist.Add("Xsgl");
}
if(Tpowerrow.Cwgl>0)
{
Alist.Add("Cwgl");
}
Alist.Add("Connsend");
Alist.Add("Index");
Alist.Add("Left");
Alist.Add("Top");
Alist.Add("Right");
Session["myright"]=Alist;
Response.Redirect("~/Index.aspx");
}
}
catch
{
Response.Write("
录?
失骸?
败悒?
用?
户§名?
或ò密ü码?
错洙?
误ó.');");
}
}
}
}
5.2收发管理界面及其代码
{
publicpartialclassWjglgodoc:
Library.Log
{
protectedvoidPage_Load(objectsender,EventArgse)
{
qzqzqz.Text="";
if(!
IsPostBack)
{
intid=Convert.ToInt32(Session["myid"]);
TofdocTableAdapterTofdoc=newTofdocTableAdapter();
TgodocTableAdapterTgodoc=newTgodocTableAdapter();
int?
count1=Convert.ToInt32(Tofdoc.Scalarofuserid(id));
if(count1!
=null)
{
Labellb1=(Label)this.ListView1.FindControl("Labelcount1");
if(lb1!
=null)
{
lb1.Text=count1.ToString();
}
}
int?
count=Convert.ToInt32(Tgodoc.Scalarcreatuserid(id));
if(count!
=null)
{
Labellb=(Label)this.ListView2.FindControl("Labelcount");
if(lb!
=null)
{
lb.Text=count.ToString();
}
}
}
}
protectedvoidaddgodoc_Click(objectsender,EventArgse)
{
if(FileUpload1.HasFile&&tbofuser.Text.Length>0)
{
stringfjname=FileUpload1.FileName;
stringpath=Server.MapPath("~/Filepublic/"+fjname);
if(File.Exists(path))
{
qzqzqz.Text="";
return;
}
else
{
try
{
TusersTableAdapterTusers=newTusersTableAdapter();
TgodocTableAdapterTgodoc=newTgodocTableAdapter();
TofdocTableAdapterTofdoc=newTofdocTableAdapter();
Dictionary
DateTimeCreattime=DateTime.Now;
intCreatuserid=Convert.ToInt32(Session["myid"]);
stringCreatuser=Session["myname"].ToString();
stringstrofuser=tbofuser.Text.Trim(',');
string[]str=strofuser.Split(',');
strings="";
for(inti=0;i { varrow=Tusers.Getusername(str[i]).Single(); Dic.Add(row.Id,row.Username); s+=row.Username+","; } FileUpload1.SaveAs(path); foreach(vardinDic) { Tofdoc.Insert(fjname,path,Creattime,Creatuserid,Creatuser,d.Key,d.Value); } Tgodoc.Insert(fjname,path,Creattime,Creatuserid,Creatuser,s); qzqzqz.Text=""; } catch { qzqzqz.Text="
copyright@ 2008-2022 冰豆网网站版权所有 经营许可证编号:鄂ICP备2022015515号-1