Example #1
0
        public ActionResult CustomerAcivities(int customerId)
        {
            CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId <int>());
            List <BCustomer>   customers   = customerMgr.FindCustomers(User.Identity.GetUserId <int>(), customerId, out total);

            if (customers.Count == 0)
            {
                ViewBag.Message = string.Format("编号为:{0}的客户不是你的客户", customerId);
                return(View("Error"));
            }
            BCustomer          customer    = customers[0];
            ActivityManagement activityMgr = new ActivityManagement(customerMgr.CurrentLoginUser);
            int page     = 1;
            int pageSize = 20;

            int.TryParse(Request["page"], out page);
            page = page > 0 ? page : 1;
            List <BActivity>            activities = activityMgr.FindActivities(0, User.Identity.GetUserId <int>(), customerId, out total, true, page, pageSize);
            PageItemsResult <BActivity> result     = new PageItemsResult <BActivity>()
            {
                CurrentPage = page, EnablePaging = true, Items = activities, PageSize = pageSize, TotalRecords = total
            };

            KMBit.Grids.KMGrid <BActivity> grid = new Grids.KMGrid <BActivity>(result);
            ViewBag.Customer = customer;
            return(View("CustomerAcivities", grid));
        }
Example #2
0
        public ActionResult ChargeOrders(OrderSearchModel searchModel)
        {
            OrderManagement orderMgt = new OrderManagement(User.Identity.GetUserId <int>());
            int             pageSize = 30;
            DateTime        sDate    = DateTime.MinValue;
            DateTime        eDate    = DateTime.MinValue;

            if (!string.IsNullOrEmpty(searchModel.StartTime))
            {
                DateTime.TryParse(searchModel.StartTime, out sDate);
            }
            if (!string.IsNullOrEmpty(searchModel.EndTime))
            {
                DateTime.TryParse(searchModel.EndTime, out eDate);
            }
            long sintDate = sDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(sDate) : 0;
            long eintDate = eDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(eDate) : 0;
            int  page     = 1;

            if (Request["page"] != null)
            {
                int.TryParse(Request["page"], out page);
            }
            searchModel.Page     = page;
            searchModel.AgencyId = User.Identity.GetUserId <int>();
            List <BOrder> orders = orderMgt.FindOrders(searchModel.OrderId != null ? (int)searchModel.OrderId : 0,
                                                       searchModel.AgencyId != null ? (int)searchModel.AgencyId : 0,
                                                       searchModel.ResourceId != null ? (int)searchModel.ResourceId : 0,
                                                       searchModel.ResourceTaocanId != null ? (int)searchModel.ResourceTaocanId : 0,
                                                       searchModel.RuoteId != null ? (int)searchModel.RuoteId : 0,
                                                       searchModel.SPName, searchModel.MobileNumber,
                                                       searchModel.Status,
                                                       sintDate,
                                                       eintDate,
                                                       out total,
                                                       pageSize,
                                                       searchModel.Page, true);
            PageItemsResult <BOrder> result = new PageItemsResult <BOrder>()
            {
                CurrentPage = searchModel.Page, Items = orders, PageSize = pageSize, TotalRecords = total, EnablePaging = true
            };

            KMBit.Grids.KMGrid <BOrder> grid  = new Grids.KMGrid <BOrder>(result);
            BigOrderSearchModel         model = new BigOrderSearchModel()
            {
                SearchModel = searchModel, OrderGrid = grid
            };
            List <BResourceTaocan> taocans = new List <BResourceTaocan>();

            agentMgt = new AgentManagement(orderMgt.CurrentLoginUser);
            List <BAgentRoute> routes = agentMgt.FindTaocans(0);

            taocans            = (from r in routes select r.Taocan).ToList <BResourceTaocan>();
            ViewBag.Taocans    = new SelectList((from t in taocans select new { Id = t.Taocan.Id, Name = t.Taocan2.Name }), "Id", "Name");
            ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetChargeStatusList() select new { Id = s.Id, Name = s.Value }), "Id", "Name");
            return(View(model));
        }
