Ejemplo n.º 1
0
        public string AddUserMenuPower()
        {
            try
            {
                int UserID = 0;
                int.TryParse(Request.Form["UserID"], out UserID);
                string sysModelIDs = Request.Form["checkedModelList"] ?? "";
                int[]  idList      = WebComm.GetIntArrayByString(sysModelIDs);

                List <UserModelPower> removeList = db.UserModelPowers.Where(m => m.userID == UserID).ToList();
                foreach (var item in removeList)
                {
                    db.UserModelPowers.Remove(item);
                }
                foreach (int id in idList)
                {
                    UserModelPower mpAdd = new UserModelPower()
                    {
                        userID = UserID, modelID = id, modelButtonID = 0
                    };
                    db.UserModelPowers.Add(mpAdd);
                }


                db.SaveChanges();
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "配置成功", "", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "配置失败!" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 2
0
        public string DoTKAction(decimal tkmoney, int id)
        {
            string lycResult = "";

            try
            {
                using (FamilyCaiWuDBEntities db2 = new FamilyCaiWuDBEntities())
                {
                    Apply_Sub s = db2.Apply_Sub.Where(c => c.ID == id).SingleOrDefault();
                    if (s == null)
                    {
                        throw new Exception("此记账信息已不存在,无法执行退款操作!");
                    }
                    if (s.InOutType != "out" || s.CashOrBank != 1)
                    {
                        throw new Exception("此记账信息不是【银行支出记账】,无法执行退款操作!");
                    }
                    if (s.UserBankID == null || s.UserBankID.Value == 0)
                    {
                        throw new Exception("此记账信息不是【银行记账】,无法执行退款操作!");
                    }
                    if (tkmoney == s.iMoney)
                    {
                        throw new Exception("退款金额与原记账金额相同,请直接执行删除操作!");
                    }
                    if (tkmoney > s.iMoney)
                    {
                        throw new Exception("退款金额大于原记账金额,无法执行退款操作!");
                    }

                    //1. 修改原记账信息的 备注、记账金额字段
                    decimal newMoney = s.iMoney - tkmoney;
                    s.CAdd   = s.CAdd + ";原记账金额:" + s.iMoney + " 元,现在退款:" + tkmoney + " 元,最终记账金额是:" + newMoney + " 元;";
                    s.iMoney = newMoney;

                    //2. 修改对应的银行余额信息
                    UserBank ub = db2.UserBanks.Where(c => c.ID == s.UserBankID.Value).SingleOrDefault();
                    if (ub == null)
                    {
                        throw new Exception("此记账信息中的银行信息已不存在,无法执行退款操作!");
                    }
                    ub.NowMoney = ub.NowMoney + tkmoney;

                    //3. 修改记账主信息的支出合计
                    Apply_Main m = db2.Apply_Main.Where(c => c.ID == s.ApplyMain_BillCode).SingleOrDefault();
                    if (m != null)
                    {
                        m.ApplyOutMoney = m.ApplyOutMoney - tkmoney;
                    }

                    db2.SaveChanges();
                }
                lycResult = WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "退款成功!", "ApplyInfoListNav", "", CallBackType.none, "");
            }
            catch (Exception ex)
            {
                lycResult = WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "退款失败!" + ex.Message, "", "", CallBackType.none, "");
            }
            return(lycResult);
        }
Ejemplo n.º 3
0
        public string GetFlowTypeInOut()
        {
            int    flowID = Convert.ToInt32(Request.Form["FlowID"] ?? "0");
            string result = "";

            result = WebComm.GetFundFlowTypeList().Where(f => f.ID == flowID).Select(f => f.InOutType).SingleOrDefault();
            return(result);
        }
