Beispiel #1
0
        //保存
        private void Save(object sender, EventArgs e)
        {
            try
            {
                this.gridView1.CloseEditor();
                this.gridView1.UpdateCurrentRow();
                this.SaveCheck();

                if (this.opState == OpState.Add)
                {
                    this.guid = controller.Add(model);
                }
                else if (this.opState == OpState.Update)
                {
                    model.cModifier   = Information.UserInfo.cUser_Name;
                    model.dModifyDate = DateTime.Now;
                    controller.Update(model);
                }

                opState = OpState.Browse;
                model   = controller.Get(guid);
                RefreshUI();
                //model.Details.ForEach(p => p.ModelState = ModelState.unChanged);
                //this.opState = OpState.Browse;
                //UIControl.SetStatus(this, opState);
            }
            catch (Exception ex)
            {
                MsgBox.ShowInfoMsg(ex.Message);
            }
        }
Beispiel #2
0
        //新增
        private void Add(object sender, EventArgs e)
        {
            model       = new QmReport();
            model.dDate = DateTime.Now.Date;
            opState     = OpState.Add;

            this.RefreshUI();
        }
Beispiel #3
0
 //取消
 private void Cancel(object sender, EventArgs e)
 {
     this.opState = OpState.Browse;
     this.model   = controller.Get(guid);
     if (model == null)
     {
         model = new QmReport();
     }
     this.RefreshUI();
 }
Beispiel #4
0
 //弃审
 private void UnAudit(object sender, EventArgs e)
 {
     if (controller.UnAudit(guid))
     {
         model = controller.Get(guid);
         RefreshUI();
     }
     else
     {
         MsgBox.ShowInfoMsg("弃审失败!");
     }
 }
Beispiel #5
0
        //审核
        private void Audit(object sender, EventArgs e)
        {
            try
            {
                controller.U8PuStoreIn(this.model);
            }
            catch (Exception ex)
            {
                MsgBox.ShowInfoMsg("生成U8采购入库单出错: " + ex.Message);
                return;
            }

            if (controller.Audit(guid, Information.UserInfo.cUser_Name))
            {
                model = controller.Get(guid);
                RefreshUI();
            }
            else
            {
                MsgBox.ShowInfoMsg("审核失败!");
            }
        }
Beispiel #6
0
 public FmQmReport(QmReport model) : this()
 {
     this.opState      = OpState.Add;
     this.model        = model;
     this.model.QMCode = "自动生成";
 }
Beispiel #7
0
 //删除
 private void Delete(object sender, EventArgs e)
 {
     this.controller.Delete(guid);
     this.model = new QmReport();
     this.RefreshUI();
 }