Esempio n. 1
0
        protected void btnSave_Click(object sender, EventArgs p1)
        {
            if (Id > 0)
            {
                #region __________Edit__________
                model           = bll.GetModel(Id);
                model.C_Name    = txtC_Name.Text;
                model.C_Code    = txtC_Code.Text;
                model.C_Content = txtC_Content.Text;
                model.Islock    = chkislock.Checked ? 1 : 0;
                if (bll.Update(model))
                {
                    //B_operationLog.CreateOperationLog(B_operationLog.operationLogType.Edit, "", "");
                    MessageBox.JSLoad(this, "alert('保存成功!');window.location.href='sktcourselist.aspx'");
                }
                #endregion
            }
            else
            {
                #region __________Add__________
                model.C_Name    = txtC_Name.Text;
                model.C_Code    = txtC_Code.Text;
                model.C_Content = txtC_Content.Text;
                model.Islock    = chkislock.Checked ? 1 : 0;

                if (bll.Add(model))
                {
                    //B_operationLog.CreateOperationLog(B_operationLog.operationLogType.Add, "", "");
                    MessageBox.JSLoad(this, "alert('保存成功!');window.location.href='sktcourselist.aspx'");
                }
                #endregion
            }
        }
Esempio n. 2
0
 private void InitData()
 {
     if (Id > 0)
     {//edit
         model = bll.GetModel(Id);
         if (model != null)
         {
             txtC_Name.Text    = model.C_Name;
             txtC_Code.Text    = model.C_Code;
             txtC_Content.Text = model.C_Content;
             if (txtC_Code.Text != "")
             {
                 txtC_Code.Enabled = false;
             }
             chkislock.Checked = model.Islock == 1;
         }
     }
     else
     {
         txtC_Code.Text = bll.GetMaxCode();
     }
 }