Ejemplo n.º 4
0
        public string DoBankAccounting()
        {
            try
            {
                /***校验数据完整性***/
                if (Session[SessionList.FamilyManageUser.ToString()] == null)
                {
                    return(WebComm.ReturnLogOutPage());
                }
                if (Request.Form["FlowTypeID"] == "" || Request.Form["FlowTypeID"] == "-1")
                {
                    throw new Exception("请选择资金流动类型!");
                }

                User loginUser = Session[SessionList.FamilyManageUser.ToString()] as User;

                //获取记账日期
                string applyDate = Request.Form["ApplyDate"];
                //获取流动资金类型
                FundFlowType ffType = WebComm.GetFundFlowTypeList().Where(f => f.ID == Convert.ToInt32(Request.Form["FlowTypeID"])).Single();

                string flowTypeID = ffType.ID.ToString();

                //获取流动资金类型名称
                string flowTypeName = ffType.Name;

                //获取类型
                string InOutType = ffType.InOutType;

                //获取费用项目
                string feeItemID = Request.Form["search_Fee.FeeItemID"] == "" ? "0" : Request.Form["search_Fee.FeeItemID"];

                string feeItemName = Request.Form["search_Fee.FeeItemName"] == "" ? "" : Request.Form["search_Fee.FeeItemName"];

                //获取资金
                string iMoney = Request.Form["NowMoney"];

                string isJieKuan = flowTypeName.Contains("借") == true ? "Y" : "N";

                //获取入账银行信息
                string inUserBankID = Request.Form["In_bank.UserBankID"] == "" ? "0" : Request.Form["In_bank.UserBankID"];
                //获取出账银行信息
                string outUserBankID = Request.Form["Out_bank.UserBankID"] == "" ? "0" : Request.Form["Out_bank.UserBankID"];

                //获取备注信息
                string cAdd = Request.Form["cAdd"];

                string sql = "exec proc_AddBankAccouting '" + applyDate + "'," + flowTypeID + ",'" + flowTypeName + "','" + InOutType + "'," + feeItemID + ",'" + feeItemName + "'," + iMoney + "," + loginUser.ID.ToString() + "," + inUserBankID + "," + outUserBankID + ",'" + isJieKuan + "','N','" + cAdd + "','PCWeb',''";
                LycSQLHelper.ExecuteCommand(CommandType.Text, sql);
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "记账成功!", "", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "记账失败!" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 5
0
        public ActionResult Edit(int id = 0)
        {
            //绑定银行卡类型
            ViewBag.CardTypeList = WebComm.GetBankCardType();
            UserBank userbank = db.UserBanks.Find(id);

            if (userbank == null)
            {
                return(RedirectToAction("GoTo404Page", "CommView"));
            }
            return(View(viewFolder + "Edit.cshtml", userbank));
        }
Ejemplo n.º 6
0
 public string DeleteConfirmed(int id)
 {
     try
     {
         string sql = "exec proc_DeleteAccouting " + id.ToString() + " ";
         LycSQLHelper.ExecuteCommand(CommandType.Text, sql);
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "删除成功!", "ApplySubListNav", "", CallBackType.none, ""));
     }
     catch (Exception ex)
     {
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "删除失败!" + ex.Message, "", "", CallBackType.none, ""));
     }
 }
Ejemplo n.º 7
0
 public string Create(SysModel sysmodel)
 {
     try
     {
         sysmodel.IsFlag = true;
         db.SysModels.Add(sysmodel);
         db.SaveChanges();
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "添加成功", "", "", CallBackType.none, ""));
     }
     catch (Exception ex)
     {
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "添加失败!" + ex.Message, "", "", CallBackType.none, ""));
     }
 }
