protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["usename"] != null) { if (Session["usename"].ToString() != "") { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(1); if (combll.getfenleiExists(1) == true) { btnok.Visible = false; btntian.Visible = true; bind(); } else if (combll.getfenleiExists(1) == false) { btnok.Visible = true; btntian.Visible = false; } } else { Response.Redirect("login.aspx"); Response.End(); } } else { Response.Redirect("login.aspx"); Response.End(); } } }
private void bind() { btnupdael.Visible = true; btnok.Visible = false; Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(2); txtwenhua.Text = commodel.Gonggao; }
protected void btnupdael_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(2); commodel.Gonggao = txtwenhua.Text.Trim(); combll.Update(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息提交成功')</script>"); bind(); }
protected void btntian_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(1); commodel.Gonggao = txtgong.Text.Trim(); commodel.GongTime = Convert.ToDateTime(DateTime.Now.ToString()); combll.getupdate(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息提交成功!')</script>"); bind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); //int maxid = combll.GetgonggaoMaxID(2) - 1; Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(2); lblGonggao.Text = commodel.Gonggao; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bind(); Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(1); lblgonggao.Text = commodel.Gonggao; } }
private void bind() { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel1 = combll.GetgonggaoModel(1); txtgong.Text = commodel1.Gonggao; }