コード例 #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtID.Text))
            {
                strErr += "ID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtFolderID.Text))
            {
                strErr += "FolderID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtsortOrder.Text))
            {
                strErr += "sortOrder格式错误!\\n";
            }
            if (this.txtQuestion.Text.Trim().Length == 0)
            {
                strErr += "Question不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtRelatedID.Text))
            {
                strErr += "RelatedID格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    ID           = int.Parse(this.txtID.Text);
            int    FolderID     = int.Parse(this.txtFolderID.Text);
            bool   isOffLine    = this.chkisOffLine.Checked;
            bool   isPublic     = this.chkisPublic.Checked;
            bool   isVariations = this.chkisVariations.Checked;
            int    sortOrder    = int.Parse(this.txtsortOrder.Text);
            string Question     = this.txtQuestion.Text;
            int    RelatedID    = int.Parse(this.txtRelatedID.Text);


            eChartProject.Model.eChart.Server_Contents_Message model = new eChartProject.Model.eChart.Server_Contents_Message();
            model.ID           = ID;
            model.FolderID     = FolderID;
            model.isOffLine    = isOffLine;
            model.isPublic     = isPublic;
            model.isVariations = isVariations;
            model.sortOrder    = sortOrder;
            model.Question     = Question;
            model.RelatedID    = RelatedID;

            eChartProject.BLL.eChart.Server_Contents_Message bll = new eChartProject.BLL.eChart.Server_Contents_Message();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
コード例 #2
0
ファイル: Show.aspx.cs プロジェクト: wwkkww1983/Csharp
 private void ShowInfo()
 {
     eChartProject.BLL.eChart.Server_Contents_Message   bll   = new eChartProject.BLL.eChart.Server_Contents_Message();
     eChartProject.Model.eChart.Server_Contents_Message model = bll.GetModel();
     this.lblID.Text           = model.ID.ToString();
     this.lblFolderID.Text     = model.FolderID.ToString();
     this.lblisOffLine.Text    = model.isOffLine?"是":"否";
     this.lblisPublic.Text     = model.isPublic?"是":"否";
     this.lblisVariations.Text = model.isVariations?"是":"否";
     this.lblsortOrder.Text    = model.sortOrder.ToString();
     this.lblQuestion.Text     = model.Question;
     this.lblRelatedID.Text    = model.RelatedID.ToString();
 }
コード例 #3
0
 private void ShowInfo()
 {
     eChartProject.BLL.eChart.Server_Contents_Message   bll   = new eChartProject.BLL.eChart.Server_Contents_Message();
     eChartProject.Model.eChart.Server_Contents_Message model = bll.GetModel();
     this.txtID.Text              = model.ID.ToString();
     this.txtFolderID.Text        = model.FolderID.ToString();
     this.chkisOffLine.Checked    = model.isOffLine;
     this.chkisPublic.Checked     = model.isPublic;
     this.chkisVariations.Checked = model.isVariations;
     this.txtsortOrder.Text       = model.sortOrder.ToString();
     this.txtQuestion.Text        = model.Question;
     this.txtRelatedID.Text       = model.RelatedID.ToString();
 }