Ejemplo n.º 8
0
        //[HttpPost]
        /// <summary>
        /// 获取所有费用科目
        /// </summary>
        /// <returns></returns>
        public JsonResult GetFeeItemList()
        {
            LycJsonResult lycResult = new LycJsonResult();

            try
            {
                lycResult.Data = new JsonResultModel(true, "获取费用科目成功", WebComm.GetFeeItemListByXml());
            }
            catch
            {
                lycResult.Data = new JsonResultModel(false, "获取费用科目失败", null);
            }
            return(lycResult);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取所有资金流动类型
        /// </summary>
        /// <returns></returns>
        public JsonResult GetFlowTypeList()
        {
            LycJsonResult lycResult = new LycJsonResult();

            try
            {
                lycResult.Data = new JsonResultModel(true, "获取资金类型成功", WebComm.GetFundFlowTypeList());
            }
            catch
            {
                lycResult.Data = new JsonResultModel(false, "获取资金类型失败", null);
            }
            return(lycResult);
        }
Ejemplo n.º 10
0
        public string EditUser(User user)
        {
            try
            {
                db.Entry(user).State = EntityState.Modified;
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "用户更新失败!" + ex.Message, "", "", CallBackType.none, ""));
            }

            return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "用户信息已更新!", "userList", "", CallBackType.closeCurrent, ""));
        }
Ejemplo n.º 11
0
        public string Edit(SysModel sysmodel)
        {
            try
            {
                db.Entry(sysmodel).State = EntityState.Modified;
                db.SaveChanges();

                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "修改成功", "", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "修改失败!" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 绑定银行卡类型
        /// </summary>
        private void BindBankCardType()
        {
            Dictionary <string, string> dataSource = new Dictionary <string, string>();

            foreach (var item in WebComm.GetBankCardType())
            {
                dataSource.Add(item, item);
            }
            Dictionary <string, object> attrCardType = null;
            List <SelectListItem>       itemList     = null;

            WebComm.BindComBox(dataSource, out attrCardType, out itemList);
            ViewBag.attrCardType = attrCardType;
            ViewBag.itemList     = itemList;
        }
Ejemplo n.º 13
0
        public string UpdateAdd(Apply_Sub sub)
        {
            try
            {
                Apply_Sub updateSub = db.Apply_Sub.Find(sub.ID);
                updateSub.CAdd = sub.CAdd;

                db.SaveChanges();
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "修改成功!", "ApplyInfoListNav", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "修改失败!" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 14
0
        public string GetFlowTypeList()
        {
            int    BusinessType      = Convert.ToInt32(Request.Form["flowType"]);
            string result            = "";
            List <FundFlowType> list = new List <FundFlowType>();

            if (BusinessType == 0)
            {
                list = WebComm.GetFundFlowTypeList_Cash();
            }
            else if (BusinessType == 1)
            {
                list = WebComm.GetFundFlowTypeList_Bank();
            }
            result = JsonConvert.SerializeObject(list);
            return(result);
        }
Ejemplo n.º 15
0
 public string DeleteConfirmed()
 {
     try
     {
         string ids    = Request["ids"] ?? "";
         int[]  idList = WebComm.GetIntArrayByString(ids);
         foreach (int item in idList)
         {
             Bank bank = db.Banks.Find(item);
             db.Banks.Remove(bank);
         }
         db.SaveChanges();
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "删除成功", "bankMainList", "", CallBackType.none, ""));
     }
     catch (Exception ex)
     {
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "删除失败!" + ex.Message, "", "", CallBackType.none, ""));
     }
 }
Ejemplo n.º 16
0
        public string Edit(UserBank userbank)
        {
            try
            {
                User loginUser = Session[SessionList.FamilyManageUser.ToString()] as User;
                userbank.BankID   = Convert.ToInt32(Request.Form["search_bank.BankID"]);
                userbank.BankName = Request.Form["search_bank.BankName"];
                userbank.UserID   = loginUser.ID;
                userbank.UserName = loginUser.cUserName;

                db.Entry(userbank).State = EntityState.Modified;
                db.SaveChanges();
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "修改成功", "userBankList", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "修改失败" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 17
0
        public string Create(Bank bank)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Banks.Add(bank);
                    db.SaveChanges();

                    return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "添加银行成功!", "bankMainList", "", CallBackType.none, ""));
                }
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "验证失败!" + ex.Message, "", "", CallBackType.none, ""));
            }

            return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "验证失败!", "", "", CallBackType.none, ""));
        }