Example #3
0
        public ActionResult CustomerRechargeHistories(int customerId)
        {
            CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId <int>());
            int page = 1;

            int.TryParse(Request["page"], out page);
            page = page > 0 ? page : 0;
            int pageSize = 20;
            List <BCustomerReChargeHistory>            histories = customerMgr.FindCustomerChargeHistoies(User.Identity.GetUserId <int>(), customerId, out total, true, page, pageSize);
            PageItemsResult <BCustomerReChargeHistory> result    = new PageItemsResult <BCustomerReChargeHistory>()
            {
                CurrentPage = page, EnablePaging = true, Items = histories, PageSize = pageSize, TotalRecords = total
            };

            KMBit.Grids.KMGrid <BCustomerReChargeHistory> grid = new Grids.KMGrid <BCustomerReChargeHistory>(result);
            return(View(grid));
        }
Example #4
0
        public ActionResult PayHistories()
        {
            PaymentManagement payMgr = new PaymentManagement(User.Identity.GetUserId <int>());
            int page     = 1;
            int pageSize = 30;

            int.TryParse(Request["page"], out page);
            page = page > 0 ? page : 1;
            List <BPaymentHistory>            payments = payMgr.FindPayments(0, User.Identity.GetUserId <int>(), 0, out total, true, pageSize, page);
            PageItemsResult <BPaymentHistory> result   = new PageItemsResult <BPaymentHistory>()
            {
                CurrentPage = page, Items = payments, PageSize = pageSize, TotalRecords = total, EnablePaging = true
            };

            KMBit.Grids.KMGrid <BPaymentHistory> grid = new Grids.KMGrid <BPaymentHistory>(result);
            return(View(grid));
        }
Example #5
0
        public ActionResult ActivityTaocans(int activityId, int customerId)
        {
            ActivityManagement activityMgr = new ActivityManagement(User.Identity.GetUserId <int>());

            try
            {
                List <BActivityTaocan>            taocans = activityMgr.FindActivityTaocans(activityId, customerId, User.Identity.GetUserId <int>());
                PageItemsResult <BActivityTaocan> result  = new PageItemsResult <BActivityTaocan>()
                {
                    CurrentPage = 1, EnablePaging = true, Items = taocans, PageSize = taocans.Count, TotalRecords = taocans.Count
                };
                KMBit.Grids.KMGrid <BActivityTaocan> grid = new Grids.KMGrid <BActivityTaocan>(result);
                return(View(grid));
            }catch (KMBitException ex)
            {
                ViewBag.Message = ex.Message;
                return(View("Error"));
            }
        }
Example #6
0
        public ActionResult ActivityOrders(int activityId, int customerId)
        {
            ActivityManagement activityMgr = new ActivityManagement(User.Identity.GetUserId <int>());

            try
            {
                List <BActivityOrder>            mOrders = activityMgr.FindMarketingOrders(User.Identity.GetUserId <int>(), customerId, activityId, 0, out total);
                PageItemsResult <BActivityOrder> result  = new PageItemsResult <BActivityOrder>()
                {
                    CurrentPage = 1, EnablePaging = true, Items = mOrders, PageSize = mOrders.Count, TotalRecords = mOrders.Count
                };
                KMBit.Grids.KMGrid <BActivityOrder> grid = new Grids.KMGrid <BActivityOrder>(result);
                return(View(grid));
            }
            catch (KMBitException ex)
            {
                ViewBag.Message = ex.Message;
                return(View("Error"));
            }
        }
Example #7
0
 public ActionResult ActivityOrders(int activityId, int customerId)
 {
     ActivityManagement activityMgr = new ActivityManagement(User.Identity.GetUserId<int>());
     try
     {
         List<BActivityOrder> mOrders = activityMgr.FindMarketingOrders(User.Identity.GetUserId<int>(), customerId,activityId,0 ,out total);
         PageItemsResult<BActivityOrder> result = new PageItemsResult<BActivityOrder>() { CurrentPage = 1, EnablePaging = true, Items = mOrders, PageSize = mOrders.Count, TotalRecords = mOrders.Count };
         KMBit.Grids.KMGrid<BActivityOrder> grid = new Grids.KMGrid<BActivityOrder>(result);
         return View(grid);
     }
     catch (KMBitException ex)
     {
         ViewBag.Message = ex.Message;
         return View("Error");
     }
 }
