Ejemplo n.º 1
0
        public WCFAddUpdateResult UpdateOrInsertList(List <ORD_PurchaseReturnLineResult> list)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                #region 判断
                if (list.Count <= 0)
                {
                    throw new WarnException("没有需要操作的对象!");
                }
                #endregion
                foreach (ORD_PurchaseReturnLineResult lineResult in list)
                {
                    if (lineResult.PRLineGuid.ToGuid() != Guid.Empty)
                    {
                        lineResult.UpdatedEmpID   = this.SessionInfo.UserID;
                        lineResult.UpdatedEmpName = this.SessionInfo.UserName;
                        lineResult.UpdatedTime    = DateTime.Now;
                    }
                    else
                    {
                        lineResult.PRLineGuid     = Guid.NewGuid();
                        lineResult.CreatedEmpID   = this.SessionInfo.UserID;
                        lineResult.CreatedEmpName = this.SessionInfo.UserName;
                        lineResult.CreatedTime    = DateTime.Now;
                        lineResult.IsDeleted      = false;
                    }
                }
                int affect = 0;
                this.BatchInsertOrUpdate <ORD_PurchaseReturnLineResult>(list);
                affect = this.BatchExecute();
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 2
0
 private void btnSaveEditModule_Click(object sender, EventArgs e)
 {
     DevComponents.AdvTree.Node node = this.treMenu.SelectedNode;
     if (node == null)
     {
         this.ShowMessage("请指定菜单!");
         return;
     }
     Sys_ModuleResult   info     = Form_GetEditEntity("module") as Sys_ModuleResult;
     Sys_ModuleLogic    logic    = new Sys_ModuleLogic(this);
     WCFAddUpdateResult pageList = this.AsyncExecute <WCFAddUpdateResult, Sys_ModuleResult>(info, logic.AddOrUpdate, (a) => { if (a.Key.ToInt32() > 0)
                                                                                                                              {
                                                                                                                                  this.grpEditModule.Visible = false; this.BindModuleList(); this.HidEditWindow();
                                                                                                                              }
                                                                                            });
 }
Ejemplo n.º 3
0
        private void tsbSave_Click(object sender, EventArgs e)
        {
            STK_OutResult info = Form_GetEditEntity() as STK_OutResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            bool flag = false;

            foreach (STK_OutLineResult rst in addOrModifyList)
            {
                if (string.IsNullOrEmpty(rst.Model) || rst.UnitPrice.ToDecimal() <= 0 || rst.Qty.ToInt32() <= 0)
                {
                    flag = true;
                    break;
                }
            }

            bsStkOutLine.EndEdit();
            tempList.Clear();
            foreach (STK_OutLineResult rst in addOrModifyList)
            {
                if (rst.HasChanged())
                {
                    tempList.Add(rst);
                }
            }
            //tempList.AddRange(addOrModifyList);
            tempList.AddRange(delList);
            info.StkOutLineList = tempList;
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, STK_OutResult>(info, stkOutLogic.AddOrUpdate, (a) =>
            {
                if (a.KeyGuid.ToGuid() != Guid.Empty)
                {
                    StkOutGuid = a.KeyGuid.ToGuid();

                    if (SaveAttach != null)
                    {
                        SaveAttach("STK_Out", StkOutGuid.ToGuid(), a.BillNo);
                    }
                    InitData();
                    delList.Clear();
                }
            });
        }