Ejemplo n.º 18
0
        public string DeleteConfirmed()
        {
            try
            {
                string ids    = Request["ids"] ?? "";
                int[]  idList = WebComm.GetIntArrayByString(ids);
                foreach (var item in idList)
                {
                    User user = db.Users.Find(item);
                    db.Users.Remove(user);
                }
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "用户删除失败," + ex.Message, "", "", CallBackType.none, ""));
            }

            return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "用户信息已删除", "", "", CallBackType.none, ""));
        }
Ejemplo n.º 19
0
        public string Create(UserBank userbank)
        {
            try
            {
                User loginUser = Session[SessionList.FamilyManageUser.ToString()] as User;
                userbank.BankID     = Convert.ToInt32(Request.Form["search_bank.BankID"]);
                userbank.BankName   = Request.Form["search_bank.BankName"];
                userbank.UserID     = loginUser.ID;
                userbank.UserName   = loginUser.cUserName;
                userbank.CreateDate = DateTime.Now;

                db.UserBanks.Add(userbank);
                db.SaveChanges();
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "添加成功", "userBankList", "", CallBackType.none, ""));
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "添加失败!" + ex.Message, "", "", CallBackType.none, ""));
            }
        }
Ejemplo n.º 20
0
 public string DeleteConfirmed()
 {
     try
     {
         string ids    = Request["ids"] ?? "";
         int[]  idList = WebComm.GetIntArrayByString(ids);
         foreach (int id in idList)
         {
             SysModel bank = db.SysModels.Find(id);
             bank.IsFlag          = false;
             db.Entry(bank).State = EntityState.Modified;
         }
         db.SaveChanges();
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "删除成功", "", "", CallBackType.none, ""));
     }
     catch (Exception ex)
     {
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "删除失败!" + ex.Message, "", "", CallBackType.none, ""));
     }
 }
Ejemplo n.º 21
0
 public Object Create(int businessTypeID, string inOutType)
 {
     if (businessTypeID == 0)
     {
         //跳转到现金记账页面
         ViewBag.FlowType = WebComm.GetFundFlowTypeList_Cash().Where(c => c.InOutType == "in" || c.InOutType == "out").ToList();
         return(PartialView(viewFolder + "CashAccounting.cshtml"));
     }
     else if (businessTypeID == 1)
     {
         //银行记账
         ViewBag.FlowType = WebComm.GetFundFlowTypeList_Bank().Where(c => c.InOutType == "in" || c.InOutType == "out").ToList();
         return(PartialView(viewFolder + "BankAccounting.cshtml"));
     }
     else
     {
         //跳转到转账页面
         ViewBag.FlowType = WebComm.GetFundFlowTypeList().Where(c => c.InOutType != "in" && c.InOutType != "out").ToList();
         return(PartialView(viewFolder + "ZhuanZhang.cshtml"));
     }
 }
Ejemplo n.º 22
0
        public string CreateUser(User user)
        {
            int newUserCode = db.Users.Max(u => u.cUserCode);

            newUserCode++;
            user.cUserCode = newUserCode;
            try
            {
                if (ModelState.IsValid)
                {
                    user.cUserFlag   = true;
                    user.dCreateDate = DateTime.Now;
                    db.Users.Add(user);
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, ex.Message + ex.InnerException, "", "", CallBackType.none, ""));
            }
            return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "保存成功", "userList", "", CallBackType.none, ""));
        }
