Example #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtname.Text.Trim().Length == 0)
            {
                strErr += "name不能为空!\\n";
            }
            if (this.txtprojectName.Text.Trim().Length == 0)
            {
                strErr += "projectName不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txttime.Text))
            {
                strErr += "time格式错误!\\n";
            }
            if (this.txttodayWork.Value.Trim().Length == 0)
            {
                strErr += "todayWork不能为空!\\n";
            }
            if (this.txtproblem.Value.Trim().Length == 0)
            {
                strErr += "problem不能为空!\\n";
            }
            if (this.txttomorrowWork.Value.Trim().Length == 0)
            {
                strErr += "tomorrowWork不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      ID           = int.Parse(this.lblID.Text);
            string   name         = this.txtname.Text;
            string   projectName  = this.txtprojectName.Text;
            DateTime time         = DateTime.Parse(this.txttime.Text);
            string   todayWork    = this.txttodayWork.Value;
            string   problem      = this.txtproblem.Value;
            string   tomorrowWork = this.txttomorrowWork.Value;


            Maticsoft.Model.Report model = new Maticsoft.Model.Report();
            model.ID           = ID;
            model.name         = name;
            model.projectName  = projectName;
            model.time         = time;
            model.todayWork    = todayWork;
            model.problem      = problem;
            model.tomorrowWork = tomorrowWork;

            Maticsoft.BLL.Report bll = new Maticsoft.BLL.Report();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #2
0
 private void ShowInfo(int ID)
 {
     Maticsoft.BLL.Report   bll   = new Maticsoft.BLL.Report();
     Maticsoft.Model.Report model = bll.GetModel(ID);
     this.lblID.Text           = model.ID.ToString();
     this.lblname.Text         = model.name;
     this.lblprojectName.Text  = model.projectName;
     this.lbltime.Text         = model.time.ToString();
     this.lbltodayWork.Text    = model.todayWork;
     this.lblproblem.Text      = model.problem;
     this.lbltomorrowWork.Text = model.tomorrowWork;
 }
Example #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtname.Text.Trim().Length == 0)
            {
                strErr += "name不能为空!\\n";
            }
            if (this.txtprojectName.Text.Trim().Length == 0)
            {
                strErr += "projectName不能为空!\\n";
            }

            if (this.txttodayWork.Value.Trim().Length == 0)
            {
                strErr += "todayWork不能为空!\\n";
            }
            if (this.txtproblem.Value.Trim().Length == 0)
            {
                strErr += "problem不能为空!\\n";
            }
            if (this.txttomorrowWork.Value.Trim().Length == 0)
            {
                strErr += "tomorrowWork不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   name         = this.txtname.Text;
            string   projectName  = this.txtprojectName.Text;
            DateTime time         = DateTime.Parse(DateTime.Now.ToString());
            string   todayWork    = this.txttodayWork.Value;
            string   problem      = this.txtproblem.Value;
            string   tomorrowWork = this.txttomorrowWork.Value;

            Maticsoft.Model.Report model = new Maticsoft.Model.Report();
            model.name         = name;
            model.projectName  = projectName;
            model.time         = time;
            model.todayWork    = todayWork;
            model.problem      = problem;
            model.tomorrowWork = tomorrowWork;

            Maticsoft.BLL.Report bll = new Maticsoft.BLL.Report();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }