示例#1
0
        public string PostAddPayMent([FromBody] GAppvalRecordModel recordModel)
        {
            if (recordModel == null || recordModel.RefbillPhid == 0)
            {
                return(DCHelper.ErrorMessage("单据id为空!"));
            }

            try
            {
                GAppvalRecordService.PostAddPayMent(recordModel);

                return(DCHelper.SuccessMessage("生成支付单成功!"));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#2
0
        protected void BindRepeater()
        {
            var searcher = GetSearcher();

            using (var db = DCHelper.SPhoneContext())
            {
                var query = db.SPhone_Role.Where(item => 1 == 1);
                if (!string.IsNullOrEmpty(searcher.RoleName))
                {
                    query = query.Where(item => item.RoleName.IndexOf(searcher.RoleName) != -1);
                }

                this.pager1.RecordCount = query.Count();
                this.rptList.DataSource = query.OrderByDescending(item => item.CreateTime)
                                          .Skip((this.pager1.CurrentPageIndex - 1) * this.pager1.PageSize).Take(this.pager1.PageSize).ToList();
                this.rptList.DataBind();
            }
        }
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         var id   = e.CommandArgument.ToString().Split(',')[0];
         var type = e.CommandArgument.ToString().Split(',')[1];
         using (var db = DCHelper.SPhoneContext())
         {
             var info = db.ivr_sugg_agency.FirstOrDefault(x => x.AGENCY_ID == id && x.PRODUCT_TYPE == type);
             if (info != null)
             {
                 info.VALID = "0";
                 db.SaveChanges();
             }
         }
         BindRepeater();
     }
 }
        /// <summary>
        /// chat黑名单
        /// </summary>
        /// <param name="CustName"></param>
        /// <returns></returns>
        public static int IsChatInBlack(string CustName)
        {
            using (var db = DCHelper.SPhoneContext())
            {
                var typeGUID = Guid.Parse("03679a4d-2408-42b6-aa83-4e05885fea9d");

                var query = db.SPhone_BlackList.Count(x =>
                                                      x.BlackListTypeID == typeGUID &&
                                                      x.IsDeleted == 0 &&
                                                      x.BillNo == CustName
                                                      );
                if (query > 0)
                {
                    return(1);
                }
                return(0);
            }
        }
        protected void btnExportAll_Click(object sender, EventArgs e)
        {
            var searcher = GetSearcher();

            if (searcher.ChatEndTime != null)
            {
                searcher.ChatEndTime = ((DateTime)searcher.ChatEndTime).Date.AddDays(1).AddSeconds(-1);
            }
            IEnumerable <SPhone_Chat> query = null;
            List <SPhone_Chat>        data  = null;

            using (var db = DCHelper.SPhoneContext())
            {
                query = db.SPhone_Chat.Where(item =>
                                             item.ChatBeginTime >= searcher.ChatBeginTime && item.ChatBeginTime <= searcher.ChatEndTime);
                if (!string.IsNullOrEmpty(searcher.ChatID))
                {
                    query = query.Where(item => item.ChatID.IndexOf(searcher.ChatID) != -1);
                }
                if (!string.IsNullOrEmpty(searcher.CustomerID))
                {
                    query = query.Where(item => item.CustomerID.IndexOf(searcher.CustomerID) != -1);
                }
                if (!string.IsNullOrEmpty(searcher.EmployeeID))
                {
                    query = query.Where(item => item.EmployeeID.IndexOf(searcher.EmployeeID) != -1);
                }
                if (!string.IsNullOrEmpty(searcher.PlaceIP))
                {
                    query = query.Where(item => item.PlaceIP.IndexOf(searcher.PlaceIP) != -1);
                }
                if (!string.IsNullOrEmpty(searcher.CurrentQueueName))
                {
                    query = query.Where(item => item.CurrentQueueName.IndexOf(searcher.CurrentQueueName) != -1);
                }
                if (!string.IsNullOrEmpty(searcher.MachineNo))
                {
                    query = query.Where(item => item.MachineNo.IndexOf(searcher.MachineNo) != -1);
                }
                data = query.ToList();
            }
            ExportData(data);
        }