Ejemplo n.º 23
0
        //创建费用项目xml
        public string CreateFeeXml()
        {
            string path = WebComm.FeeItemXmlPath;

            /* 创建xml文件
             * XDocument xdoc = new XDocument(
             *                              new XDeclaration("1.0", "utf-8", "yes"),
             *                              new XElement("FeeItemList")
             *                            );
             * xdoc.Save(path);
             * return "成功";
             */

            /* 通过List集合遍历添加xml文件*/
            XDocument xdoc = XDocument.Load(path);
            //XElement root = xdoc.Element("FeeItemList");
            //root.Add(
            //            WebComm.GetFeeItemList().Select(c =>
            //            new XElement("FeeItem",
            //                            new XAttribute("FeeItemID", c.FeeItemID),
            //                            new XAttribute("FeeItemName", c.FeeItemName),
            //                            new XAttribute("FeeItemClassID", c.FeeItemClassID),
            //                            new XAttribute("IsLast", c.IsLast)
            //                        ))
            //        );
            XElement root = xdoc.Element("FeeItems");

            root.Add(
                WebComm.GetFeeItemList().Select(c =>
                                                new XElement("FeeItem",
                                                             new XElement("FeeItemID", c.FeeItemID),
                                                             new XElement("FeeItemName", c.FeeItemName),
                                                             new XElement("FeeItemClassID", c.FeeItemClassID),
                                                             new XElement("IsLast", c.IsLast)
                                                             ))
                );
            xdoc.Save(path);
            return("成功");
        }
Ejemplo n.º 24
0
 public string DeleteConfirmed()
 {
     try
     {
         string ids    = Request["ids"] ?? "";
         int[]  idList = WebComm.GetIntArrayByString(ids);
         foreach (int item in idList)
         {
             UserBank bank = db.UserBanks.Find(item);
             if (db.Apply_Sub.Where(u => u.UserBankID == bank.ID).Count() > 0 || db.Apply_Sub_CashChange.Where(u => u.InUserBankID == bank.ID || u.OutUserBankID == bank.ID).Count() > 0)
             {
                 continue;
             }
             db.UserBanks.Remove(bank);
         }
         db.SaveChanges();
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.成功, "删除成功", "userBankList", "", CallBackType.none, ""));
     }
     catch (Exception ex)
     {
         return(WebComm.ReturnAlertMessage(ActionReturnStatus.失败, "删除失败!" + ex.Message, "", "", CallBackType.none, ""));
     }
 }
Ejemplo n.º 25
0
        /// <summary>
        /// 获取用户开户行列表
        /// </summary>
        /// <param name="currentPage">当前页码</param>
        /// <param name="uBank">查询实体</param>
        /// <returns></returns>
        private List <Apply_Main> GetApply_MainList(int currentPage, Apply_Main AM, string beginDate, string endDate)
        {
            var  amList    = db.Apply_Main.AsQueryable();
            User loginUser = Session[SessionList.FamilyManageUser.ToString()] as User;

            //区分用户加载数据,如果不是超级管理员,只能查看自己的数据
            if (!UserPower.adminUserCode.Contains(loginUser.cUserCode))
            {
                amList = amList.Where(ub => ub.ApplyUserID == loginUser.ID);
            }
            #region 条件筛选
            if (AM != null && !string.IsNullOrEmpty(AM.ApplyUserID.ToString()) && AM.ApplyUserID > 0)
            {
                amList = amList.Where(ub => ub.ApplyUserID == AM.ApplyUserID);
            }

            //如果用户选择了开始时间和结束时间
            if (!string.IsNullOrEmpty(beginDate) && !string.IsNullOrEmpty(endDate))
            {
                int[]    beginArr = WebComm.GetIntArrayByStringArray(beginDate.Split('-'));
                int[]    endArr = WebComm.GetIntArrayByStringArray(endDate.Split('-'));
                DateTime bDate, dDate;
                bDate = Convert.ToDateTime(beginDate);
                dDate = Convert.ToDateTime(endDate);
                int beginYear  = beginArr[0];
                int beginMonth = beginArr[1];
                int beginDay   = beginArr[2];
                int endYear    = endArr[0];
                int endMonth   = endArr[1];
                int endDay     = endArr[2];
                //amList = amList.Where(a => a.iyear >= beginYear && a.imonth >= beginMonth && a.iday >= beginDay)
                //    .Where(a => a.iyear <= endYear && a.imonth <= endMonth && a.iday <= endDay);
                amList = amList.Where(a => a.ApplyDate >= bDate && a.ApplyDate <= dDate);
            }
            //如果只选择了开始时间
            else if (!string.IsNullOrEmpty(beginDate) && string.IsNullOrEmpty(endDate))
            {
                DateTime bDate;
                bDate = Convert.ToDateTime(beginDate);
                //int[] beginArr = WebComm.GetIntArrayByStringArray(beginDate.Split('-'));
                //int beginYear = beginArr[0];
                //int beginMonth = beginArr[1];
                //int beginDay = beginArr[2];
                //amList = amList.Where(a => a.iyear >= beginYear && a.imonth >= beginMonth && a.iday >= beginDay);
                amList = amList.Where(a => a.ApplyDate >= bDate);
            }
            #endregion

            SetPagerOptions(amList.Count(), currentPage);
            List <Apply_Main> list = amList.OrderBy(b => b.ID).Skip((currentPage - 1) * pageSize).Take(pageSize).ToList();
            //添加合计行
            Apply_Main applySum = new Apply_Main();
            applySum.Apply_Sub     = null;
            applySum.ApplyDate     = new DateTime();
            applySum.ApplyInMoney  = list.Sum(l => l.ApplyInMoney);
            applySum.ApplyOutMoney = list.Sum(l => l.ApplyOutMoney);
            applySum.ApplyUserID   = loginUser.ID;
            applySum.CreateDate    = null;
            applySum.ID            = 0;
            applySum.iday          = 0;
            applySum.imonth        = 0;
            applySum.iNowCashMoney = 0;
            applySum.iyear         = 0;
            applySum.User          = null;
            list.Insert(0, applySum);

            return(list);
        }