Ejemplo n.º 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            FIN_SubmitExpenseResult info = Form_GetEditEntity() as FIN_SubmitExpenseResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            bool flag = false;

            foreach (FIN_SubmitExpenseLineResult rst in addOrModifyList)
            {
                if (string.IsNullOrEmpty(rst.ExpName) || string.IsNullOrEmpty(rst.Amount.ToStringHasNull()))
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                this.ShowMessage("费用名目和报销金额不能为空!");
                return;
            }



            bsExpenseLine.EndEdit();
            tempList.Clear();
            foreach (FIN_SubmitExpenseLineResult rst in addOrModifyList)
            {
                if (rst.HasChanged())
                {
                    tempList.Add(rst);
                }
            }

            tempList.AddRange(delList);
            info.ExpenseLineList = tempList;
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, FIN_SubmitExpenseResult>(info, expenseLogic.AddOrUpdate, (a) =>
            {
                expID = a.Key;
                this.SetDataIsNoChanged();
                InitData();
                delList.Clear();
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     删除角色
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(Sys_RoleParam param)
        {
            CheckSession();
            var ret = new WCFAddUpdateResult();

            try
            {
                #region 判断

                if (param.RoleID.ToInt32() <= 0)
                {
                    throw new WarnException("请指定要删除的模块ID!");
                }
                if (this.Count <Sys_EmpDataRight>(Sys_EmpDataRight._.IsDeleted == false && Sys_EmpDataRight._.RoleIDs.Like("%," + param.RoleID.ToStringHasNull() + ",%")) >= 0)
                {
                    throw new WarnException("存在业务引用,不允许删除!");
                }
                if (this.Count <Sys_RoleRight>(Sys_RoleRight._.RoleID == param.RoleID && Sys_RoleRight._.IsDeleted == false) >= 0)
                {
                    throw new WarnException("存在业务引用,不允许删除!");
                }
                #endregion

                WhereClip where = GetWhereClip(param);
                var info = new Sys_RoleResult {
                    IsDeleted = true
                };
                var affect = Update(info, @where);

                #region 设置返回值

                ret.Key = affect;

                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (Exception exp)
            {
                LogInfoBLL.WriteLog(SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 添加和新增修改
        /// </summary>
        /// <param name="param">新增或修改的实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult AddOrUpdate(Sys_EmpDataRightResult param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                int affect = 0;
                #region 判断


                #endregion

                #region 系统默认值
                if (param.SysEmpRoleID != 0)
                {
                    WhereClip where = Sys_EmpDataRight._.SysEmpRoleID == param.SysEmpRoleID;
                    affect          = this.Update <Sys_EmpDataRightResult>(param, where);
                }
                else
                {
                    param.IsDeleted  = false;
                    param.GCompanyID = this.SessionInfo.CompanyID;
                    affect           = this.Insert <Sys_EmpDataRightResult>(param);
                    param            = this.Select <Sys_EmpDataRightResult>(new List <Field>()
                    {
                        Sys_EmpDataRight._.SysEmpRoleID
                    }, Sys_EmpDataRight._.EmpID == param.EmpID);
                }
                #region 设置返回值
                ret.Key = param.SysEmpRoleID.ToInt32();
                #endregion

                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 7
0
        private void tsbSave_Click(object sender, EventArgs e)
        {
            ORD_PurchaseReturnResult info = Form_GetEditEntity() as ORD_PurchaseReturnResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }

            bsPurchaseReturnLine.EndEdit();
            tempList.Clear();
            foreach (ORD_PurchaseReturnLineResult rst in addOrModifyList)
            {
                if (rst.HasChanged())
                {
                    tempList.Add(rst);
                }
            }
            //tempList.AddRange(addOrModifyList);
            tempList.AddRange(delList);
            info.ReturnLineList = tempList;
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, ORD_PurchaseReturnResult>(info, returnLogic.AddOrUpdate, (a) =>
            {
                if (a.KeyGuid.ToGuid() != Guid.Empty)
                {
                    PRGuid = a.KeyGuid.ToGuid();
                    CRM_CompanyResult companyResult = companyLogic.GetCustInfo(new CRM_CompanyParam()
                    {
                        CompanyID = txtSupplierID.Text.ToInt32()
                    });
                    if (companyResult != null)
                    {
                        companyResult.LastBusinessDate = txtReturnDate.Text.ToDateTime();
                        companyLogic.AddOrUpdateSup(companyResult);
                    }
                    if (SaveAttach != null)
                    {
                        SaveAttach("ORD_PurchaseReturn", PRGuid.ToGuid(), a.BillNo);
                    }

                    InitData();
                    delList.Clear();
                }
            });
        }
Ejemplo n.º 8
0
        private void btnCancelCheck_Click(object sender, EventArgs e)
        {
            WF_AuditRecordLogic logicWF  = new WF_AuditRecordLogic(this);
            WCFAddUpdateResult  rstAudit = logicWF.TakeBackBill(new Entity.UserModel.WF.WF_AuditRecordParam()
            {
                SourceTableEngName = _tableName,
                SourceBillGuid     = _sourceGuidKey,
            });

            if (rstAudit.Key > 0)
            {
                if (AfterPassEvent != null)
                {
                    AfterPassEvent();
                }
                this.Close();
            }
        }
Ejemplo n.º 9
0
        private void btnSaveRoleRight_Click(object sender, EventArgs e)
        {
            Sys_RoleRightResult        param;
            List <Sys_RoleRightResult> list = new List <Sys_RoleRightResult>();

            for (int i = 0; i < dgvModule.Rows.Count; i++)
            {
                param             = new Sys_RoleRightResult();
                param.RoleRightID = dgvModule.Rows[i].Cells["colRoleRightID"].Value.ToInt32();
                param.ActionCode  = dgvModule.Rows[i].Cells["colActionCode"].Value.ToStringHasNull();
                list.Add(param);
            }

            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, List <Sys_RoleRightResult> >(list, roleRightLogic.UpdateOrInsertList, (a) =>
            {
                BindDataGridView(1);
            });
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 批量修改和插入
        /// </summary>
        /// <param name="paramList"></param>
        /// <returns></returns>
        public WCFAddUpdateResult UpdateOrInsertList(List <STK_InOutLinkResult> list)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                #region 判断

                #endregion
                foreach (STK_InOutLinkResult linkResult in list)
                {
                    if (linkResult.StkLinkGuid.ToGuid() != Guid.Empty)
                    {
                        linkResult.UpdatedEmpID   = this.SessionInfo.UserID;
                        linkResult.UpdatedEmpName = this.SessionInfo.UserName;
                        linkResult.UpdatedTime    = DateTime.Now;
                    }
                    else
                    {
                        linkResult.CreatedEmpID   = this.SessionInfo.UserID;
                        linkResult.CreatedEmpName = this.SessionInfo.UserName;
                        linkResult.CreatedTime    = DateTime.Now;
                        linkResult.IsDeleted      = false;
                    }
                }
                int affect = 0;
                this.BatchInsertOrUpdate <STK_InOutLinkResult>(list);
                affect = this.BatchExecute();
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 11
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CRM_CompanyResult info = Form_GetEditEntity() as CRM_CompanyResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            bool flag = false;

            foreach (CRM_CompanyContactResult rst in addOrModifyList)
            {
                if (string.IsNullOrEmpty(rst.ContactName) || string.IsNullOrEmpty(rst.Telephone))
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                this.ShowMessage("联系人和联系电话不能为空!");
                return;
            }

            bsContact.EndEdit();
            tempList.Clear();
            foreach (CRM_CompanyContactResult rst in addOrModifyList)
            {
                if (rst.HasChanged())
                {
                    tempList.Add(rst);
                }
            }

            tempList.AddRange(delList);
            info.ContactList = tempList;
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_CompanyResult>(info, companyLogic.AddOrUpdateSup, (a) =>
            {
                companyID = a.Key;
                InitData();
                delList.Clear();
            });
        }
Ejemplo n.º 12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CRM_VisitPlanLineResult info = Form_GetEditEntity() as CRM_VisitPlanLineResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_VisitPlanLineResult>(info, planLineLogic.AddOrUpdate, (a) =>
            {
                if (a.Key > 0)
                {
                    custVstPlnLineID = a.Key;
                    this.SetDataIsNoChanged();
                    InitData();
                }
            });
        }
Ejemplo n.º 13
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            HR_EmployeeResult info = Form_GetEditEntity() as HR_EmployeeResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, HR_EmployeeResult>(info, empLogic.AddOrUpdate, (a) =>
            {
                if (a.Key > 0)
                {
                    txtEmpID.Text   = a.Key.ToString();
                    txtEmpGuid.Text = a.KeyGuid.ToString();
                    SetDataIsNoChanged();
                }
            });
        }
Ejemplo n.º 14
0
        private void btnDelDept_Click(object sender, EventArgs e)
        {
            HR_DepartmentParam param = new HR_DepartmentParam();

            param.DeptID = (int)deptID;
            HR_DepartmentResult rst = deptLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除部门:【" + rst.DeptName + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, HR_DepartmentParam>(param, deptLogic.DelInfo, (a) => { BindOrgTree(); });
                }
            }
            else
            {
                this.ShowMessage("请选择要删除的部门!");
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(CRM_VisitPlanParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.CustVstPlnID == null)
                {
                    throw new WarnException("请指定要删除的记录!");
                }
                #endregion
                WhereClip where = GetWhereClip(param);
                //CRM_VisitPlanResult oldInfo = this.GetInfo(param);
                //oldInfo = Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanResult>(oldInfo, "BeLongEmpID", "", "OrgID", this.SessionInfo);
                //if (oldInfo.RecStatu != 2)
                //{
                //    throw new WarnException("您无权删除当前记录!");
                //}
                CRM_VisitPlanResult info = new CRM_VisitPlanResult();
                info.IsDeleted      = true;
                info.UpdatedTime    = DateTime.Now;
                info.UpdatedEmpID   = this.SessionInfo.UserID;
                info.UpdatedEmpName = this.SessionInfo.UserName;
                affect = this.Update <CRM_VisitPlanResult>(info, where);
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 16
0
        private void btnTakeBack_Click(object sender, EventArgs e)
        {
            CRM_JobMastResult  info = Form_GetEditEntity() as CRM_JobMastResult;
            WCFAddUpdateResult rst  = new WCFAddUpdateResult();

            if (GuidKey != null)
            {
                WF_AuditRecordLogic logicWF  = new WF_AuditRecordLogic(this);
                WCFAddUpdateResult  rstAudit = logicWF.TakeBackBill(new Entity.UserModel.WF.WF_AuditRecordParam()
                {
                    SourceTableEngName = "CRM_JobMast",
                    SourceBillGuid     = info.EmpJobGuid
                });
                if (rstAudit.Key > 0)
                {
                    LoadData();
                    this.ShowMessage("收回成功!");
                }
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="dgv"></param>
        public void SaveData()
        {
            Sys_EmpRightResult        param;
            List <Sys_EmpRightResult> list = new List <Sys_EmpRightResult>();

            for (int i = 0; i < dgvModule.Rows.Count; i++)
            {
                param            = new Sys_EmpRightResult();
                param.EmpRightID = dgvModule.Rows[i].Cells["colEmpRightID"].Value.ToInt32();
                param.EmpID      = _empID;
                param.ModuleID   = dgvModule.Rows[i].Cells["colModuleID"].Value.ToInt32();
                param.ActionCode = dgvModule.Rows[i].Cells["colActionCode"].Value.ToStringHasNull();
                list.Add(param);
            }

            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, List <Sys_EmpRightResult> >(list, rightLogic.UpdateOrInsertList, (a) =>
            {
                BindDataGridView(1);
            });
        }
Ejemplo n.º 18
0
        private void btnDelOrg_Click(object sender, EventArgs e)
        {
            HR_OrgParam param = new HR_OrgParam();

            param.OrgGuID = orgGuID;

            HR_OrgResult rst = orgLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除机构:【" + rst.OrgName + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, HR_OrgParam>(param, orgLogic.DelInfo, (a) => { BindOrgTree(); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的机构!");
            }
        }
Ejemplo n.º 19
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            ORD_SalesOrderParam param = new ORD_SalesOrderParam();

            param.SOID = soid;

            ORD_SalesOrderResult rst = orderLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除销售单:【" + rst.BillNo + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, ORD_SalesOrderParam>(param, orderLogic.DelInfo, a => { BindDataGridView(pgSalesOrder.PageIndex); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的销售明细!");
            }
        }
