예제 #1
0
        //==============================

        public int AddClass(QMItemClass model)
        {
            string sql = "insert into QM_QMItemClass output inserted.QMCId values(@QMCCode, @QMCName, @cMaker, @dCreateDate)";

            model.dCreateDate = DateTime.Now;

            return(conn.ExecuteScalar <int>(sql, model));
        }
예제 #2
0
        private void FormLoad(object sender, EventArgs e)
        {
            #region 加载主窗体事件

            if (opState == OpState.Add)
            {
                model = new QMItemClass()
                {
                    cMaker = Information.UserInfo.cUser_Name
                };
                lblModuleTitle.Text = "新增 - " + this.lblModuleTitle.Text;
            }
            else if (opState == OpState.Update)
            {
                oldCode             = model.QMCCode;
                lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text;
            }

            UIControl.SetStatus(Head_Bar, tab_Main.AttachedControl, opState);

            UIBinding <QMItemClass> .UIDataBinding(panelEx1, model);

            #endregion
        }
예제 #3
0
        public void UpdateClass(QMItemClass model)
        {
            string sql = "update QM_QMItemClass set QMCCode = @QMCCode, QMCName = @QMCName where QMCId = @QMCId";

            conn.Execute(sql, model);
        }