Exemplo n.º 1
0
        //Bind Region
        public JsonResult GetRegionList(string regionTypecode)
        {
            try
            {
                BLMaster objMaster = new BLMaster();
                ProductPriceMasterModel objDropRegion = new ProductPriceMasterModel();
                objDropRegion.Company_Code     = _objcurrentInfo.GetCompanyCode();
                objDropRegion.Region_Type_Code = regionTypecode;
                IEnumerable <ProductPriceMasterModel> lstdropregiontype = objMaster.GetRegion(objDropRegion);

                var DropRegionList = (from region in lstdropregiontype.AsEnumerable()
                                      select new ProductPriceMasterModel()
                {
                    Region_Name = region.Region_Name.ToString(),
                    Region_Code = region.Region_Code.ToString()
                }).ToList <ProductPriceMasterModel>();
                return(Json(DropRegionList));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj);
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// InsertandUpdate
        /// </summary>
        /// <param name="regionTypecode"></param>
        /// <param name="regionCode"></param>
        /// <param name="productCode"></param>
        /// <param name="price"></param>
        /// <param name="effectiveFrom"></param>
        /// <param name="effectiveTo"></param>
        /// <param name="Mode"></param>
        /// <param name="priceCodeval"></param>
        /// <returns></returns>
        public int InsertandUpdateProductprice(string regionTypecode, string regionCode, string productCode, string price, string effectiveFrom,
                                               string effectiveTo, string Mode, string priceCodeval)
        {
            string   result1 = string.Empty;
            BLMaster Master  = new BLMaster();
            ProductPriceMasterModel        objproductPricemasterModer = new ProductPriceMasterModel();
            List <ProductPriceMasterModel> lstproductprice            = new List <ProductPriceMasterModel>();

            try
            {
                if (Mode.ToUpper() == "I") // Insert Data
                {
                    objproductPricemasterModer.Company_Code     = _objcurrentInfo.GetCompanyCode();
                    objproductPricemasterModer.Region_Type_Code = regionTypecode;
                    objproductPricemasterModer.Region_Code      = regionCode;
                    objproductPricemasterModer.Product_Code     = productCode;
                    objproductPricemasterModer.Price_Status     = "1";
                    objproductPricemasterModer.Price            = price;
                    objproductPricemasterModer.Effective_From   = effectiveFrom;
                    objproductPricemasterModer.Effective_To     = effectiveTo;
                    objproductPricemasterModer.Created_By       = _objcurrentInfo.GetUserName();
                    objproductPricemasterModer.Created_Date     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
                    lstproductprice.Add(objproductPricemasterModer);
                    int result = Master.InsertforProductPriceMaster(lstproductprice);
                    return(result);
                }
                else
                {
                    objproductPricemasterModer.Company_Code     = _objcurrentInfo.GetCompanyCode();
                    objproductPricemasterModer.Region_Type_Code = regionTypecode;
                    objproductPricemasterModer.Region_Code      = regionCode;
                    objproductPricemasterModer.Product_Code     = productCode;
                    objproductPricemasterModer.Price_Code       = priceCodeval;
                    objproductPricemasterModer.Price            = price;
                    objproductPricemasterModer.Effective_From   = effectiveFrom;
                    objproductPricemasterModer.Effective_To     = effectiveTo;
                    objproductPricemasterModer.Updated_By       = _objcurrentInfo.GetUserName();
                    objproductPricemasterModer.Updated_Date     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
                    lstproductprice.Add(objproductPricemasterModer);
                    int result = Master.UpdateforProductpriceMaster(lstproductprice);
                    return(result);
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:regionTypecode", regionTypecode);
                dicContext.Add("Filter:regionCode", regionCode);
                dicContext.Add("Filter:productCode", productCode);
                dicContext.Add("Filter:Mode", Mode);
                dicContext.Add("Filter:price", price);
                dicContext.Add("Filter:effectiveFrom", effectiveFrom);
                dicContext.Add("Filter:effectiveTo", effectiveTo);
                dicContext.Add("Filter:priceCodeval", priceCodeval);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(0);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method is used to
        /// </summary>
        /// <returns></returns>
        private IEnumerable <ProductPriceMasterModel> GetProductPriceDetails()
        {
            try
            {
                ProductPriceMasterModel objproductPriceMaster = new ProductPriceMasterModel();
                objproductPriceMaster.pm_Company_Code  = _objcurrentInfo.GetCompanyCode();
                objproductPriceMaster.Rm_Company_Code  = _objcurrentInfo.GetCompanyCode();
                objproductPriceMaster.Rtm_Company_Code = _objcurrentInfo.GetCompanyCode();
                objproductPriceMaster.Pp_Company_Code  = _objcurrentInfo.GetCompanyCode();

                BLMaster objMaster = new BLMaster();
                return(objMaster.GetProjectPriceMasterDetails(objproductPriceMaster));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj);
                return(null);
            }
        }
Exemplo n.º 4
0
        //Bind Product
        public JsonResult GetProductList()
        {
            try
            {
                BLMaster objMaster = new BLMaster();
                ProductPriceMasterModel objDropProduct = new ProductPriceMasterModel();
                objDropProduct.Company_Code = _objcurrentInfo.GetCompanyCode();
                IEnumerable <ProductPriceMasterModel> lstdropProduct = objMaster.GetProduct(objDropProduct);

                var ProductList = (from product in lstdropProduct.AsEnumerable()
                                   select new ProductPriceMasterModel()
                {
                    Product_Name = product.Product_Name.ToString(),
                    Product_Code = product.Product_Code.ToString()
                }).ToList <ProductPriceMasterModel>();
                return(Json(ProductList));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj);
                return(null);
            }
        }