Ejemplo n.º 20
0
        private void tsbFrozenAccount_Click(object sender, EventArgs e)
        {
            List <FIN_CashBankAccountResult> rstList = new List <FIN_CashBankAccountResult>();

            foreach (DataGridViewRow dgvRow in dgvAccount.Rows)
            {
                if (dgvRow.Cells["colSelect"].Value.ToBooleanHasNull())
                {
                    FIN_CashBankAccountResult result = new FIN_CashBankAccountResult();
                    result.IsFrozen = true;
                    result.CBID     = dgvRow.Cells["colCBID"].Value.ToInt32();
                    rstList.Add(result);
                }
            }
            WCFAddUpdateResult wcfResult = this.AsyncExecute <WCFAddUpdateResult, List <FIN_CashBankAccountResult> >(rstList, accountLogic.UpdateOrInsertList, (a) => { if (a.Key > 0)
                                                                                                                                                                        {
                                                                                                                                                                            BindDataGrid();
                                                                                                                                                                        }
                                                                                                                     });
        }
Ejemplo n.º 21
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            ORD_PurchaseReturnParam param = new ORD_PurchaseReturnParam();

            param.PRGuid = _PRGuid;

            ORD_PurchaseReturnResult rst = returnLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除采购退货单:【" + rst.BillNo + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, ORD_PurchaseReturnParam>(param, returnLogic.DelInfo, a => { BindDataGridView(pgPurchaseReturn.PageIndex); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的采购退货单!");
            }
        }
