Пример #1
0
        public ActionResult GetChargeItem(string customerID, string customerTypeID)
        {
            List <dynamic> chargeItems = new CustomerRule().GetChargeItemByCustomerID(customerID);

            if (chargeItems.Count == 0)
            {
                chargeItems = new CustomerRule().GetChargeItemByCustomerTypeID(customerTypeID);
            }
            var showList = from cItems in chargeItems
                           select new
            {
                ID             = cItems.ID,
                Code           = cItems.CODE,
                Name           = cItems.NAME,
                UnitID1        = cItems.UNIT,
                CategoryID     = cItems.CATEGORYID,
                IsRegular      = cItems.ISREGULAR,
                IsAgreeMent    = cItems.ISAGREEMENT,
                IsPloy         = cItems.ISPLOY,
                UnitPrice      = cItems.UNITPRICE,
                Count          = cItems.COUNT,
                AgreementMoney = cItems.AGREEMENTMONEY
            };

            return(Json(showList, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult AddMessageNew(string AcceptIDS, string Title, string Content)
        {
            AjaxResult result = new AjaxResult();
            Message    msg    = new Message();

            msg.Content = Content;
            msg.Title   = Title;
            try
            {
                MessageRule msgR = new MessageRule();
                if (string.IsNullOrEmpty(msg.ID))                //新增
                {
                    msg.ID         = Guid.NewGuid().ToString("N");
                    msg.OperatorID = MyTicket.CurrentTicket.UserID;
                    msg.CreateDate = DateTime.Now;
                    msgR.Add(msg);
                    //不选接收人,默认发送给所有人
                    if (string.IsNullOrEmpty(AcceptIDS))
                    {
                        List <Ajax.Model.Customer> acceptList = new CustomerRule().GetList("");
                        foreach (Ajax.Model.Customer c in acceptList)
                        {
                            AcceptIDS += c.OperatorID + ",";
                        }
                    }
                    string[] strAcceptIDs = AcceptIDS.Remove(AcceptIDS.Length - 1, 1).Split(',');                    //Request.Form["txtAcceptIDs"].Split(',');
                    //接收人
                    OperatorMsgRule    omsgR    = new OperatorMsgRule();
                    List <OperatorMsg> oMsgList = new List <OperatorMsg>();
                    foreach (string acceptID in strAcceptIDs)
                    {
                        if (string.IsNullOrEmpty(acceptID))
                        {
                            continue;
                        }
                        OperatorMsg omsg = new OperatorMsg();
                        omsg.ID         = Guid.NewGuid().ToString("N");
                        omsg.Status     = 0;                    //默认为未读
                        omsg.MsgID      = msg.ID;
                        omsg.OperatorID = acceptID;
                        oMsgList.Add(omsg);
                    }
                    omsgR.AddMul(oMsgList);
                    result.Success = true;
                    result.Message = "公告已经成功发出。";
                }
                else                //编辑
                {
                    result.Success = msgR.Update(msg);
                    result.Message = result.Success ? "公告已经成功修改。" : "公告修改失败!";
                }
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = "操作失败:" + ex.Message;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
 public JsonResult CustomerDetailOnly(string customerID)
 {
     if (!string.IsNullOrEmpty(customerID))
     {
         // 客户信息
         var customer = new CustomerRule().CustomerDetail(customerID);
         return(Json(customer, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(new Ajax.Model.Customer()));
     }
 }
Пример #4
0
        public ActionResult SelectCustomer(string customerParentID)
        {
            List <Ajax.Model.Customer> customerList;

            if (string.IsNullOrEmpty(customerParentID))
            {
                customerList = new CustomerRule().GetList("and PID IS NULL ");
            }
            else
            {
                customerList = new CustomerRule().GetList(string.Format("and PID='{0}' ", customerParentID));
            }
            return(PartialView(customerList));
        }
Пример #5
0
        public ActionResult GetCustomerListByID(string q, string IsParent)
        {
            List <Ajax.Model.Customer> customerList = new List <Ajax.Model.Customer>();

            customerList = new CustomerRule().GetCustomerListByID(q, IsParent);
            var showList = from customers in customerList
                           select new
            {
                id   = customers.ID,
                text = customers.Name
            };

            return(Json(showList, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        /// <summary>
        /// 获取欠费详细信息
        /// </summary>
        /// <param name="customerIDList"></param>
        /// <returns></returns>
        public JsonResult GetArrearInfo(string customerIDs)
        {
            CustomerRule   cusRule        = new CustomerRule();
            AgreementsRule agreeRule      = new AgreementsRule();
            ChargeRule     chRule         = new ChargeRule();
            ChargeItemRule chargeItemRule = new ChargeItemRule();

            List <object> arrearList = new List <object>();

            string[] customerIDArray = customerIDs.Split(',');
            foreach (string customerID in customerIDArray)
            {
                // 客户信息
                var customer = cusRule.CustomerDetail(customerID);
                // 协议信息
                var     agreements = agreeRule.GetAgreementObjectByCustomerID(customerID);
                decimal totalFee   = chRule.CaculateCustomerFee(customerID);
                //缴费总月份
                Ajax.Model.Customer c = new CustomerRule().GetModel(customerID);
                int monthCount        = chRule.GetMonthCount(Convert.ToDateTime(c.BeginChargeDate));
                // 缴费项目信息
                List <dynamic> chargeItemList = new ChargeItemRule().SearchChargeItem(customerID);
                var            chargeItem     = from chargeItems in chargeItemList
                                                select new
                {
                    Name           = chargeItems.NAME,
                    Price          = chargeItemRule.GetPriceByItemID(chargeItems.ID, Convert.ToDecimal(chargeItems.COUNT), customerID),
                    Count          = chargeItems.COUNT,
                    AgreeMentMoney = chargeItems.AGREEMENTMONEY,
                    ItemCount      = monthCount * CaculateItemCount(chargeItems.AGREEMENTMONEY, Convert.ToString(chargeItemRule.GetPriceByItemID(chargeItems.ID, Convert.ToDecimal(chargeItems.COUNT), customerID)), chargeItems.COUNT)
                };
                //子客户费用信息
                List <Ajax.Model.Customer> customerChildrenList = new CustomerRule().GetChildrenCustomer(customerID);
                var childrenCustomer = from childC in customerChildrenList
                                       select new
                {
                    Name = childC.Name,
                    Fee  = chRule.CaculateCustomerFee(childC.ID, false)
                };

                arrearList.Add(new { customer, agreements, monthCount, totalFee, chargeItem, childrenCustomer });
            }
            return(Json(arrearList, JsonRequestBehavior.AllowGet));
        }
Пример #7
0
        public ActionResult Search(EasyUIGridParamModel param, Ajax.Model.Customer customer)
        {
            int            itemCount = 0;
            CustomerRule   cr        = new CustomerRule();
            List <dynamic> list      = cr.Search(param, customer, out itemCount);
            var            showList  = from customers in list
                                       select new
            {
                ID         = customers.ID,
                Name       = customers.NAME,
                TypeName   = customers.CUSTOMERTYPE,
                Status     = customers.STATUS.Replace("1", "正常").Replace("0", "未审核").Replace("2", "禁用").Replace("3", "已删除"),
                CreateTime = Ajax.Common.TimeParser.FormatDateTime(customers.CREATETIME),
                Contactor  = customers.CONTACTOR,
                FeeType    = string.IsNullOrEmpty(customers.AGREEID) ? "非协议缴费" : "协议缴费",
                Address    = customers.ADDRESS
            };

            return(Json(new { total = itemCount, rows = showList }, JsonRequestBehavior.AllowGet));
        }
Пример #8
0
        public ActionResult Audit(string customerID, int status)
        {
            AjaxResult result = new AjaxResult();

            if (!string.IsNullOrEmpty(customerID))
            {
                CustomerRule cr = new CustomerRule();
                try
                {
                    cr.Audit(new List <string>(customerID.TrimEnd(',').Split(',')), status);
                    result.Success = false;
                    result.Message = "审批成功.";
                }
                catch (Exception ex)
                {
                    result.Success = false;
                    result.Message = "操作失败:" + ex.Message;
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #9
0
        public JsonResult CustomerDetail(string customerID)
        {
            if (!string.IsNullOrEmpty(customerID))
            {
                // 客户信息
                var customer = new CustomerRule().CustomerDetail(customerID);

                // 缴费项目信息
                List <dynamic> chargeItemList = new ChargeItemRule().SearchChargeItem(customerID);

                var chargeItem = from chargeItems in chargeItemList
                                 select new
                {
                    Name           = chargeItems.NAME,
                    Price          = chargeItems.UNITPRICE,
                    Count          = chargeItems.COUNT,
                    AgreeMentMoney = chargeItems.AGREEMENTMONEY,
                    ItemCount      = 0
                };
                // 协议信息
                var agreements = new AgreementsRule().GetAgreementObjectByCustomerID(customerID);
                // 子客户信息
                var childCustomer = new CustomerRule().GetChildrenCustomer(customerID);
                // 缴费历史
                //int itemCount = 0;
                var chargeHistory = new ChargeRule().ChargeSearch(customerID);
                // 欠费记录
                var arrearRecord = new YearEndArrearRule().GetArrearRecordByCustomerID(customerID);
                //chargeHistory,
                return(Json(new { customer, chargeItem, agreements, childCustomer, arrearRecord, chargeHistory }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new Ajax.Model.Customer()));
            }
        }
Пример #10
0
        public JsonResult GetCustomerChildren(string customerID)
        {
            var childCustomer = new CustomerRule().GetChildrenCustomer(customerID);

            return(Json(childCustomer, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
        public JsonResult CustomerDelete(string customerID)
        {
            CustomerRule rule = new CustomerRule();

            return(Json(rule.Delete(customerID), JsonRequestBehavior.AllowGet));
        }
Пример #12
0
        /// <summary>
        /// 删除客户
        /// </summary>
        /// <param name="nCustomerId"></param>
        /// <param name="nOpStaffId">操作员工编码</param>
        /// <param name="strOpStaffName">操作员工姓名</param>
        /// <param name="strErrText">出错信息</param>
        /// <returns>成功返回True,否则返回False</returns>
        public bool DeleteCustomer(long nCustomerId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            CustomerRule rule = new CustomerRule();

            return(rule.DeleteCustomer(nCustomerId, nOpStaffId, strOpStaffName, out strErrText));
        }
Пример #13
0
        /// <summary>
        /// 修改客户
        /// </summary>
        /// <param name="data"></param>
        /// <param name="listTransportPrice"></param>
        /// <param name="listForceFeePrice"></param>
        /// <param name="listStorageFeePrice"></param>
        /// <param name="nOpStaffId">操作员工编码</param>
        /// <param name="strOpStaffName">操作员工姓名</param>
        /// <param name="strErrText">出错信息</param>
        /// <returns>成功返回True,否则返回False</returns>
        public bool UpdateCustomer(Customer data, List <CustomerTransportPrice> listTransportPrice, List <CustomerForceFeePrice> listForceFeePrice, List <CustomerStorageFeePrice> listStorageFeePrice, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            CustomerRule rule = new CustomerRule();

            return(rule.UpdateCustomer(data, listTransportPrice, listForceFeePrice, listStorageFeePrice, nOpStaffId, strOpStaffName, out strErrText));
        }