Пример #1
0
        /// <summary>
        /// Get Product Type Master, this retuns the all active product types.
        /// </summary>
        /// <returns>JsonResult</returns>
        public JsonResult GetProductTypeMaster(string userTypeCode, string mode)
        {
            string    companyCode    = _objCurrentInfo.GetCompanyCode();
            string    privilegeName  = "DCR_PRODUCTS_BRING_TYPE";
            DataTable dtProductTypes = new DataTable();

            DataSet ds = _objSPData.GetProductTypePrivilageValue(companyCode, userTypeCode, privilegeName, mode);
            //  DataSet ds = _objSPData.GetProductTypeMaster(companyCode);
            List <ProductTypesModal> lstProductTypes = new List <ProductTypesModal>();



            if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
            {
                dtProductTypes = ds.Tables[0];
            }

            lstProductTypes = (from ProductTypes in dtProductTypes.AsEnumerable()
                               select new ProductTypesModal
            {
                Product_Type_Code = ProductTypes["Product_Type_Code"].ToString(),
                Product_Type_Name = ProductTypes["Product_Type_Name"].ToString()
            }).ToList <ProductTypesModal>();

            return(Json(lstProductTypes));
        }