예제 #1
0
 // GET: Sales/Client/AddNewClient
 public ActionResult AddNewClient()
 {
     ViewBag.RegionId     = new SelectList(_iRegionManager.GetAll(), "RegionId", "RegionName");
     ViewBag.ClientTypeId = new SelectList(_iCommonManager.GetAllClientType(), "ClientTypeId", "ClientTypeName");
     ViewBag.DistrictId   = new SelectList(_iDistrictManager.GetAll().ToList(), "DistrictId", "DistrictName");
     ViewBag.UpazillaId   = new SelectList(new List <Upazilla>(), "UpazillaId", "UpzillaName");
     ViewBag.PostOfficeId = new SelectList(new List <PostOffice>(), "PostOfficeId", "PostOfficeName");
     ViewBag.TerritoryId  = new SelectList(new List <Territory>(), "TerritoryId", "TerritoryName");
     return(View());
 }
 // GET: Sales/Client/AddNewClient
 public ActionResult AddNewClient()
 {
     try
     {
         int branchId = Convert.ToInt32(Session["BranchId"]);
         ViewBag.BranchId     = new SelectList(_iBranchManager.GetAllBranches(), "BranchId", "BranchName", branchId);
         ViewBag.RegionId     = new SelectList(_iRegionManager.GetAll(), "RegionId", "RegionName");
         ViewBag.ClientTypeId = new SelectList(_iCommonManager.GetAllClientType(), "ClientTypeId", "ClientTypeName");
         ViewBag.DistrictId   = new SelectList(_iDistrictManager.GetAll().ToList(), "DistrictId", "DistrictName");
         ViewBag.UpazillaId   = new SelectList(new List <Upazilla>(), "UpazillaId", "UpzillaName");
         ViewBag.PostOfficeId = new SelectList(new List <PostOffice>(), "PostOfficeId", "PostOfficeName");
         ViewBag.TerritoryId  = new SelectList(new List <Territory>(), "TerritoryId", "TerritoryName");
         return(View());
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
예제 #3
0
        public ActionResult AddDiscount()
        {
            ViewBag.ClientTypes = _iCommonManager.GetAllClientType().ToList();
            foreach (ClientType clientType in _iCommonManager.GetAllClientType())
            {
                foreach (var product in _iProductManager.GetAllProducts())
                {
                    Discount model = new Discount
                    {
                        UpdateByUserId  = 6,
                        DiscountPercent = 6,
                        ClientTypeId    = clientType.ClientTypeId,
                        UpdateDate      = DateTime.Now,
                        ProductId       = product.ProductId,
                    };

                    _iDiscountManager.Add(model);
                }
            }

            return(View());
        }
예제 #4
0
 public ActionResult Edit(int id)
 {
     try
     {
         Client client = _iClientManager.GetById(id);
         ViewBag.TerritoryId  = new SelectList(_iTerritoryManager.GetAll().ToList().FindAll(n => n.RegionId == client.RegionId), "TerritoryId", "TerritoryName");
         ViewBag.DistrictId   = new SelectList(_districtGateway.GetAll(), "DistrictId", "DistrictName");
         ViewBag.UpazillaId   = new SelectList(_upazillaGateway.GetAllUpazillaByDistrictId(client.DistrictId ?? default(int)), "UpazillaId", "UpazillaName");
         ViewBag.PostOfficeId = new SelectList(_postOfficeGateway.GetAllPostOfficeByUpazillaId(client.UpazillaId ?? default(int)), "PostOfficeId", "PostOfficeName");
         ViewBag.RegionId     = new SelectList(_iRegionManager.GetAll(), "RegionId", "RegionName");
         ViewBag.ClientTypeId = new SelectList(_iCommonManager.GetAllClientType(), "ClientTypeId", "ClientTypeName");
         return(View(client));
     }
     catch (Exception e)
     {
         if (e.InnerException != null)
         {
             ViewBag.Msg = e.InnerException.Message;
         }
         return(View());
     }
 }
예제 #5
0
 public ActionResult AddDiscount()
 {
     ViewBag.ClientTypes = _iCommonManager.GetAllClientType().ToList();
     return(View());
 }
예제 #6
0
        // GET: Sales/Client/Profile/5



        // GET: Sales/Client/AddNewClient
        public ActionResult AddNewClient()
        {
            ViewBag.Regions     = _iRegionManager.GetAll().ToList();
            ViewBag.ClientTypes = _iCommonManager.GetAllClientType().ToList();
            return(View());
        }