Ejemplo n.º 26
0
 public ActionResult Create()
 {
     //绑定银行卡类型
     ViewBag.CardTypeList = WebComm.GetBankCardType();
     return(View(viewFolder + "Create.cshtml"));
 }
Ejemplo n.º 27
0
 //显示费用项目列表
 public ActionResult ShowAccountTypeList()
 {
     return(View(viewFolder + "ShowAccountTypeList.cshtml", WebComm.GetAccountListByXml()));
 }
Ejemplo n.º 28
0
        //内部转账API
        public string DoZhuanZhang(int userID, string ApplyDate, int FlowTypeID,
                                   string feeItemID, string feeItemName, string money,
                                   string inUBID, string outUBID, string cAdd, string location)
        {
            string result = "{}";

            try
            {
                //获取记账日期
                string applyDate = ApplyDate;
                //获取流动资金类型
                FundFlowType ffType = WebComm.GetFundFlowTypeList().Where(f => f.ID == FlowTypeID).Single();

                string flowTypeID = ffType.ID.ToString();

                //获取流动资金类型名称
                string flowTypeName = ffType.Name;

                //获取类型
                string InOutType = ffType.InOutType;
                //获取资金
                string iMoney = money;

                //获取入账银行信息
                string inUserBankID = inUBID;
                //获取出账银行信息
                string outUserBankID = outUBID;

                //参数设置
                SqlParameter[] sp3 = new SqlParameter[]
                {
                    new SqlParameter {
                        ParameterName = "@applyDate", Value = applyDate
                    },
                    new SqlParameter {
                        ParameterName = "@flowTypeID", Value = flowTypeID
                    },
                    new SqlParameter {
                        ParameterName = "@flowTypeName", Value = flowTypeName
                    },
                    new SqlParameter {
                        ParameterName = "@InOutType", Value = InOutType
                    },
                    new SqlParameter {
                        ParameterName = "@iMoney", Value = iMoney
                    },
                    new SqlParameter {
                        ParameterName = "@UserID", Value = userID
                    },
                    new SqlParameter {
                        ParameterName = "@InUserBankID", Value = inUserBankID
                    },
                    new SqlParameter {
                        ParameterName = "@OutUserBankID", Value = outUserBankID
                    },
                    new SqlParameter {
                        ParameterName = "@CAdd", Value = cAdd
                    },
                    new SqlParameter {
                        ParameterName = "@CSouce", Value = APPLY_DATASOURCE_IOSAPP
                    },
                    new SqlParameter {
                        ParameterName = "@CLocation", Value = location ?? ""
                    }
                };
                //执行存储过程
                bool success = this.ExecStoredProcedure("proc_CashChange", sp3);
                if (success)
                {
                    result = WebComm.ReturnJsonForExterior(true, "转账记账成功!", "{}");
                }
                else
                {
                    result = WebComm.ReturnJsonForExterior(true, "转账记账失败!", "{}");
                }
            }
            catch (Exception ex)
            {
                result = WebComm.ReturnJsonForExterior(false, "转账记账失败!" + ex.Message, "{}");
            }
            return(result);
        }