Example #8
0
 public ActionResult ActivityTaocans(int activityId, int customerId)
 {
     ActivityManagement activityMgr = new ActivityManagement(User.Identity.GetUserId<int>());
     try
     {
         List<BActivityTaocan> taocans = activityMgr.FindActivityTaocans(activityId, customerId, User.Identity.GetUserId<int>());
         PageItemsResult<BActivityTaocan> result = new PageItemsResult<BActivityTaocan>() { CurrentPage=1, EnablePaging=true, Items=taocans, PageSize=taocans.Count, TotalRecords=taocans.Count };
         KMBit.Grids.KMGrid<BActivityTaocan> grid = new Grids.KMGrid<BActivityTaocan>(result);
         return View(grid);
     }catch(KMBitException ex)
     {
         ViewBag.Message = ex.Message;
         return View("Error");
     }
 }
Example #9
0
        public ActionResult ChargeOrders(OrderSearchModel searchModel)
        {
            OrderManagement orderMgt = new OrderManagement(User.Identity.GetUserId<int>());
            agentAdminMgt = new AgentAdminMenagement(orderMgt.CurrentLoginUser);
            resourceMgt = new ResourceManagement(orderMgt.CurrentLoginUser);
            if (!orderMgt.CurrentLoginUser.Permission.CHARGE_HISTORY)
            {
                ViewBag.Message = "没有权限查看流量充值记录";
                return View("Error");
            }
            int pageSize = 40;
            DateTime sDate = DateTime.MinValue;
            DateTime eDate = DateTime.MinValue;
            if(!string.IsNullOrEmpty(searchModel.StartTime))
            {
                DateTime.TryParse(searchModel.StartTime, out sDate);
            }
            if (!string.IsNullOrEmpty(searchModel.EndTime))
            {
                DateTime.TryParse(searchModel.EndTime, out eDate);
            }
            long sintDate = sDate!=DateTime.MinValue?DateTimeUtil.ConvertDateTimeToInt(sDate):0;
            long eintDate= eDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(eDate) : 0;
            int page = 1;
            if(Request["page"]!=null)
            {
                int.TryParse(Request["page"],out page);
            }
            searchModel.Page = page;
            List<BOrder> orders = orderMgt.FindOrders(searchModel.OrderId!=null?(int)searchModel.OrderId:0, 
                                                      searchModel.AgencyId!=null?(int)searchModel.AgencyId:0, 
                                                      searchModel.ResourceId!=null?(int)searchModel.ResourceId:0, 
                                                      searchModel.ResourceTaocanId!=null?(int)searchModel.ResourceTaocanId:0, 
                                                      searchModel.RuoteId!=null?(int)searchModel.RuoteId:0, 
                                                      searchModel.SPName, searchModel.MobileNumber,
                                                      searchModel.Status,
                                                      sintDate,
                                                      eintDate,
                                                      out total,
                                                      pageSize,
                                                      searchModel.Page, true);
            PageItemsResult<BOrder> result = new PageItemsResult<BOrder>() { CurrentPage = searchModel.Page, Items = orders, PageSize = pageSize, TotalRecords = total,EnablePaging=true };
            KMBit.Grids.KMGrid<BOrder> grid = new Grids.KMGrid<BOrder>(result);
            BigOrderSearchModel model = new BigOrderSearchModel() { SearchModel = searchModel, OrderGrid = grid };

            List<KMBit.Beans.BUser> agencies = agentAdminMgt.FindAgencies(0, null, null, 0, 0, out total, 0, 0, false,null);
            List<BResource> resources = new List<BResource>();
            if(searchModel.AgencyId!=null)
            {
                resources = agentAdminMgt.FindAgentResources((int)searchModel.AgencyId);
            }else
            {
                resources = resourceMgt.FindResources(0,null,0,out total);
            }
            ViewBag.Agencies = new SelectList((from a in agencies select a.User).ToList<Users>(),"Id","Name");
            ViewBag.Resources = new SelectList((from r in resources select r.Resource).ToList<Resource>(), "Id", "Name");

            List<BResourceTaocan> taocans = new List<BResourceTaocan>();
            if(searchModel.ResourceId!=null)
            {
                if(searchModel.AgencyId==null)
                {
                    taocans = resourceMgt.FindResourceTaocans((int)searchModel.ResourceId, 0, false);
                }
                else
                {
                    taocans = agentAdminMgt.FindAgencyResourceTaocans((int)searchModel.AgencyId, (int)searchModel.ResourceId);
                }                
            }
            ViewBag.Taocans = new SelectList((from t in taocans select new { Id=t.Taocan.Id,Name=t.Taocan2.Name}), "Id", "Name");
            ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetChargeStatusList() select new { Id=s.Id,Name=s.Value}),"Id","Name");
            return View(model);
        }
