系統(tǒng)所有代碼翻譯_第1頁(yè)
系統(tǒng)所有代碼翻譯_第2頁(yè)
系統(tǒng)所有代碼翻譯_第3頁(yè)
系統(tǒng)所有代碼翻譯_第4頁(yè)
系統(tǒng)所有代碼翻譯_第5頁(yè)
已閱讀5頁(yè),還剩30頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

RusingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;//這個(gè)東西是后臺(tái)必備的東西,創(chuàng)建類之類的publicpartialclassRegister:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse)//雙擊空白頁(yè)面出現(xiàn)的控件{}protectedvoidbtnAdd_Click(objectsender,EventArgse)//btnAdd按鈕時(shí)間,雙擊ID為btnAdd的那個(gè)按鈕{stringstrErr="";//定義空字符串if(this.txtUserName.Text=="")//如果ID為txtUserName內(nèi)容為空時(shí)(驗(yàn)證){strErr+="用戶名不能為空!\\n";//ID為strErr的值輸出“用戶名不能為空!\\n”\n是回車(chē),前邊那個(gè)\是區(qū)分的,不懂可看語(yǔ)法}if(this.txtPassword.Text=="")//密碼為空判斷{strErr+="密碼不能為空!\\n";}if(strErr!="")//不為空的時(shí)候{MessageBox.Show(this,strErr);//彈出對(duì)話框顯示strErr的內(nèi)容return;}stringUserName=this.txtUserName.Text;stringPassword=this.txtPassword.Text;stringsex=this.txtsex.SelectedValue;stringAddress=this.txtAddress.Text;stringEmail=this.txtEmail.Text;stringPhone=this.txtphone.Text;stringrealname=txtrealname.Text;//賦值把頁(yè)面上對(duì)應(yīng)的文本框所輸入的內(nèi)容(。text)賦值到自己定義的字段中Useru=newUser();//創(chuàng)建User()函數(shù),就是你自己定義的,里面應(yīng)該有publicvoiduser(){。。。。。。。}類似的函數(shù),里面的屬性用點(diǎn)(。)調(diào)用if(u.ischongfu(UserName)>0)//User()內(nèi)的ischongfu(UserName)子函數(shù),UserName為傳遞值{MessageBox.Show(this,"用戶名已存在!");//對(duì)話框return;}u.Realname=realname;u.Createdate=DateTime.Now;u.UserName=UserName;u.Password=Password;u.Sex=sex;u.Address=Address;u.Email=Email;u.Phone=Phone;//賦值如realname可以在User()函數(shù)里找到字段,DateTime.Now顯示當(dāng)前時(shí)間u.Add();//調(diào)用User()的Add()方法MessageBox.ShowAndRedirect(this,"注冊(cè)成功!,請(qǐng)登錄!","Logins.aspx");;//對(duì)話框并跳轉(zhuǎn)到"Logins.aspx"頁(yè)面}}MyTemplausingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassMyTemplateList:System.Web.UI.Page{privateReltemplatertmodel=newReltemplate();//創(chuàng)建Reltemplate對(duì)象,有可能是你自己創(chuàng)建的,就是跟上面的User()類似的東西protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){BindMyTemplate();//創(chuàng)建BindMyTemplate對(duì)象,有可能是你自己創(chuàng)建的,就是跟上面的BindMyTemplate()類似的東西}}privatevoidBindMyTemplate(){GridView1.DataSource=rtmodel.GetList("rt.cid="+Session["cid"].ToString());//Session是個(gè)傳值的東西,如同qq私聊,具體網(wǎng)上查,Gridview1是前臺(tái)的控件。Tostring()字符串,getlist不清楚GridView1.DataBind();//綁定數(shù)據(jù)庫(kù)}protectedvoidGridView1_RowCommand(objectsender,GridViewCommandEventArgse)//沒(méi)用過(guò)這個(gè)函數(shù){if(e.CommandName=="rtdel")//刪除,好像是個(gè)按鈕名字或ID為rtdel{rtmodel.Delete(int.Parse(e.CommandArgument.ToString()));//刪除,有點(diǎn)看不懂MessageBox.Show(this,"刪除成功!");BindMyTemplate();}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassLogins:System.Web.UI.Page{publicAdminamodel=newAdmin();publicCompanycmodel=newCompany();publicUserumodel=newUser();//創(chuàng)建函數(shù)類似user()protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidButton1_Click(objectsender,EventArgse){switch(RadioButtonList1.SelectedValue)\\單選按鈕(小圓點(diǎn))選中那個(gè)值,A\B\C是他的值{case"A"://A的時(shí)候{amodel=amodel.logins(TextBox1.Text,TextBox2.Text);//amodel應(yīng)該是個(gè)函數(shù)傳入ID為textbox1和textbox2的值if(amodel!=null)//amodel不為空的時(shí)候{Session["adminid"]=amodel.Id;//把a(bǔ)model.Id的值傳到Session里//Session["atype"]=amodel.Admintype.Trim();Response.Redirect("~/AdminPage.aspx");//跳轉(zhuǎn)到頁(yè)面AdminPage.aspx}else{MessageBox.Show(this,"用戶名或密碼錯(cuò)誤!");}break;}//下面B和C同理case"B":{cmodel=cmodel.logins(TextBox1.Text,TextBox2.Text);if(cmodel!=null){Session["cid"]=cmodel.Id;//Session["atype"]=amodel.Admintype.Trim();Response.Redirect("~/AdminPage.aspx");}else{MessageBox.Show(this,"用戶名或密碼錯(cuò)誤!");}break;}case"C":{umodel=umodel.logins(TextBox1.Text,TextBox2.Text);if(umodel!=null){Session["userid"]=umodel.Id;Response.Redirect("~/Default.aspx");}else{MessageBox.Show(this,"用戶名或密碼錯(cuò)誤!");}break;}}}//protectedvoidButton2_Click(objectsender,EventArgse)//{//Response.Redirect("~/Register.aspx");//}protectedvoidButton2_Click(objectsender,EventArgse)//雙擊botton2后跳轉(zhuǎn)頁(yè)面{Response.Redirect("~/BusinessAdd.aspx");}protectedvoidButton3_Click(objectsender,EventArgse)//雙擊botton3后跳轉(zhuǎn)頁(yè)面{Response.Redirect("~/Register.aspx");}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassAdminPage:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassProductListD:System.Web.UI.Page{privateCproductcpmodel=newCproduct();//創(chuàng)建同user()protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack)//第一次加載頁(yè)面{BindProduct();}}privatevoidBindProduct(){GridView1.DataSource=cpmodel.GetAllList("");//讀取cpmodel里面的值,沒(méi)用過(guò)GridView1.DataBind();//與數(shù)據(jù)庫(kù)綁定}protectedvoidGridView1_RowCommand(objectsender,GridViewCommandEventArgse)//沒(méi)用過(guò)的函數(shù)又是,應(yīng)該還是刪除操作{if(e.CommandName=="del1"){cpmodel.Delete(Convert.ToInt32(e.CommandArgument.ToString()));MessageBox.Show(this,"刪除成功!");BindProduct();}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclass_Default:System.Web.UI.Page{//有些東西已經(jīng)說(shuō)了,類似privateCproductcpmodel=newCproduct();protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){BindProduct();}}privatevoidBindProduct(){DataList2.DataSource=cpmodel.GetAllList("cp.cidin(selectcidfromreltemplate)");DataList2.DataBind();}protectedvoidDataList2_ItemCommand(objectsource,DataListCommandEventArgse)//捕獲DataList2的ItemCommand事件{if(e.CommandName=="cpshow")//ItemCommand事件獲得值若是cpshow(應(yīng)該是個(gè)按鈕){cpmodel=cpmodel.GetModel(int.Parse(e.CommandArgument.ToString()));//類型轉(zhuǎn)換,并傳到GetModel()函數(shù)里Response.Redirect("Tan.aspx?ttype=1&cid="+cpmodel.Cid.ToString());//跳轉(zhuǎn)頁(yè)面,就是顯得牛b些,前面“”號(hào)里的混淆視線(地址欄里顯示你打印的這些也有可能是安全性)}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingcurity;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassDefault2:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassDefault3:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassDefault4:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassTan:System.Web.UI.Page//這段代碼比較設(shè)計(jì)東西較多,可以多問(wèn)問(wèn)編寫(xiě)的那個(gè)人{(lán)Reltemplatertmodel=newReltemplate();//創(chuàng)建對(duì)象Ctemplatectmodel=newCtemplate();//創(chuàng)建對(duì)象protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){stringttype=Request.QueryString.Get("ttype");//獲得值ttype(別的網(wǎng)頁(yè)穿過(guò)來(lái)的,可以找跳轉(zhuǎn)的那個(gè)語(yǔ)句Response.Redirect(Tan.aspx)傳過(guò)來(lái)的)if(ttype=="1")//如果傳過(guò)來(lái)的ttype值為1{DataSetds=rtmodel.GetList("cid="+Request.QueryString.Get("cid"));//創(chuàng)建虛擬的DataSet的ds存cid這個(gè)表,具體可以好好問(wèn)問(wèn)那個(gè)人if(ds.Tables[0].Rows.Count>0)//判斷數(shù)據(jù)庫(kù)非空時(shí){intctid=int.Parse(ds.Tables[0].Rows[0]["ctid"].ToString());//不清楚ctmodel=ctmodel.GetModel(ctid);//建立表模型獲得ctmodelif(ctmodel.Ctname=="模板1")//值等于“模板1”時(shí)候{Response.Redirect("MyShop1.aspx?cid="+Request.QueryString.Get("cid")+"&ctid="+ctid.ToString());//跳轉(zhuǎn)頁(yè)面}Else//不等于模板一時(shí)候{Response.Redirect("MyShop2.aspx?cid="+Request.QueryString.Get("cid")+"&ctid="+ctid.ToString());//跳轉(zhuǎn)頁(yè)面}}}else//如果傳過(guò)來(lái)的ttype值非1{//下面代碼與上面代碼類似DataSetds=rtmodel.GetList("cid="+Session["cid"].ToString());if(ds.Tables[0].Rows.Count>0){intctid=int.Parse(ds.Tables[0].Rows[0]["ctid"].ToString());ctmodel=ctmodel.GetModel(ctid);if(ctmodel.Ctname=="模板1"){Response.Redirect("MyShop1.aspx?cid="+Session["cid"].ToString()+"&ctid="+ctid.ToString());}else{Response.Redirect("MyShop2.aspx?cid="+Session["cid"].ToString()+"&ctid="+ctid.ToString());}}}}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingrols.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassTemplateAdd:System.Web.UI.Page{privateCtemplatectmodel=newCtemplate();//創(chuàng)建ctmodel函數(shù)protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidbtnok_Click(objectsender,EventArgse)//雙擊btnok按鈕后的事件{stringstrErr="";if(this.txtdiv1color.Text=="")//txtdiv1color的值為空時(shí){strErr+="上,顏色不能為空!\\n";//strErr賦值}if(this.txtdiv1hight.Text=="")//txtdiv1hight的值為空時(shí){strErr+="上,高度不能為空!\\n";//strErr賦值}if(this.txtdiv2color.Text=="")//txtdiv2color的值為空時(shí){strErr+="左,顏色不能為空!\\n";//strErr賦值}if(this.txtdiv2width.Text=="")//txtdiv1hight的值為空時(shí){strErr+="左,寬度不能為空!\\n";//strErr賦值}if(this.txtdiv3color.Text=="")//txtdiv3color的值為空時(shí){strErr+="右,顏色不能為空!\\n";//strErr賦值}if(this.txtdiv3width.Text=="")//txtdiv3width的值為空時(shí){strErr+="右,寬度度不能為空!\\n";//strErr賦值}if(strErr!="")//strErr不為空時(shí){MessageBox.Show(this,strErr);//彈出對(duì)話框,說(shuō)白了就是上面的那些return;}if(int.Parse(txtdiv1hight.Text)>50)//將txtdiv1hight.Text值轉(zhuǎn)化成整型讓后判斷是否大于50,int。parse是轉(zhuǎn)化成整型的意思{MessageBox.Show(this,"上,高度不能超過(guò)50%");//彈出對(duì)話框內(nèi)容為“上,高度不能超過(guò)50%”return;}if(int.Parse(txtdiv2width.Text)+int.Parse(txtdiv3width.Text)>98)//txtdiv2width+txtdiv3width轉(zhuǎn)化整型后加起來(lái)與98比{MessageBox.Show(this,"左右寬度加起來(lái)不能大于100");return;}if(RadioButtonList1.SelectedValue=="模板1")//單選按鈕選中值為模板1是{if(int.Parse(txtdiv2width.Text)<50)//轉(zhuǎn)成整型判斷大小{MessageBox.Show(this,"模板1的左寬度不能小于50%");//對(duì)話框內(nèi)容“模板1的左寬度不能小于50%”return;}}if(RadioButtonList1.SelectedValue=="模板2")//單選按鈕選中值為模板2時(shí){if(int.Parse(txtdiv3width.Text)<50)//轉(zhuǎn)成整型判斷大小{MessageBox.Show(this,"模板2的左寬度不能大于50%");//對(duì)話框內(nèi)容“模板2的左寬度不能小于50%”return;}}stringctname=RadioButtonList1.SelectedValue;//將RadioButtonList1選中的值賦給ctnamestringctpath="";//創(chuàng)建字符串ctpathif(RadioButtonList1.SelectedValue=="模板1")//單選按鈕選中值為模板2時(shí){ctpath=Image1.ImageUrl;//ctpath獲得Image1的路徑}else{ctpath=Image2.ImageUrl;//否則ctpath獲得Image2的路徑}stringdiv1color=txtdiv1color.Text;//.Style["background-color"];//.BackColor.ToString();//div1color的顏色獲得就是txtdiv1color.Text里的值,里面有注釋掉的css語(yǔ)句,應(yīng)該是背景顏色屬性stringdiv2color=txtdiv2color.Text;//.Style["background-color"];//.BackColor.ToString();stringdiv3color=txtdiv3color.Text;//.Style["background-color"];//.BackColor.ToString();intdiv1height=int.Parse(txtdiv1hight.Text);//轉(zhuǎn)化成整型并賦值intdiv2width=int.Parse(this.txtdiv2width.Text);//轉(zhuǎn)化成整型并賦值intdiv3width=int.Parse(this.txtdiv3width.Text);//轉(zhuǎn)化成整型并賦值ctmodel.Ctname=ctname;//賦值ctmodel.Ctpath=ctpath;//賦值ctmodel.Div1color=div1color;//賦值ctmodel.Div2color=div2color;//賦值ctmodel.Div3color=div3color;//賦值ctmodel.Div1height=div1height;//賦值ctmodel.Div2width=div2width;//賦值ctmodel.Div3width=div3width;//賦值if(ctmodel.ischongfu(ctname)>0)//好像判斷是受重復(fù),.ischongfu()不清楚應(yīng)該是自己創(chuàng)建的東西{MessageBox.Show(this,"用模板已存在!");//對(duì)話框return;}ctmodel.Add();//自己創(chuàng)建的函數(shù)add(),具體干什么不清楚MessageBox.ShowAndRedirect(this,"添加成功!","TemplateAdd.aspx");//跳轉(zhuǎn)加對(duì)話框,TemplateAdd.aspx為跳轉(zhuǎn)頁(yè)面}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;using.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclass{publicCompanycmodel=newCompany();//創(chuàng)建cmodel函數(shù)protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack)//頁(yè)面第一次加載時(shí){cmodel=cmodel.GetModel(int.Parse(Request.QueryString.Get("cid")));//獲得模型值cid的整型if(cmodel!=null)//cmodel非空時(shí)候,以下是賦值{txtcname.Text=cmodel.Cname;txtcrname.Text=cmodel.Crname;txtcpassword.Attributes["value"]=cmodel.Cpassword;//傳值用的,記錄value的值txtccontract.Text=cmodel.Ccontract;txtphone.Text=cmodel.Phone;txtAddress.Text=cmodel.Address;txtcomdetail.Text=cmodel.Comdetail;txtEmail.Text=cmodel.Email;}}}protectedvoidbtnAdd_Click(objectsender,EventArgse)//btnAdd按鈕事件{stringstrErr="";if(this.txtcname.Text=="")//txtcname非空時(shí)候{strErr+="商家注冊(cè)名不能為空!\\n";//賦值}if(this.txtcpassword.Text=="")//以下同理{strErr+="密碼不能為空!\\n";}if(this.txtcrname.Text==""){strErr+="商家名稱不能為空!\\n";}if(strErr!="")//strErr不為空時(shí)候{MessageBox.Show(this,strErr);//彈出上面那些對(duì)話框return;}//以下是各個(gè)textbox賦值stringcname=this.txtcname.Text;stringcpassword=this.txtcpassword.Text;stringcrname=this.txtcrname.Text;stringccontract=this.txtccontract.Text;stringAddress=this.txtAddress.Text;stringEmail=this.txtEmail.Text;stringPhone=this.txtphone.Text;stringcomdetail=txtcomdetail.Text;//以下是傳到cmodel那個(gè)模型函數(shù)里cmodel.Cname=cname;cmodel.Cpassword=cpassword;cmodel.Crname=crname;cmodel.Ccontract=ccontract;cmodel.Phone=Phone;cmodel.Address=Address;cmodel.Email=Email;cmodel.Createdate=DateTime.Now;//讀取當(dāng)前時(shí)間cmodel.Comdetail=comdetail;cmodel.Id=int.Parse(Request.QueryString.Get("cid"));cmodel.Update();//數(shù)據(jù)庫(kù)更新MessageBox.ShowAndRedirect(this,"修改成功!","BusinessList.aspx");}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassBusinessAddByAdmin:System.Web.UI.Page{publicCompanycmodel=newCompany();//創(chuàng)建模型函數(shù)protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidbtnAdd_Click(objectsender,EventArgse)//?!好像跟上面一樣類似{stringstrErr="";if(this.txtcname.Text==""){strErr+="商家注冊(cè)名不能為空!\\n";}if(this.txtcpassword.Text==""){strErr+="密碼不能為空!\\n";}if(this.txtcrname.Text==""){strErr+="商家名稱不能為空!\\n";}if(strErr!=""){MessageBox.Show(this,strErr);return;}stringcname=this.txtcname.Text;stringcpassword=this.txtcpassword.Text;stringcrname=this.txtcrname.Text;stringccontract=this.txtccontract.Text;stringAddress=this.txtAddress.Text;stringEmail=this.txtEmail.Text;stringPhone=this.txtphone.Text;stringcomdetail=txtcomdetail.Text;cmodel.Cname=cname;cmodel.Cpassword=cpassword;cmodel.Crname=crname;cmodel.Ccontract=ccontract;cmodel.Phone=Phone;cmodel.Address=Address;cmodel.Email=Email;cmodel.Createdate=DateTime.Now;cmodel.Comdetail=comdetail;cmodel.Add();MessageBox.ShowAndRedirect(this,"注冊(cè)成功!,請(qǐng)登錄!","BusinessAddByAdmin.aspx");}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassBusinessAdd:System.Web.UI.Page{publicCompanycmodel=newCompany();protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidbtnAdd_Click(objectsender,EventArgse)//?!好像跟上面一樣類似{stringstrErr="";if(this.txtcname.Text==""){strErr+="商家注冊(cè)名不能為空!\\n";}if(this.txtcpassword.Text==""){strErr+="密碼不能為空!\\n";}if(this.txtcrname.Text==""){strErr+="商家名稱不能為空!\\n";}if(strErr!=""){MessageBox.Show(this,strErr);return;}stringcname=this.txtcname.Text;stringcpassword=this.txtcpassword.Text;stringcrname=this.txtcrname.Text;stringccontract=this.txtccontract.Text;stringAddress=this.txtAddress.Text;stringEmail=this.txtEmail.Text;stringPhone=this.txtphone.Text;stringcomdetail=txtcomdetail.Text;cmodel.Cname=cname;cmodel.Cpassword=cpassword;cmodel.Crname=crname;cmodel.Ccontract=ccontract;cmodel.Phone=Phone;cmodel.Address=Address;cmodel.Email=Email;cmodel.Createdate=DateTime.Now;cmodel.Comdetail=comdetail;cmodel.Add();MessageBox.ShowAndRedirect(this,"注冊(cè)成功!,請(qǐng)登錄!","Logins.aspx");}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassBusinessList:System.Web.UI.Page{Companycommodel=newCompany();protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){BindCom();//綁定數(shù)據(jù)庫(kù)}}privatevoidBindCom()//綁定數(shù)據(jù)庫(kù){GridView1.DataSource=commodel.GetList("");//獲得數(shù)據(jù)源GridView1.DataBind();//綁定數(shù)據(jù)庫(kù)}protectedvoidGridView1_RowCommand(objectsender,GridViewCommandEventArgse){if(e.CommandName=="cdel")//判斷CommandName事件的值是否是cdel刪除鍵{commodel.Delete(int.Parse(e.CommandArgument.ToString()));//刪除對(duì)應(yīng)的整型MessageBox.Show(this,"刪除成功!");//彈出對(duì)話框BindCom();}elseif(e.CommandName=="cedit")//要是等于cedit時(shí)候{Response.Redirect("BusinessEdit.aspx?cid="+e.CommandArgument.ToString());//跳轉(zhuǎn)到編輯頁(yè)面}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassCTemplateEdit:System.Web.UI.Page{privateCtemplatectmodel=newCtemplate();protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){//以下第一次加載后賦值intctid=int.Parse(Request.QueryString.Get("ctid"));//用戶idctmodel=ctmodel.GetModel(ctid);//給模型賦值lblctname.Text=ctmodel.Ctname;//用戶名字txtdiv1color.Text=ctmodel.Div1color;//顏色txtdiv1hight.Text=ctmodel.Div1height.ToString();//高度txtdiv2color.Text=ctmodel.Div2color;//顏色txtdiv3color.Text=ctmodel.Div3color;//顏色txtdiv2width.Text=ctmodel.Div2width.ToString();//寬度txtdiv3width.Text=ctmodel.Div3width.ToString();//寬度Image1.ImageUrl=ctmodel.Ctpath;//Image1路徑}}protectedvoidbtnok_Click(objectsender,EventArgse)//類似前面代碼,控制高矮胖瘦顏色等屬性,賦值{stringstrErr="";if(this.txtdiv1color.Text==""){strErr+="上,顏色不能為空!\\n";}if(this.txtdiv1hight.Text==""){strErr+="上,高度不能為空!\\n";}if(this.txtdiv2color.Text==""){strErr+="左,顏色不能為空!\\n";}if(this.txtdiv2width.Text==""){strErr+="左,寬度不能為空!\\n";}if(this.txtdiv3color.Text==""){strErr+="右,顏色不能為空!\\n";}if(this.txtdiv3width.Text==""){strErr+="右,寬度度不能為空!\\n";}if(strErr!=""){MessageBox.Show(this,strErr);return;}if(int.Parse(txtdiv1hight.Text)>50){MessageBox.Show(this,"上,高度不能超過(guò)50%");return;}if(int.Parse(txtdiv2width.Text)+int.Parse(txtdiv3width.Text)>98){MessageBox.Show(this,"左右寬度加起來(lái)不能大于100");return;}ifim()=="模板1"){if(int.Parse(txtdiv2width.Text)<50){MessageBox.Show(this,"模板1的左寬度不能小于50%");return;}}if(lblctname.Text.Trim()=="模板2"){if(int.Parse(txtdiv3width.Text)<50){MessageBox.Show(this,"模板2的左寬度不能小于50%");return;}}stringctname=lblctname.Text.Trim();stringctpath=Image1.ImageUrl;stringdiv1color=txtdiv1color.Text;stringdiv2color=txtdiv2color.Text;stringdiv3color=txtdiv3color.Text;intdiv1height=int.Parse(txtdiv1hight.Text);intdiv2width=int.Parse(this.txtdiv2width.Text);intdiv3width=int.Parse(this.txtdiv3width.Text);ctmodel.Ctname=ctname;ctmodel.Ctpath=ctpath;ctmodel.Div1color=div1color;ctmodel.Div2color=div2color;ctmodel.Div3color=div3color;ctmodel.Div1height=div1height;ctmodel.Div2width=div2width;ctmodel.Div3width=div3width;ctmodel.Id=int.Parse(Request.QueryString.Get("ctid"));ctmodel.Update();MessageBox.ShowAndRedirect(this,"修改成功!","TemplateList.aspx");}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassLogoff:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse)//主要是注銷(xiāo)按鈕,或者叫退出按鈕{if(!IsPostBack){if(Session["userid"]!=null)//Session里面有值的話,就是“歡迎XX”的XX存在{Session["userid"]=null;//賦值為空,就是類似論壇里的“歡迎XX”的XX沒(méi)了Response.Redirect("Default.aspx");//跳轉(zhuǎn)頁(yè)面到Default.aspx}Session["cid"]=null;//賦值為空,就是類似論壇里的“歡迎XX”的XX沒(méi)了Session["adminid"]=null;//賦值為空,就是類似論壇里的“歡迎XX”的XX沒(méi)了Response.Redirect("~/logins.aspx");//跳轉(zhuǎn)頁(yè)面}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassMasterPage:System.Web.UI.MasterPage{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){if(Session["adminid"]==null&&Session["cid"]==null)//要是Session["adminid"],Session["cid"]沒(méi)有值時(shí)候,session[]就是如同下次登錄那個(gè)東西似地,如果不關(guān)閉整個(gè)頁(yè)面一直會(huì)存儲(chǔ),session[“a”]與session[“b”]是存的兩個(gè)東西{Response.Redirect("~/logins.aspx");}if(Session["adminid"]!=null&&Session["cid"]==null){TreeView1.Visible=true;//導(dǎo)航顯示,是個(gè)控件。在控件的工具里可以找到}if(Session["adminid"]==null&&Session["cid"]!=null){TreeView2.Visible=true;}}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassMyShop1:System.Web.UI.Page{Ctemplatectmodel=newCtemplate();protectedvoidPage_Load(objectsender,EventArgse)//這個(gè)不好說(shuō),Attributes跟session類似,說(shuō)白了這個(gè)頁(yè)面就是把上面穿的高矮胖瘦之類的存起來(lái)到一個(gè)模型里{if(!IsPostBack){intctid=int.Parse(Request.QueryString.Get("ctid"));//ctid時(shí)候的整型數(shù)值ctmodel=ctmodel.GetModel(ctid);div1.Attributes.Add("style","width:100%;height:"+ctmodel.Div1height.ToString()+"%;background-color:"+ctmodel.Div1color+";");//就是存儲(chǔ)高矮胖瘦的內(nèi)容,為別的頁(yè)面服務(wù)div2.Attributes.Add("style","float:left;width:"+ctmodel.Div2width.ToString()+"%;background-color:"+ctmodel.Div2color+";");//就是存儲(chǔ)高矮胖瘦的內(nèi)容,為別的頁(yè)面服務(wù)div3.Attributes.Add("style","float:right;width:"+ctmodel.Div3width.ToString()+"%;background-color:"+ctmodel.Div3color+";");//就是存儲(chǔ)高矮胖瘦的內(nèi)容,為別的頁(yè)面服務(wù)}}}usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingCamera;publicpartialclassMyShop2:System.Web.UI.Page{Ctemplatectmodel=newCtemplate();//同上一個(gè)myshop1。Aspx。csprotectedvoidPage_Load(objectsender,EventArgs

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論