Ejemplo n.º 29
0
        //现金记账API
        public string DoCashAccounting(int userID, string ApplyDate, int FlowTypeID, string feeItemID, string feeItemName, string money, string cAdd, string location)
        {
            string result = "{}";

            try
            {
                //获取记账日期
                string applyDate = ApplyDate;
                //获取流动资金类型
                FundFlowType ffType = WebComm.GetFundFlowTypeList().Where(f => f.ID == FlowTypeID).Single();

                string flowTypeID = ffType.ID.ToString();

                //获取流动资金类型名称
                string flowTypeName = ffType.Name;

                //获取类型
                string InOutType = ffType.InOutType;
                //获取资金
                string iMoney = money;

                string isJieKuan = flowTypeName.Contains("借") == true ? "Y" : "N";

                //参数设置
                SqlParameter[] sp1 = new SqlParameter[]
                {
                    new SqlParameter {
                        ParameterName = "@applyDate", Value = applyDate
                    },
                    new SqlParameter {
                        ParameterName = "@flowTypeID", Value = flowTypeID
                    },
                    new SqlParameter {
                        ParameterName = "@flowTypeName", Value = flowTypeName
                    },
                    new SqlParameter {
                        ParameterName = "@InOutType", Value = InOutType
                    },
                    new SqlParameter {
                        ParameterName = "@FeeItemID", Value = feeItemID
                    },
                    new SqlParameter {
                        ParameterName = "@FeeItemName", Value = feeItemName
                    },
                    new SqlParameter {
                        ParameterName = "@iMoney", Value = iMoney
                    },
                    new SqlParameter {
                        ParameterName = "@UserID", Value = userID
                    },
                    new SqlParameter {
                        ParameterName = "@BJieKuan", Value = isJieKuan
                    },
                    new SqlParameter {
                        ParameterName = "@BHuanKuan", Value = "N"
                    },
                    new SqlParameter {
                        ParameterName = "@CAdd", Value = cAdd
                    },
                    new SqlParameter {
                        ParameterName = "@CSouce", Value = APPLY_DATASOURCE_IOSAPP
                    },
                    new SqlParameter {
                        ParameterName = "@CLocation", Value = location ?? ""
                    }
                };
                //执行存储过程
                bool success = this.ExecStoredProcedure("proc_AddCashAccouting", sp1);
                if (success == true)
                {
                    result = WebComm.ReturnJsonForExterior(true, "现金记账成功!", "{}");
                }
                else
                {
                    result = WebComm.ReturnJsonForExterior(false, "现金记账失败!", "{}");
                }
            }
            catch (Exception ex)
            {
                result = WebComm.ReturnJsonForExterior(false, "现金记账失败!" + ex.Message, "{}");
            }
            return(result);
        }
Ejemplo n.º 30
0
 //显示费用项目列表
 public ActionResult ShowFeeItemList()
 {
     return(View(viewFolder + "ShowFeeItemList.cshtml", WebComm.GetFeeItemListByXml()));
 }