Example #10
0
 public ActionResult CustomerRechargeHistories(int customerId)
 {
     CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId<int>());
     int page = 1;
     int.TryParse(Request["page"],out page);
     page = page > 0 ? page : 0;
     int pageSize = 20;
     List<BCustomerReChargeHistory> histories = customerMgr.FindCustomerChargeHistoies(User.Identity.GetUserId<int>(), customerId, out total, true, page, pageSize);
     PageItemsResult<BCustomerReChargeHistory> result = new PageItemsResult<BCustomerReChargeHistory>() { CurrentPage=page,EnablePaging=true, Items=histories, PageSize=pageSize, TotalRecords=total };
     KMBit.Grids.KMGrid<BCustomerReChargeHistory> grid = new Grids.KMGrid<BCustomerReChargeHistory>(result);
     return View(grid);
 }
Example #11
0
 public ActionResult PayHistories()
 {
     PaymentManagement payMgr = new PaymentManagement(User.Identity.GetUserId<int>());
     int page = 1;
     int pageSize = 30;
     int.TryParse(Request["page"],out page);
     page = page > 0 ? page : 1;
     List<BPaymentHistory> payments = payMgr.FindPayments(0, User.Identity.GetUserId<int>(), 0, out total, true, pageSize, page);
     PageItemsResult<BPaymentHistory> result = new PageItemsResult<BPaymentHistory>() { CurrentPage = page, Items = payments, PageSize = pageSize, TotalRecords = total, EnablePaging = true };
     KMBit.Grids.KMGrid<BPaymentHistory> grid = new Grids.KMGrid<BPaymentHistory>(result);
     return View(grid);
 }
