예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.User.Identity.Name == "")
     {
         Response.Redirect("../Login.aspx");
     }
     if (!IsPostBack)
     {
         try
         {
             Tz888.SQLServerDAL.TPMerchant objtp = new Tz888.SQLServerDAL.TPMerchant();
             string  infoid = Request.QueryString["id"].ToString();
             DataSet ds     = objtp.GetOneNewsList(infoid);
             this.txtTitle.Value           = ds.Tables[0].Rows[0]["Title"].ToString();
             this.txtContent.Value         = Tz888.Common.Utility.PageValidate.HtmlToTxt(ds.Tables[0].Rows[0]["Content"].ToString());
             this.txtInstruction.Value     = ds.Tables[0].Rows[0]["PicAbout"].ToString();
             this.txtSource.Value          = ds.Tables[0].Rows[0]["Origin"].ToString();
             ZoneSelectControl1.ProvinceID = ds.Tables[0].Rows[0]["ProvinceID"].ToString().Trim();
             ZoneSelectControl1.CityID     = ds.Tables[0].Rows[0]["CityID"].ToString().Trim();
             ZoneSelectControl1.CountyID   = ds.Tables[0].Rows[0]["CountyID"].ToString().Trim();
             string strNewsType = "radioType" + ds.Tables[0].Rows[0]["NewsTypeID"].ToString().Trim();
             ViewState["NewsType"] = ds.Tables[0].Rows[0]["NewsTypeID"].ToString().Trim();
             System.Web.UI.HtmlControls.HtmlInputRadioButton obj = (System.Web.UI.HtmlControls.HtmlInputRadioButton) this.tbNews.FindControl(strNewsType);
             if (obj != null)
             {
                 obj.Checked = true;
             }
         }
         catch
         {
             Response.Write("<script>alert('请重新选择要修改的数据!');window.close();</script>");
         }
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.User.Identity.Name == "")
     {
         Response.Redirect("../Login.aspx");
     }
     if (!IsPostBack)
     {
         ViewState["strSavePath"] = "";
         try
         {
             Tz888.SQLServerDAL.TPMerchant objtp = new Tz888.SQLServerDAL.TPMerchant();
             string  infoid = Request.QueryString["id"].ToString();
             DataSet ds     = objtp.GetOneNewsList(infoid);
             this.txtName.Value       = ds.Tables[0].Rows[0]["Title"].ToString();
             this.txtAddress.Value    = ds.Tables[0].Rows[0]["activeAdress"].ToString();
             this.stime.Value         = ds.Tables[0].Rows[0]["activeDateFrom"].ToString();
             this.txtRemarks.Value    = ds.Tables[0].Rows[0]["DesCript"].ToString();
             this.txtHostUnit.Value   = Tz888.Common.Utility.PageValidate.HtmlToTxt(ds.Tables[0].Rows[0]["mainUnit"].ToString());
             this.txtHandleUnit.Value = Tz888.Common.Utility.PageValidate.HtmlToTxt(ds.Tables[0].Rows[0]["secondUnit"].ToString());
             this.txtRemarks.Value    = ds.Tables[0].Rows[0]["picAbout"].ToString();
             string   strName   = ds.Tables[0].Rows[0]["Name"].ToString();
             string   strMobile = ds.Tables[0].Rows[0]["Mobile"].ToString();
             string[] strnam    = strName.Split(' ');
             string[] strmob    = strMobile.Split(' ');
             this.txtNam.Value   = strnam[0].ToString();
             this.txtPhone.Value = strmob[0].ToString();
             if (strnam.Length > 1)
             {
                 this.txtNam1.Value   = strnam[1].ToString();
                 this.txtPhone1.Value = strmob[1].ToString();
             }
             if (strnam.Length > 2)
             {
                 this.txtNam2.Value   = strnam[2].ToString();
                 this.txtPhone2.Value = strmob[2].ToString();
             }
             if (strnam.Length > 3)
             {
                 this.txtNam3.Value   = strnam[3].ToString();
                 this.txtPhone3.Value = strmob[3].ToString();
             }
             if (strnam.Length > 4)
             {
                 this.txtNam4.Value   = strnam[4].ToString();
                 this.txtPhone4.Value = strmob[4].ToString();
             }
             if (strnam.Length > 5)
             {
                 this.txtNam5.Value   = strnam[5].ToString();
                 this.txtPhone5.Value = strmob[5].ToString();
             }
             ZoneSelectControl1.ProvinceID  = ds.Tables[0].Rows[0]["ProvinceID"].ToString().Trim();
             ZoneSelectControl1.CityID      = ds.Tables[0].Rows[0]["CityID"].ToString().Trim();
             ZoneSelectControl1.CountyID    = ds.Tables[0].Rows[0]["CountyID"].ToString().Trim();
             this.txtZipCode.Value          = ds.Tables[0].Rows[0]["PostCode"].ToString();
             this.txtAddres.Value           = ds.Tables[0].Rows[0]["address"].ToString();
             this.txtEmail.Value            = ds.Tables[0].Rows[0]["Email"].ToString();
             this.txtNet.Value              = ds.Tables[0].Rows[0]["WebSite"].ToString();
             this.txtContent.Value          = Tz888.Common.Utility.PageValidate.HtmlToTxt(ds.Tables[0].Rows[0]["Content"].ToString());
             this.txtPhoneCountryCode.Value = ds.Tables[0].Rows[0]["TelCountryCode"].ToString().Trim();
             this.txtPhoneCityCode.Value    = ds.Tables[0].Rows[0]["TelStateCode"].ToString().Trim();
             this.txtPhoneNum.Value         = ds.Tables[0].Rows[0]["TelNum"].ToString().Trim();
             this.txtFaxCountryCode.Value   = ds.Tables[0].Rows[0]["FaxCountryCode"].ToString().Trim();
             this.txtFaxCityCode.Value      = ds.Tables[0].Rows[0]["FaxStateCode"].ToString().Trim();
             this.txtFaxNum.Value           = ds.Tables[0].Rows[0]["FaxNum"].ToString().Trim();
             string strNewsType = "radioType" + ds.Tables[0].Rows[0]["NewsTypeID"].ToString().Trim();
             ViewState["NewsType"] = ds.Tables[0].Rows[0]["NewsTypeID"].ToString().Trim();
             string strIsPage         = "radPage" + ds.Tables[0].Rows[0]["pagestatus"].ToString().Trim();
             string strAuditingStatus = "radAuditingStatus" + ds.Tables[0].Rows[0]["AuditingStatus"].ToString().Trim();
             System.Web.UI.HtmlControls.HtmlInputRadioButton obj = (System.Web.UI.HtmlControls.HtmlInputRadioButton) this.Form.FindControl(strNewsType);
             if (obj != null)
             {
                 obj.Checked = true;
             }
             System.Web.UI.HtmlControls.HtmlInputRadioButton obj1 = (System.Web.UI.HtmlControls.HtmlInputRadioButton) this.Form.FindControl(strIsPage);
             if (obj1 != null)
             {
                 obj1.Checked = true;
             }
             System.Web.UI.HtmlControls.HtmlInputRadioButton obj2 = (System.Web.UI.HtmlControls.HtmlInputRadioButton) this.Form.FindControl(strAuditingStatus);
             if (obj2 != null)
             {
                 obj2.Checked = true;
             }
         }
         catch (Exception ex)
         {
             Response.Write("<script>alert('请重新选择要修改的数据!');window.close();</script>");
         }
     }
     btnOK.Attributes.Add("onclick", "return chkInput();");
 }