public ActionResult TgtVsAch(string CustomerId, string CustomerType)
        {
            TgtVsAchViewModel objData = new TgtVsAchViewModel();

            try
            {
                var objCust = CDR.GetCustomerDetail(CustomerId, CustomerType);
                objCust.CustomerCategory = "Participant";
                Session["ChitaleUser"]   = objCust;

                CustomerDetail UserSession = new CustomerDetail();
                UserSession = (CustomerDetail)Session["ChitaleUser"];

                objData.objOverAll     = PLR.GetOverallData(UserSession.CustomerId, "", "");
                objData.objCategory    = PLR.GetCategoryData(UserSession.CustomerId, "", "");
                objData.objSubCategory = PLR.GetSubCategoryData(UserSession.CustomerId, "", "");
                objData.objProducts    = PLR.GetProductData(UserSession.CustomerId, "", "");

                string[] names = DateTimeFormatInfo.CurrentInfo.MonthNames;
                List <SelectListItem> MonthItems = new List <SelectListItem>();
                int Month = 1;
                foreach (var item in names)
                {
                    MonthItems.Add(new SelectListItem
                    {
                        Text  = Convert.ToString(item),
                        Value = Convert.ToString(Month)
                    });
                    Month++;
                }
                MonthItems.RemoveAt(12);
                objData.MonthItems = MonthItems;
                List <SelectListItem> YearItems = new List <SelectListItem>();
                for (int i = 0; i <= 10; i++)
                {
                    int year = DateTime.Now.Year;
                    YearItems.Add(new SelectListItem
                    {
                        Text  = Convert.ToString(year - i),
                        Value = Convert.ToString(year - i)
                    });
                }
                objData.YearItems = YearItems;
            }
            catch (Exception ex)
            {
                newexception.AddException(ex);
            }
            return(View(objData));
        }
Пример #2
0
        public ActionResult Index(string CustomerId, string CustomerType, string MobileNo)
        {
            var objCust = CDR.GetCustomerDetail(CustomerId, CustomerType);

            if (objCust != null)
            {
                objCust.Type = CustomerType;
                if (CustomerType == "Distributors" || CustomerType == "SuperStockiest" || CustomerType == "Retailers")
                {
                    objCust.CustomerCategory       = "Participant";
                    Session["ChitaleUser"]         = objCust;
                    Session["CategoryParticipant"] = "Participant";
                    return(RedirectToAction("Index", "Dashboard", new { CustomerId = CustomerId, CustomerType = CustomerType }));
                }

                if (CustomerType == "Management")
                {
                    objCust.CustomerCategory      = "Management";
                    Session["ChitaleManagement"]  = objCust;
                    Session["CategoryManagement"] = "Management";
                    return(RedirectToAction("Index", "ManagementDashboard", new { CustomerId = CustomerId, CustomerType = CustomerType }));
                }

                if (CustomerType == "SalesExecutive" || CustomerType == "SalesManager" || CustomerType == "SalesOfficer" || CustomerType == "SalesRepresentative" || CustomerType == "NationalHead" ||
                    CustomerType == "ZonalHead" || CustomerType == "StateHead")
                {
                    objCust.CustomerCategory    = "Employee";
                    Session["ChitaleEmployee"]  = objCust;
                    Session["CategoryEmployee"] = "Employee";
                    return(RedirectToAction("Index", "Employee", new { CustomerId = CustomerId, CustomerType = CustomerType }));
                }
            }

            return(View());
        }