Ejemplo n.º 22
0
        private void tsbDelAccount_Click(object sender, EventArgs e)
        {
            FIN_CashBankAccountParam param = new FIN_CashBankAccountParam();

            param.CBID = cbid;

            FIN_CashBankAccountResult rst = accountLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除银行账号:【" + rst.CBNo + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, FIN_CashBankAccountParam>(param, accountLogic.DelInfo, (a) => { BindDataGrid(); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的银行账号!");
            }
        }
Ejemplo n.º 23
0
        private void tsbDelVisitPlan_Click(object sender, EventArgs e)
        {
            CRM_VisitPlanParam param = new CRM_VisitPlanParam();

            param.CustVstPlnID = custVstPlnID;

            CRM_VisitPlanResult rst = planLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除拜访计划:【" + rst.PlanName + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_VisitPlanParam>(param, planLogic.DelInfo, a => { BindDataGridView(pgPlan.PageIndex); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的拜访计划!");
            }
        }
Ejemplo n.º 24
0
        public void SaveAttach(string sourceTable, Guid sourceGuid, string sourceBillNo)
        {
            bsAttach.EndEdit();
            tempList.Clear();
            foreach (Sys_AttachFilesResult rst in addOrModifyList)
            {
                if (rst.HasChanged())
                {
                    if (rst.AttachID <= 0)
                    {
                        rst.AttachGuID     = Guid.NewGuid();
                        rst.SourceTable    = sourceTable;
                        rst.SourceGuid     = sourceGuid;
                        rst.SourceBillNo   = sourceBillNo;
                        rst.CreatedEmpID   = this.SessionInfo.UserID;
                        rst.CreatedEmpName = this.SessionInfo.UserName;
                        rst.CreatedTime    = DateTime.Now;
                        rst.IsDeleted      = false;
                    }
                    else
                    {
                        rst.UpdatedEmpID   = this.SessionInfo.UserID;
                        rst.UpdatedEmpName = this.SessionInfo.UserName;
                        rst.UpdatedTime    = DateTime.Now;
                    }
                    tempList.Add(rst);
                }
            }

            tempList.AddRange(delList);
            if (tempList.Count > 0)
            {
                WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, List <Sys_AttachFilesResult> >(tempList, fileLogic.UpdateOrInsertList, (a) =>
                {
                    if (a.Key > 0)
                    {
                        BindDataGridView(pgAttach.PageIndex);
                    }
                });
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(Sys_MenuParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.MenuID.ToInt32() <= 0)
                {
                    throw new WarnException("请指定要删除的菜单ID!");
                }
                #endregion
                #region 业务关联判断
                if (this.Count <Sys_Module>(Sys_Module._.MenuID == param.MenuID && Sys_Module._.IsDeleted == false) > 0)
                {
                    throw new WarnException("已发生业务关联!");
                }
                #endregion

                WhereClip where = GetWhereClip(param);
                Sys_MenuResult info = new Sys_MenuResult();
                info.IsDeleted = true;
                affect         = this.Update <Sys_MenuResult>(info, where);
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
            }
            return(ret);
        }
