示例#1
0
        void editData()
        {
            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();
            frmJobEdit frmEdit = new frmJobEdit("", guidKey);

            frmEdit.ShowDialog();
        }
示例#2
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
        }