示例#6
0
        public string GetApprovalPost([FromUri] GAppvalRecordModel recordModel)
        {
            if (recordModel == null || recordModel.ProcPhid == 0)
            {
                return(DCHelper.ErrorMessage("流程id为空!"));
            }

            try
            {
                List <GAppvalPostModel> postModels = GAppvalPostService.GetApprovalPost(recordModel.ProcPhid);
                return(DataConverterHelper.SerializeObject(new {
                    Status = "success",
                    Data = postModels
                }));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#7
0
        public string GetPaymentList4Zjbf([FromUri] Parameter parameters)
        {
            if (parameters == null || string.IsNullOrEmpty(parameters.uid))
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }
            if (string.IsNullOrEmpty(parameters.orgid))
            {
                return(DCHelper.ErrorMessage("组织编码为空!"));
            }
            if (string.IsNullOrEmpty(parameters.Ryear))
            {
                return(DCHelper.ErrorMessage("年度为空!"));
            }
            if (parameters.pageindex < 0 || parameters.pagesize == 0)
            {
                return(DCHelper.ErrorMessage("分页参数不正确!"));
            }

            string[] sorts = parameters.sort;
            if (sorts == null || sorts.Length < 1)
            {
                sorts = new string[] { "NgInsertDt desc" };
            }

            try
            {
                Dictionary <string, object> dicWhere = DataConverterHelper.ConvertToDic(parameters.queryfilter ?? "");

                //二次处理dic
                DCHelper.ConvertDic <GKPaymentMstModel>(dicWhere);

                var result = GKPaymentMstService.GetPaymentList4Zjbf(parameters.pageindex, parameters.pagesize, dicWhere, sorts);
                IList <GKPayment4ZjbfModel> list = result.Results;

                return(DCHelper.ModelListToJson <GKPayment4ZjbfModel>(list, result.TotalItems, parameters.pageindex, parameters.pagesize));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#8
0
        public string GetFirstStepOperator([FromUri] GAppvalProcModel procModel)
        {
            if (procModel == null || procModel.PhId == 0)
            {
                return(DCHelper.ErrorMessage("单据ID为空!"));
            }

            try
            {
                GAppvalPostModel postModel = GAppvalPostService.GetFirstStepOperator(procModel.PhId);

                return(DataConverterHelper.SerializeObject(new {
                    Status = "success",
                    Data = postModel
                }));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#9
0
        // 根据角色ID获取链接
        private static List <string> GetModulesInRole(Guid roleID)
        {
            List <string>        urls = new List <string>();
            List <SPhone_Module> lst  = null;

            using (var db = DCHelper.SPhoneContext())
            {
                List <Guid> mids = db.SPhone_RoleModule.Where(rm => rm.RoleID == roleID).Select(rm => rm.ModuleID).ToList();
                lst = db.SPhone_Module.ToList();
                mids.ForEach(id =>
                {
                    SPhone_Module module = lst.Find(m => m.ModuleID == id);
                    if (module != null)
                    {
                        urls.Add(module.ModuleUrl);
                    }
                });
            }
            return(urls);
        }
示例#10
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            Guid id = Guid.Empty;

            Guid.TryParse((string)e.CommandArgument, out id);
            if (e.CommandName == "Status")
            {
                using (var db = DCHelper.SPhoneContext())
                {
                    SPhone_IPDN dn = db.SPhone_IPDN.Where(item => item.ID == id).FirstOrDefault();
                    if (dn != null)
                    {
                        dn.IsValid = 0;
                        db.SaveChanges();

                        BindRepeater();
                    }
                }
            }
        }
示例#11
0
        protected void BindRepeater()
        {
            var searcher = GetSearcher();

            using (var db = DCHelper.SPhoneContext())
            {
                var query = db.SPhone_DNIS.Where(x => 1 == 1);

                if (!string.IsNullOrEmpty(searcher.DNISName))
                {
                    query = query.Where(x => x.DNISName.Contains(searcher.DNISName));
                }

                query = query.OrderByDescending(x => x.DNISID);

                rptList.DataSource = query.Skip((pager1.CurrentPageIndex - 1) * pager1.PageSize).Take(pager1.PageSize).ToList();
                rptList.DataBind();
                pager1.RecordCount = query.Count();
            }
        }
示例#12
0
        // 获取菜单树的值
        public static string GetTreeValue(Dictionary <string, int> selectedIDs)
        {
            List <SPhone_Module> modules = new List <SPhone_Module>();

            using (var db = DCHelper.SPhoneContext())
            {
                modules = db.SPhone_Module.ToList();
            }
            SPhone_Module root = new SPhone_Module()
            {
                ModuleID = Guid.Empty, ModuleName = "应用模块", ParentModuleID = Guid.Empty
            };

            if (root == null)
            {
                return(string.Empty);
            }

            JSONTree tree = new JSONTree(root.ModuleID.ToString(), root.ModuleName);

            SPhone_Module parent = null;

            foreach (SPhone_Module item in modules.OrderBy(item => item.CreateTime))
            {
                parent = modules.Find(o => o.ModuleID == item.ParentModuleID);
                if (parent == null)
                {
                    parent = root;
                }
                int    checkedSign = 0;
                string id          = item.ModuleID.ToString();
                if (selectedIDs.ContainsKey(id))
                {
                    checkedSign = selectedIDs[id];
                }
                bool showCheckbox = !item.ParentModuleID.Equals(Guid.Empty);
                tree.Root.AppendNode(item.ParentModuleID.ToString(), id, item.ModuleName
                                     , id, true, showCheckbox, checkedSign);
            }
            return(tree.ToString());
        }
示例#13
0
        public string GetAppvalRecordList([FromUri] GAppvalRecordModel recordModel)
        {
            if (recordModel == null || recordModel.RefbillPhid == 0)
            {
                return(DCHelper.ErrorMessage("申请单据ID为空!"));
            }
            if (string.IsNullOrEmpty(recordModel.FBilltype))
            {
                return(DCHelper.ErrorMessage("单据类型为空!"));
            }
            try
            {
                List <GAppvalRecordModel> recordModels = GAppvalRecordService.GetAppvalRecordList(recordModel.RefbillPhid, recordModel.FBilltype);
                if (recordModels.Count > 0)
                {
                    recordModels[0].SortNum = 0;
                    for (int j = 1; j < recordModels.Count; j++)
                    {
                        recordModels[j].SortNum = j;
                        if (recordModels[j].PostPhid == recordModels[j - 1].PostPhid && recordModels[j].PostPhid != 0)
                        {
                            recordModels[j].SortNum = recordModels[j - 1].SortNum;
                        }
                    }

                    for (int i = 0; i < recordModels.Count; i++)
                    {
                        recordModels[i].SameNum = recordModels.FindAll(t => t.SortNum == i).Count;
                    }
                }
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = recordModels
                }));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#14
0
 public string PostCancetGkPaymentList([FromBody] BaseSingleModel paramters)
 {
     try
     {
         if (paramters.fPhIdList == null || paramters.fPhIdList.Count() < 1)
         {
             return(DCHelper.ErrorMessage("传递的单据集合有误!"));
         }
         List <long> fCodes = new List <long>();
         for (int i = 0; i < paramters.fPhIdList.Count(); i++)
         {
             fCodes.Add(long.Parse(paramters.fPhIdList[i]));
         }
         var result = this.GKPaymentMstService.PostCancetGkPaymentList(fCodes);
         return(DataConverterHelper.SerializeObject(result));
     }
     catch (Exception ex)
     {
         return(DCHelper.ErrorMessage(ex.Message));
     }
 }
示例#15
0
        public string GetOperators([FromUri] GAppvalRecordModel recordModel)
        {
            if (recordModel == null)
            {
                return(DCHelper.ErrorMessage("请求参数为空!"));
            }

            try
            {
                List <GAppvalPost4OperModel> operModels = GAppvalPostService.GetOperators(recordModel);

                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = operModels
                }));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#16
0
 public static bool Logout(string EmployeeID)
 {
     using (var db = DCHelper.SPhoneContext())
     {
         var info = db.SPhone_LoginLog.Where(x => x.EmployeeID == EmployeeID &&
                                             x.LoginDate < DateTime.Now).OrderByDescending(x => x.CreateTime).FirstOrDefault();
         if (info != null)
         {
             if (info.FirstlogoutTime == null)
             {
                 info.FirstlogoutTime = DateTime.Now;
             }
             info.Lastlogout = DateTime.Now;
             info.UpdateBy   = EmployeeID;
             info.UpdateTime = DateTime.Now;
             db.SaveChanges();
             return(true);
         }
     }
     return(false);
 }
示例#17
0
 public string PostCancelAppvalRecord([FromBody] GAppvalRecordModel gAppval)
 {
     try
     {
         if (string.IsNullOrEmpty(gAppval.FBilltype))
         {
             return(DCHelper.ErrorMessage("单据类型不能为空!"));
         }
         if (gAppval.RefbillPhidList == null || gAppval.RefbillPhidList.Count < 1)
         {
             return(DCHelper.ErrorMessage("单据不能为空!"));
         }
         SavedResult <long> savedResult = new SavedResult <long>();
         savedResult = this.GAppvalRecordService.PostCancelAppvalRecord(gAppval);
         return(DataConverterHelper.SerializeObject(savedResult));
     }
     catch (Exception ex)
     {
         return(DCHelper.ErrorMessage(ex.Message));
     }
 }
示例#18
0
        public string PostDeleteProcType([FromBody] ProcRequestModel requestModel)
        {
            if (requestModel == null || requestModel.ApprovalTypeIds == null || requestModel.ApprovalTypeIds.Count == 0)
            {
                return(DCHelper.ErrorMessage("审批类型id为空!"));
            }

            try
            {
                //判断审批流程是否被引用
                foreach (long id in requestModel.ApprovalTypeIds)
                {
                    bool symbol = GAppvalProcService.ProcIsUsed(id);
                    //bool symbol = GAppvalProcService.ProcIsUsed(requestModel.ApprovalTypeId);
                    if (symbol)
                    {
                        return(DCHelper.ErrorMessage("删除失败,已有审批流程被引用!"));
                    }
                    var procs = this.GAppvalProcService.Find(t => t.SPLXPhid == id).Data;
                    if (procs != null && procs.Count > 0)
                    {
                        throw new Exception("此类型下已存在审批流,不能删除此审批流类型!");
                    }
                }

                DeletedResult deletedResult = GAppvalProcService.PostDeleteProcTypes(requestModel.ApprovalTypeIds);
                if (deletedResult != null && deletedResult.DelRows > 0)
                {
                    return(DCHelper.SuccessMessage("删除成功!"));
                }
                else
                {
                    return(DCHelper.ErrorMessage("删除失败!"));
                }
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
        protected void BindRepeater()
        {
            var searcher = GetSearcher();

            using (var db = DCHelper.SPhoneContext())
            {
                var query = db.SPhone_BlackList.Where(item => item.IsDeleted == 0);
                if (searcher.BlackListTypeID.HasValue)
                {
                    query = query.Where(item => item.BlackListTypeID == searcher.BlackListTypeID);
                }
                if (!string.IsNullOrEmpty(searcher.BillNo))
                {
                    query = query.Where(item => item.BillNo.IndexOf(searcher.BillNo) != -1);
                }

                this.pager1.RecordCount = query.Count();
                this.rptList.DataSource = query.OrderByDescending(item => item.CreateTime)
                                          .Skip((this.pager1.CurrentPageIndex - 1) * this.pager1.PageSize).Take(this.pager1.PageSize).ToList();
                this.rptList.DataBind();
            }
        }
示例#20
0
        public string PostGetCurrentDetails([FromBody] BankParamModel <BankAcnt> param)
        {
            string retStr = string.Empty;

            if (string.IsNullOrWhiteSpace(param.caller.callerIP))
            {
                string ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (string.IsNullOrWhiteSpace(ip))
                {
                    ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                }
                param.caller.callerIP = ip;
            }

            IBankServiceInterface bankService = null;

            switch (param.infoData.bankVersionInfo.shortName)
            {
            case "ICBCNC":
                bankService = icbcncBankFactory.CreateBankService();
                break;

            case "ICBCCMP":
                bankService = icbccmpBankFactory.CreateBankService();
                break;
            }

            if (bankService != null)
            {
                BankReturnModel <DetailInfo[]> retMo = bankService.getCurrentDetails(param.caller, param.infoData, param.minAmt, param.maxAmt, param.nextTag, "");
                bankService = null;
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("Data", retMo);
                DCHelper.ConvertDic2Success(dic);
                return(DCHelper.Message(dic));
            }

            return(retStr);
        }
示例#21
0
 public string GetMSYHProjectReport([FromUri] BaseListModel param)
 {
     if (param.FPhid == 0)
     {
         return(DCHelper.ErrorMessage("单据主键不能为空!"));
     }
     try
     {
         var result = this.XmReportMstService.GetMSYHProjectReport(param.FPhid);
         var data   = new
         {
             Status = ResponseStatus.Success,
             Msg    = "获取成功!",
             Data   = result
         };
         return(DataConverterHelper.SerializeObject(data));
     }
     catch (Exception ex)
     {
         return(DCHelper.ErrorMessage(ex.Message));
     }
 }
示例#22
0
        public string PostUpdate([FromBody] InfoBaseModel <GKPaymentModel> parameters)
        {
            try
            {
                if (parameters == null || string.IsNullOrEmpty(parameters.uid))
                {
                    return(DCHelper.ErrorMessage("用户id为空!"));
                }

                if (string.IsNullOrWhiteSpace(parameters.infoData.Mst.OrgCode))
                {
                    return(DCHelper.ErrorMessage("缺少组织号!"));
                }

                if (parameters.infoData.Mst.OrgPhid <= 0)
                {
                    return(DCHelper.ErrorMessage("组织Id有误!"));
                }

                if (string.IsNullOrWhiteSpace(parameters.infoData.Mst.FBilltype))
                {
                    return(DCHelper.ErrorMessage("缺少单据类型!"));
                }
                var flam2 = parameters.infoData.Mst.FDelete;
                if (flam2 == (byte)EnumYesNo.Yes)
                {
                    return(DCHelper.ErrorMessage("作废的单据不允许进行修改!"));
                }

                SavedResult <Int64> savedResult = this.GKPaymentMstService.SaveGKPayment(parameters.infoData);

                return(DataConverterHelper.SerializeObject(savedResult));
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }
示例#23
0
        public string PostRefreshPaymentState([FromBody] BaseSingleModel parameter)
        {
            if (parameter == null || string.IsNullOrEmpty(parameter.uid))
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }

            if (string.IsNullOrEmpty(parameter.id))
            {
                return(DCHelper.ErrorMessage("单据主键Phid为空!"));
            }

            /*
             * ICBCNCService icbcService = new ICBCNCService();
             * bool httpsState, signState;
             * string msg = icbcService.CheckNetSafeClient(out httpsState, out signState);
             * if (httpsState == false || signState == false)
             * {
             *  return DCHelper.ErrorMessage(msg + "  请联系系统管理员排查问题");
             * }
             */

            try
            {
                string errMsg = "";
                var    result = GKPaymentMstService.RefreshPaymentState(long.Parse(parameter.id), out errMsg);
                if (result == null && !string.IsNullOrEmpty(errMsg))
                {
                    return(DCHelper.ErrorMessage(errMsg));
                }

                return(DataConverterHelper.SerializeObject(result));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#24
0
        public async Task <string> PostRefreshAllPaymentsState()
        {
            //获取支付中且FSeqno不为空的数据
            var dicWhere = new Dictionary <string, object>();

            new CreateCriteria(dicWhere).Add(ORMRestrictions <byte> .Eq("FState", (byte)EnumPaymentState.DuringPayment));
            new CreateCriteria(dicWhere).Add(ORMRestrictions <string> .Gt("FSeqno", " "));

            var result = GKPaymentMstService.Find(dicWhere, new string[] { "NgInsertDt asc" }); //LoadWithPage(parameters.pageindex, parameters.pagesize, dicWhere, new string[] { "NgInsertDt asc" });

            if (result.IsError == false && result.Data != null)
            {
                IList <GKPaymentMstModel> list = result.Data;

                string errMsg = string.Empty;
                foreach (var mst in list)
                {
                    GKPaymentMstService.RefreshPaymentState(mst.PhId, out errMsg);
                }
            }

            return(DCHelper.SuccessMessage("批量刷新支付状态提交成功,后台处理中!"));
        }
示例#25
0
 public string GetAppvalPostOpersList([FromUri] PostRequestModel paramters)
 {
     //string userType = NG3.AppInfoBase.UserType;
     //return "";
     if (string.IsNullOrEmpty(paramters.Ucode))
     {
         throw new Exception("用户账号传递不正确!");
     }
     if (paramters.Orgid == 0)
     {
         throw new Exception("组织账号传递不正确!");
     }
     try
     {
         var result = this.GAppvalPostService.GetAppvalPostOpersList(paramters.PageIndex, paramters.PageSize, paramters.Orgid, paramters.Ucode, paramters.SearchOrgid, paramters.EnableMark, paramters.PostName);
         return(DCHelper.ModelListToJson(result, result.Count, paramters.PageIndex, paramters.PageSize));
         //return DataConverterHelper.SerializeObject(result);
     }
     catch (Exception ex)
     {
         return(DCHelper.ErrorMessage(ex.Message));
     }
 }
        public static void Create(string CallID, string EmployeeID, string ConnectionID, string ANI, string DNIS, int InOut, string CurrentQueueName, string FromQueueName, string PlaceIP)
        {
            var info = new Sphone_Call();

            info.CallID           = CallID;
            info.EmployeeID       = EmployeeID;
            info.ConnectionID     = ConnectionID;
            info.ANI              = ANI;
            info.DNIS             = DNIS;
            info.InOut            = InOut;
            info.CurrentQueueName = CurrentQueueName;
            info.FromQueueName    = FromQueueName;

            info.CallBeginTime = DateTime.Now;
            info.CreateBy      = EmployeeID;
            info.CreateTime    = DateTime.Now;
            info.PlaceIP       = PlaceIP;
            using (var db = DCHelper.SPhoneContext())
            {
                db.Sphone_Call.Add(info);
                db.SaveChanges();
            }
        }
示例#27
0
        protected void BindRepeater()
        {
            var searcher = GetSearcher();

            using (var db = DCHelper.SPhoneContext())
            {
                var query = db.SPhone_ChatText.Where(item => item.IsDeleted == 0);
                if (!string.IsNullOrEmpty(searcher.QueueName))
                {
                    query = query.Where(item => item.QueueName == searcher.QueueName);
                }
                if (searcher.ChatTextTypeID.HasValue)
                {
                    query = query.Where(item => item.ChatTextTypeID == searcher.ChatTextTypeID);
                }


                this.pager1.RecordCount = query.Count();
                this.rptList.DataSource = query.OrderBy(item => item.ChatTextTypeID).ThenBy(item => item.SortID)
                                          .Skip((this.pager1.CurrentPageIndex - 1) * this.pager1.PageSize).Take(this.pager1.PageSize).ToList();
                this.rptList.DataBind();
            }
        }
示例#28
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            Guid id = Guid.Empty;

            Guid.TryParse((string)e.CommandArgument, out id);
            if (e.CommandName == "Status")
            {
                using (var db = DCHelper.SPhoneContext())
                {
                    SPhone_Role dn = db.SPhone_Role.Where(item => item.RoleID == id).FirstOrDefault();
                    if (dn != null)
                    {
                        List <SPhone_RoleModule> rms = dn.SPhone_RoleModule.Where(item => item.RoleID == id).ToList();
                        rms.ForEach(rm => dn.SPhone_RoleModule.Remove(rm));

                        db.SPhone_Role.Remove(dn);
                        db.SaveChanges();

                        BindRepeater();
                    }
                }
            }
        }
示例#29
0
        public string PostAddProc([FromBody] InfoBaseModel <List <GAppvalProcModel> > infoBase)
        {
            if (infoBase == null || infoBase.infoData == null || infoBase.infoData.Count == 0)
            {
                return(DCHelper.ErrorMessage("审批流程对象为空!"));
            }

            try
            {
                SavedResult <Int64> savedResult = GAppvalProcService.PostAddProcs(infoBase.infoData);
                if (savedResult != null && savedResult.SaveRows > 0)
                {
                    return(DCHelper.SuccessMessage("新增审批流程成功!"));
                }
                else
                {
                    return(DCHelper.ErrorMessage("新增审批流程失败!"));
                }
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
示例#30
0
        public string PostApprovalRecord([FromBody] GAppvalRecordModel recordModel)
        {
            if (recordModel == null)
            {
                return(DCHelper.ErrorMessage("审批数据为空!"));
            }
            if (recordModel.ProcPhid == 0)
            {
                return(DCHelper.ErrorMessage("审批流程id为空!"));
            }
            if (recordModel.PostPhid == 0)
            {
                return(DCHelper.ErrorMessage("审批岗位id为空!"));
            }
            if (string.IsNullOrEmpty(recordModel.FBilltype))
            {
                return(DCHelper.ErrorMessage("单据类型为空!"));
            }
            if (recordModel.RefbillPhid == 0)
            {
                return(DCHelper.ErrorMessage("关联单据为空!"));
            }
            if (recordModel.PhId == 0)
            {
                return(DCHelper.ErrorMessage("审批记录的id为空!"));
            }

            try
            {
                GAppvalRecordService.PostApprovalRecord(recordModel);

                return(DCHelper.SuccessMessage("审批成功!"));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }