private void initData() { validateMember userobj = MasterPageOpration.getMasterControl(this.Page.Master, "Muser"); wgiAdUnionSystem.BLL.wgi_usersite bll = new wgiAdUnionSystem.BLL.wgi_usersite(); Helper.HelperDropDownList.BindData(ddlsite, bll.getListByUserId(userobj.suser.userid).Tables[0], "sitename", "siteid", 0); ddlsite.Items.Insert(0, new ListItem("--请选择--", "-1")); ddlsite.SelectedIndex = 0; txtstart.Text = DateTime.Today.Date.ToString("yyyy-MM") + "-01"; txtend.Text = DateTime.Today.Date.ToString("yyyy-MM-dd"); }
protected void btnsave(object sender, EventArgs e) { wgiAdUnionSystem.BLL.wgi_usersite bll = new wgiAdUnionSystem.BLL.wgi_usersite(); wgiAdUnionSystem.Model.wgi_usersite model = new wgiAdUnionSystem.Model.wgi_usersite(); string sitename = txtsitename.Text; string url = txturl.Text; string remark = txtremark.Text; int ipno, pvno; ipno = pvno = 0; int sitetype = int.Parse(ddlsitetype.SelectedValue); try { ipno = int.Parse(txtipno.Text); } catch (Exception) { //ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('独立IP数请输入数字');", true); ipno = 0; } try { pvno = int.Parse(txtpvno.Text); } catch (Exception) { //ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('日均PV数请输入数字');", true); pvno = 0; } model.ipno = ipno; model.pvno = pvno; model.sitename = sitename; model.siteremark = remark; model.sitetype = sitetype; model.url = url; model.userid = userid; model.siteid = int.Parse(hidsiteid.Value); bll.Update(model); ScriptManager.RegisterClientScriptBlock(this, GetType(), DateTime.Now.ToString(), "alert('编辑网站成功');location=location;", true); }
protected void editsite(object sender, CommandEventArgs e) { string siteid = e.CommandArgument.ToString(); wgiAdUnionSystem.Model.wgi_usersite model = new wgiAdUnionSystem.BLL.wgi_usersite().GetModel(int.Parse(siteid)); txtipno.Text = model.ipno.ToString(); txtpvno.Text = model.pvno.ToString(); txtremark.Text = model.siteremark; txtsitename.Text = model.sitename; txturl.Text = model.url; ddlsitetype.SelectedValue = model.sitetype.ToString(); hidsiteid.Value = siteid; btnnew.Enabled = false; btnedit.Enabled = true; btnreset.Enabled = true; }
private void initData() { validateMember userobj = MasterPageOpration.getMasterControl(this.Page.Master, "Muser"); //得到网站列表 wgi_usersite bll = new wgi_usersite(); Helper.HelperDropDownList.BindData(ddlsite, bll.getListByUserId(userobj.suser.userid).Tables[0], "sitename", "siteid",0); ddlsite.Items.Insert(0, new ListItem("--请选择--", "")); ddlsite.SelectedIndex = 0; //得到广告主数据 hidadhost.Value = Request["host"]; hidadid.Value = Request["id"]; hidadtype.Value = Request["adtype"]; hidpaytype.Value = Request["paytype"]; //预览区 lbltest.Text = "<b>请先选择网站!</b><br />"; }