Ejemplo n.º 1
0
        bool SaveData()
        {
            bool ret = false;
            CRM_JobMastResult  info = Form_GetEditEntity() as CRM_JobMastResult;
            WCFAddUpdateResult rst  = new WCFAddUpdateResult();

            if (this.DataIsChanged)
            {
                CRM_JobMastLogic logic = new CRM_JobMastLogic(this);
                rst = logic.AddOrUpdate(info);
            }
            else
            {
                rst.KeyGuid = info.EmpJobGuid;
            }
            if (rst.KeyGuid != null)
            {
                ret = true;
            }
            else
            {
                ret = false;
            }
            return(ret);
        }
Ejemplo n.º 2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            CRM_JobMastResult  info = Form_GetEditEntity() as CRM_JobMastResult;
            WCFAddUpdateResult rst  = new WCFAddUpdateResult();

            if (this.DataIsChanged)
            {
                CRM_JobMastLogic logic = new CRM_JobMastLogic(this);
                rst = logic.AddOrUpdate(info);
            }
            else
            {
                rst.KeyGuid = info.EmpJobGuid;
            }
            if (rst.KeyGuid != null)
            {
                WF_AuditRecordLogic logicWF  = new WF_AuditRecordLogic(this);
                WCFAddUpdateResult  rstAudit = logicWF.SubmitBill(new Entity.UserModel.WF.WF_AuditRecordParam()
                {
                    SourceTableEngName = "CRM_JobMast",
                    SourceBillGuid     = info.EmpJobGuid,
                    SourceBillNo       = info.BillNo
                });
                if (rstAudit.Key > 0)
                {
                    LoadData();
                    this.ShowMessage("提交成功!");
                }
            }
        }
Ejemplo n.º 3
0
        void BindData(int pageIndex)
        {
            CRM_JobMastLogic logic = new CRM_JobMastLogic(this);
            CRM_JobMastParam param = new CRM_JobMastParam();

            param           = this.ConvertControlToEntity <CRM_JobMastParam>(this.panTop.Controls, param, null);
            param.PageIndex = pageIndex;
            param.PageSize  = this.pagMain.PageSize;
            param.IsPage    = true;
            PageList <CRM_JobMastResult> pageList = this.AsyncExecute <PageList <CRM_JobMastResult>, CRM_JobMastParam>(param, logic.GetPageList, BindDataComplete);
        }
Ejemplo n.º 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CRM_JobMastResult info = Form_GetEditEntity() as CRM_JobMastResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            CRM_JobMastLogic   logic    = new CRM_JobMastLogic(this);
            WCFAddUpdateResult pageList = this.AsyncExecute <WCFAddUpdateResult, CRM_JobMastResult>(info, logic.AddOrUpdate, SaveComplete);
        }
Ejemplo n.º 5
0
        void LoadData()
        {
            if (GuidKey == null)
            {
                return;
            }
            CRM_JobMastLogic  logic = new CRM_JobMastLogic(this);
            CRM_JobMastResult rst   = logic.GetInfo(new CRM_JobMastParam()
            {
                EmpJobGuid = GuidKey
            });

            if (rst == null)
            {
                return;
            }

            this.ConvertEntityToControl(this.grpMain.Controls, rst, null);
            this.ConvertEntityToControl(this.grpContext.Controls, rst, null);
            this.ConvertEntityToControl(this.panEditInfo.Controls, rst, null);
            this.CheckIsReadOnly <CRM_JobMastResult>(rst);
            this.CheckAuditStatus <CRM_JobMastResult>(rst, this.grpMain, this.grpContext, this.panEditInfo);
            this.chkJobType1.Checked = false;
            this.chkJobType2.Checked = false;
            this.chkJobType3.Checked = false;

            if (rst.JobType == "日报")
            {
                this.chkJobType1.Checked = true;
            }
            if (rst.JobType == "周报")
            {
                this.chkJobType2.Checked = true;
            }
            if (rst.JobType == "月报")
            {
                this.chkJobType3.Checked = true;
            }
            this.EditBeforeData = rst;

            CheckAuditButton("CRM_JobMast", GuidKey, this.btnSubmit, this.btnTakeBack, this.btnCheck, this.btnCancelCheck);
            this.DataIsChanged = false;
        }
Ejemplo n.º 6
0
        private void tlbMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string jobType = "";

            #region 新增
            if (e.ClickedItem.Name == "tlbAdd1" || e.ClickedItem.Name == "tlbAdd2" || e.ClickedItem.Name == "tlbAdd3")
            {
                if (e.ClickedItem.Name == "tlbAdd1")
                {
                    jobType = "日报";
                }
                if (e.ClickedItem.Name == "tlbAdd2")
                {
                    jobType = "周报";
                }
                if (e.ClickedItem.Name == "tlbAdd3")
                {
                    jobType = "月报";
                }
                frmJobEdit frmEdit = new frmJobEdit(jobType, null);
                frmEdit.ShowDialog();
            }
            #endregion
            #region 修改
            else if (e.ClickedItem.Name == "tlbEdit")
            {
                editData();
            }
            #endregion
            #region  除
            if (e.ClickedItem.Name == "tlbDel")
            {
                int rowIdx = this.dgvMain.CurrentCell == null ? -1 : this.dgvMain.CurrentCell.RowIndex;
                if (rowIdx < 0)
                {
                    this.ShowMessage("请指定要删除记录!");
                    return;
                }
                Guid?              guidKey = this.dgvMain["col_CRM_JobMast_EmpJobGuid", rowIdx].Value.ToGuid();
                CRM_JobMastLogic   logic   = new CRM_JobMastLogic(this);
                WCFAddUpdateResult rst     = logic.DelInfo(new CRM_JobMastParam()
                {
                    EmpJobGuid = guidKey
                });
                if (rst.Key > 0)
                {
                    BindData(this.pagMain.PageIndex);
                }
            }
            #endregion
            #region 审核
            else if (e.ClickedItem.Name == "tlbAuditBill")
            {
                auditBill();
            }
            #endregion
            #region 撤单
            else if (e.ClickedItem.Name == "tlbCancelBill")
            {
                cancelBill();
            }
            #endregion
        }