Example #12
0
 public ActionResult ChargeOrders(OrderSearchModel searchModel)
 {
     OrderManagement orderMgt = new OrderManagement(User.Identity.GetUserId<int>());  
     int pageSize = 30;
     DateTime sDate = DateTime.MinValue;
     DateTime eDate = DateTime.MinValue;
     if (!string.IsNullOrEmpty(searchModel.StartTime))
     {
         DateTime.TryParse(searchModel.StartTime, out sDate);
     }
     if (!string.IsNullOrEmpty(searchModel.EndTime))
     {
         DateTime.TryParse(searchModel.EndTime, out eDate);
     }
     long sintDate = sDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(sDate) : 0;
     long eintDate = eDate != DateTime.MinValue ? DateTimeUtil.ConvertDateTimeToInt(eDate) : 0;
     int page = 1;
     if (Request["page"] != null)
     {
         int.TryParse(Request["page"], out page);
     }
     searchModel.Page = page;
     searchModel.AgencyId = User.Identity.GetUserId<int>();
     List<BOrder> orders = orderMgt.FindOrders(searchModel.OrderId != null ? (int)searchModel.OrderId : 0,
                                               searchModel.AgencyId != null ? (int)searchModel.AgencyId : 0,
                                               searchModel.ResourceId != null ? (int)searchModel.ResourceId : 0,
                                               searchModel.ResourceTaocanId != null ? (int)searchModel.ResourceTaocanId : 0,
                                               searchModel.RuoteId != null ? (int)searchModel.RuoteId : 0,
                                               searchModel.SPName, searchModel.MobileNumber,
                                               searchModel.Status,
                                               sintDate,
                                               eintDate,
                                               out total,
                                               pageSize,
                                               searchModel.Page, true);
     PageItemsResult<BOrder> result = new PageItemsResult<BOrder>() { CurrentPage = searchModel.Page, Items = orders, PageSize = pageSize, TotalRecords = total, EnablePaging = true };
     KMBit.Grids.KMGrid<BOrder> grid = new Grids.KMGrid<BOrder>(result);
     BigOrderSearchModel model = new BigOrderSearchModel() { SearchModel = searchModel, OrderGrid = grid };  
     List<BResourceTaocan> taocans = new List<BResourceTaocan>();
     agentMgt = new AgentManagement(orderMgt.CurrentLoginUser);
     List<BAgentRoute> routes = agentMgt.FindTaocans(0);
     taocans = (from r in routes select r.Taocan).ToList<BResourceTaocan>();
     ViewBag.Taocans = new SelectList((from t in taocans select new { Id = t.Taocan.Id, Name = t.Taocan2.Name }), "Id", "Name");
     ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetChargeStatusList() select new { Id = s.Id, Name = s.Value }), "Id", "Name");
     return View(model);
 }
Example #13
0
        public ActionResult Agencies()
        {
            if (agentAdminMgt == null)
                agentAdminMgt = new AgentAdminMenagement(User.Identity.GetUserId<int>());

            int pageSize = 30;
            int requestPage = 1;
            int.TryParse(Request["page"], out requestPage);
            requestPage = requestPage == 0 ? 1 : requestPage;
            List<BUser> users = agentAdminMgt.FindAgencies(0, null, null, 0, 0, out total,requestPage,pageSize);
            PageItemsResult<BUser> result = new PageItemsResult<BUser>() { CurrentPage = requestPage, Items = users, PageSize = pageSize, TotalRecords = total };
            KMBit.Grids.KMGrid<BUser> grid = new Grids.KMGrid<BUser>(result);
            ViewBag.LoginUser = agentAdminMgt.CurrentLoginUser;
            return View(grid);
        }
Example #14
0
 public ActionResult ViewResourceTaoCan(int? resourceId)
 {
     int id = resourceId??0;            
     resourceMgt = new ResourceManagement(User.Identity.GetUserId<int>());
     List<BResource> resources = resourceMgt.FindResources(id, null, 0,out total);
     if (resources == null || resources.Count == 0)
     {               
         return View("Error");
     }
     int pageSize = 50;
     int requestPage = 1;
     int.TryParse(Request["page"], out requestPage);
     requestPage = requestPage == 0 ? 1 : requestPage;
     List<BResourceTaocan> resourceTaocans = resourceMgt.FindResourceTaocans(0, id, 0, out total, requestPage, pageSize,false);
     PageItemsResult<BResourceTaocan> result = new PageItemsResult<BResourceTaocan>() { CurrentPage = requestPage, Items = resourceTaocans, PageSize = resourceTaocans.Count, TotalRecords = total };
     result.EnablePaging = false;
     KMBit.Grids.KMGrid<BResourceTaocan> grid = new Grids.KMGrid<BResourceTaocan>(result);
     ViewBag.Resource = resources[0];
     return View(grid);
 }