Ejemplo n.º 26
0
        public WCFAddUpdateResult SubmitOrAuditBill(AuditBillParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            if (param.OldBillStatus.ToStringHasNull().ToLower() == "new" && param.NewBillStatus.ToStringHasNull().ToLower() == "approve" ||
                param.OldBillStatus.ToStringHasNull().ToLower() == "new" && param.NewBillStatus.ToStringHasNull().ToLower() == "complete")
            {
                SubmitStkInBill(new STK_InParam()
                {
                    StkInGuid = param.SourceBillGuid
                });
            }
            if (param.NewBillStatus.ToStringHasNull().ToLower() == "complete")
            {
                AuditStkInBill(new STK_InParam()
                {
                    StkInGuid = param.SourceBillGuid
                });
            }

            return(ret);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 批量修改和插入
        /// </summary>
        /// <param name="paramList"></param>
        /// <returns></returns>
        public WCFAddUpdateResult UpdateOrInsertList(List <CRM_ZoneResult> list)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                #region 判断
                if (list.Count <= 0)
                {
                    throw new WarnException("没有需要操作的对象!");
                }
                #endregion
                int affect = 0;
                foreach (CRM_ZoneResult rst in list)
                {
                    rst.GCompanyID = this.SessionInfo.CompanyID;
                    if (rst.ZID <= 0)
                    {
                        rst.ZGuID = Guid.NewGuid();
                    }
                }
                affect += this.BatchInsertOrUpdate <CRM_ZoneResult>(list);
                this.BatchExecute();
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Ejemplo n.º 28
0
        void DelModule()
        {
            DataGridViewCell cell = this.dgvModule.CurrentCell;

            if (cell == null || cell.RowIndex < 0)
            {
                this.ShowMessage("请选择要删除的模块!");
                return;
            }
            int moduleID = 0;

            moduleID = this.dgvModule["col_Sys_Module_ModuleID", cell.RowIndex].Value.ToInt32();
            if (MessageBox.Show("是否真的删除当前记录?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            Sys_ModuleParam info = new Sys_ModuleParam();

            info.ModuleID = moduleID;
            Sys_ModuleLogic    logic = new Sys_ModuleLogic(this);
            WCFAddUpdateResult rst   = this.AsyncExecute <WCFAddUpdateResult, Sys_ModuleParam>(info, logic.DelInfo, (a) => { this.BindModuleList(); });
        }
Ejemplo n.º 29
0
        /// <summary>
        ///     删除角色
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(Sys_RoleRightParam param)
        {
            CheckSession();
            var ret = new WCFAddUpdateResult();

            try
            {
                #region 判断

                if (param.RoleRightID.ToInt32() <= 0)
                {
                    throw new WarnException("请指定要删除的权限ID!");
                }

                #endregion

                WhereClip where = GetWhereClip(param);
                var info = new Sys_RoleRightResult {
                    IsDeleted = true
                };
                var affect = Update(info, @where);

                #region 设置返回值

                ret.Key = affect;

                #endregion
            }
            catch (WarnException)
            {
                throw;
            }
            catch (Exception exp)
            {
                LogInfoBLL.WriteLog(SessionInfo, exp);
            }
            return(ret);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 批量修改和插入
        /// </summary>
        /// <param name="paramList"></param>
        /// <returns></returns>
        public WCFAddUpdateResult UpdateOrInsertList(List <Sys_RoleRightResult> list)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                #region 判断
                if (list.Count <= 0)
                {
                    throw new WarnException("没有需要保存的对象!");
                }
                #endregion
                int affect = 0;
                foreach (Sys_RoleRightResult info in list)
                {
                    info.GCompanyID = this.SessionInfo.CompanyID;
                    if (info.IsDeleted == null)
                    {
                        info.IsDeleted = false;
                    }
                }
                affect += this.BatchInsertOrUpdate <Sys_RoleRightResult>(list);
                this.BatchExecute();
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
            }
            return(ret);
        }