Exemplo n.º 1
0
        public ActionResult ManageServices(string id = "")
        {
            ServicesCommon servicesCommon = new ServicesCommon();
            var            productid      = id.DecryptParameter();

            if (!String.IsNullOrEmpty(productid))
            {
                //return RedirectToAction("Index");
                servicesCommon           = _services.GetServicesByProductId(Int32.Parse(productid));
                servicesCommon.ProductId = servicesCommon.ProductId.EncryptParameter();
            }


            servicesCommon.StatusList           = LoadDropdownList("status") as List <SelectListItem>;
            servicesCommon.CompanyList          = ApplicationUtilities.SetDDLValue(LoadDropdownList("company") as Dictionary <string, string>, servicesCommon.Company, "Select Company");
            servicesCommon.TransactionTypeList  = ApplicationUtilities.SetDDLValue(LoadDropdownList("txntype") as Dictionary <string, string>, servicesCommon.TransactionType, "Select Transaction Type");
            servicesCommon.ProductTypeList      = ApplicationUtilities.SetDDLValue(LoadDropdownList("producttype") as Dictionary <string, string>, servicesCommon.ProductType, "Select Product Type");
            servicesCommon.ProductCategoryList  = ApplicationUtilities.SetDDLValue(LoadDropdownList("productcategory") as Dictionary <string, string>, servicesCommon.ProductCategory, "Select Product Category");
            servicesCommon.PrimaryGatewayList   = ApplicationUtilities.SetDDLValue(LoadDropdownList("primarygateway") as Dictionary <string, string>, servicesCommon.PrimaryGateway, "Select Primary Gateway");
            servicesCommon.SecondaryGatewayList = ApplicationUtilities.SetDDLValue(LoadDropdownList("secondarygateway") as Dictionary <string, string>, servicesCommon.SecondaryGateway, "Select Secondary Gateway");


            ServicesModel lst = servicesCommon.MapObject <ServicesModel>();

            return(View(lst));
        }
Exemplo n.º 2
0
        public ActionResult ServicesDetail(string id = "")
        {
            ServicesCommon servicesCommon = new ServicesCommon();
            var            productid      = id.DecryptParameter();

            if (!String.IsNullOrEmpty(productid))
            {
                //return RedirectToAction("Index");
                servicesCommon           = _services.GetServicesByProductId(Int32.Parse(productid));
                servicesCommon.ProductId = servicesCommon.ProductId.EncryptParameter();
            }

            Dictionary <string, string> CompanyList = LoadDropdownList("company") as Dictionary <string, string>;

            servicesCommon.Company = CompanyList.ContainsKey(servicesCommon.Company) ? CompanyList.First(x => x.Key == servicesCommon.Company).Value : servicesCommon.Company;

            Dictionary <string, string> TransactionTypeList = LoadDropdownList("txntype") as Dictionary <string, string>;

            servicesCommon.TransactionType = TransactionTypeList.ContainsKey(servicesCommon.TransactionType) ? TransactionTypeList.First(x => x.Key == servicesCommon.TransactionType).Value : servicesCommon.TransactionType;

            Dictionary <string, string> ProductTypeList = LoadDropdownList("producttype") as Dictionary <string, string>;

            servicesCommon.ProductType = ProductTypeList.ContainsKey(servicesCommon.ProductType) ? ProductTypeList.First(x => x.Key == servicesCommon.ProductType).Value : servicesCommon.ProductType;

            Dictionary <string, string> ProductCategoryList = LoadDropdownList("productcategory") as Dictionary <string, string>;

            servicesCommon.ProductCategory = ProductCategoryList.ContainsKey(servicesCommon.ProductCategory) ? ProductCategoryList.First(x => x.Key == servicesCommon.ProductCategory).Value : servicesCommon.ProductCategory;

            Dictionary <string, string> PrimaryGatewayList = LoadDropdownList("primarygateway") as Dictionary <string, string>;

            servicesCommon.PrimaryGateway = PrimaryGatewayList.ContainsKey(servicesCommon.PrimaryGateway) ? PrimaryGatewayList.First(x => x.Key == servicesCommon.PrimaryGateway).Value : servicesCommon.PrimaryGateway;

            Dictionary <string, string> SecondaryGatewayList = LoadDropdownList("secondarygateway") as Dictionary <string, string>;

            servicesCommon.SecondaryGateway = CompanyList.ContainsKey(servicesCommon.SecondaryGateway) ? CompanyList.First(x => x.Key == servicesCommon.SecondaryGateway).Value : servicesCommon.SecondaryGateway;

            servicesCommon.Status = string.IsNullOrEmpty(servicesCommon.Status) ? "Disabled" : string.Equals(servicesCommon.Status.ToUpper(), "Y") ? "Enabled" : "Disabled";
            ServicesModel lst = servicesCommon.MapObject <ServicesModel>();

            return(View(lst));
        }