Example #15
0
 public ActionResult Resources()
 {
     int pageSize = 20;
     int requestPage = 1;
     int.TryParse(Request["page"], out requestPage);
     requestPage = requestPage == 0 ? 1 : requestPage;
     resourceMgt = new ResourceManagement(User.Identity.GetUserId<int>());
     if(!resourceMgt.CurrentLoginUser.Permission.VIEW_RESOURCE)
     {
         ViewBag.Message = "没有权限查看资源";
         return View("Error");
     }
     ViewBag.LoginUser = resourceMgt.CurrentLoginUser;
     var resources = resourceMgt.FindResources(0, null, 0,out total,requestPage,pageSize,true);
     PageItemsResult<BResource> result = new PageItemsResult<BResource>() { CurrentPage = requestPage, Items = resources, PageSize = pageSize, TotalRecords = total };
     KMBit.Grids.KMGrid<BResource> grid = new Grids.KMGrid<BResource>(result);
     return View(grid);
 }
Example #16
0
 public ActionResult CustomerAcivities(int customerId)
 {
     CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId<int>());
     List<BCustomer> customers = customerMgr.FindCustomers(User.Identity.GetUserId<int>(), customerId, out total);
     if(customers.Count==0)
     {
         ViewBag.Message = string.Format("编号为:{0}的客户不是你的客户", customerId);
         return View("Error");
     }
     BCustomer customer = customers[0];
     ActivityManagement activityMgr = new ActivityManagement(customerMgr.CurrentLoginUser);
     int page = 1;
     int pageSize = 20;
     int.TryParse(Request["page"], out page);
     page = page > 0 ? page : 1;
     List<BActivity> activities = activityMgr.FindActivities(0,User.Identity.GetUserId<int>(), customerId, out total, true, page, pageSize);
     PageItemsResult<BActivity> result = new PageItemsResult<BActivity>() { CurrentPage = page, EnablePaging = true, Items = activities, PageSize = pageSize, TotalRecords = total };
     KMBit.Grids.KMGrid<BActivity> grid = new Grids.KMGrid<BActivity>(result);
     ViewBag.Customer = customer;
     return View("CustomerAcivities",grid);
 }
Example #17
0
 public ActionResult AccountChargeHistory(PaymentHistoryModel searchModel)
 {
     PaymentManagement paymentMgt = new PaymentManagement(User.Identity.GetUserId<int>());
     agentAdminMgt = new AgentAdminMenagement(paymentMgt.CurrentLoginUser);
     int pageSize = 30;
     int page = 1;
     if (Request["page"] != null)
     {
         int.TryParse(Request["page"], out page);
     }
     searchModel.Page = page;
     List<BPaymentHistory> records = paymentMgt.FindAgentPayments(0, searchModel.AgentId!=null?(int)searchModel.AgentId:0, 0, searchModel.PayType, searchModel.TranfserType!=null?(int)searchModel.TranfserType:0, searchModel.OprUser, searchModel.Status, out total, true,pageSize,page);
     PageItemsResult<BPaymentHistory> result = new PageItemsResult<BPaymentHistory>() { CurrentPage = page, Items = records, PageSize = pageSize, TotalRecords = total, EnablePaging = true };
     KMBit.Grids.KMGrid<BPaymentHistory> grid = new Grids.KMGrid<BPaymentHistory>(result);
     BigPaymentSearchModel bidModel = new BigPaymentSearchModel() { SearchModel = searchModel, Grid = grid };
     List<KMBit.Beans.BUser> agencies = agentAdminMgt.FindAgencies(0, null, null, 0, 0, out total, 0, 0, false, null);
     ViewBag.Agencies = new SelectList((from a in agencies select a.User).ToList<Users>(), "Id", "Name");
     ViewBag.PayTypes = new SelectList((from s in StaticDictionary.GetPaymentTypeList2() select new { Id = s.Id, Name = s.Value }), "Id", "Name");
     ViewBag.StatusList = new SelectList((from s in StaticDictionary.GetPaymentStatusList() select new { Id = s.Id, Name = s.Value }), "Id", "Name");
     ViewBag.TranfserTypes = new SelectList((from s in StaticDictionary.GetTranfserTypeList() select new { Id = s.Id, Name = s.Value }), "Id", "Name");
     return View(bidModel);
 }