Exemplo n.º 1
0
 public ActionResult User_ChangePassword(string OldPssword, string NewPassword)
 {
     using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
     {
         return(View("~/Views/MasterPages/UserPasswordChange.cshtml"));
     }
 }
 public ActionResult GetList_TaxCountryMap()
 {
     using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
     {
         return(View("~/Views/MasterPages/TaxCountryMapList.cshtml", iGstSvc.GetList_TaxCountryMap(0, "", "")));
     }
 }
 public ActionResult GetList_Role()
 {
     using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
     {
         return(View("~/Views/MasterPages/RoleList.cshtml", iGstSvc.GetList_Role("", "", "", false)));
     }
 }
 public ActionResult GetDetails_Role(string RoleID)
 {
     using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
     {
         return(PartialView("~/Views/MasterPages/RoleDetails.cshtml", iGstSvc.GetDetails_Role(RoleID, "", "", false)));
     }
 }
 public ActionResult GetDetails_TaxExpenseCountryCategoryMap(string TaxDefinationID, string CountryId, string CategoryId)
 {
     using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
     {
         return(PartialView("~/Views/MasterPages/TaxExpenseCountryCategoryMapDetails.cshtml", iGstSvc.GetDetails_TaxExpenseCountryCategoryMap(0, TaxDefinationID, CountryId, CategoryId)));
     }
 }
        public ActionResult GetDetails_Product(string ProductID)
        {
            if (Session["Language"] == null)
            {
                Session["Language"] = 1;
            }

            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            ProductInfo obj = iGstSvc.GetDetails_Product(ProductID, "", "", OrganizationCode, "", true, Session["Language"].ToString());

            int CountryId = 0;

            int.TryParse(((UserInfo)Session["UserDetails"]).Country, out CountryId);

            ViewBag.Categories = CommonMethods.ListCategory(obj.CategoryId, CountryId.ToString());
            ViewBag.Countries  = CommonMethods.ListCountry(obj.CountryId);

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                return(PartialView("~/Views/MasterPages/ProductDetails.cshtml", obj));
            }
        }
        public ActionResult GetDetails_TaxCountryMap(string TaxDefinationID, string CountryId)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                TaxCountryMapInfo obj = iGstSvc.GetDetails_TaxCountryMap(0, TaxDefinationID, CountryId);
                ViewBag.Taxes     = CommonMethods.ListTaxes(obj.TaxDefinationID);
                ViewBag.Countries = CommonMethods.ListCountry(obj.CountryId);

                return(PartialView("~/Views/MasterPages/TaxCountryMapDetails.cshtml", obj));
            }
        }
        public ActionResult Get_GstCategory(string CategoryId, string ShipStateId, string OrganizationCode)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                return(Json(iGstSvc.Get_GstCategory(CategoryId, ShipStateId, OrganizationCode), JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 9
0
 public ActionResult GetDashboard_Organization(string FromDate, string ToDate)
 {
     if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
     {
         using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
         {
             return(View("~/Views/MasterPages/Index.cshtml", new Auth_Svc.UserAuthenticationServiceClient().GetDashboard_Organization(((UserInfo)Session["UserDetails"]).OrganizationCode, FromDate, ToDate, "")));
         }
     }
     else
     {
         return(View("~/Views/MasterPages/Index.cshtml"));
     }
 }
Exemplo n.º 10
0
        public ActionResult GetList_OrganizationAccountant()
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                return(View("~/Views/MasterPages/OrganizationAccountanList.cshtml", new Auth_Svc.UserAuthenticationServiceClient().GetList_OrganizationAccountant("", OrganizationCode, "", false)));
            }
        }
        public ActionResult GetDetails_TaxMaster(string TaxDefinationID)
        {
            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                return(PartialView("~/Views/MasterPages/TaxMasterDetails.cshtml", iGstSvc.GetDetails_TaxMaster(0, TaxDefinationID)));
            }
        }
        public ActionResult GetList_ProductOrganizationImage(string ImageId, string OrganizationproductId, string ProductID, string IsActive, string IsMain)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                List <ProductOrganiztionImageInfo> list = new Product_Svc.ProductServiceClient().GetList_ProductOrganizationImage(ImageId, OrganizationproductId, "", "", IsMain);

                if (list != null && list.Count > 0 && list[0].ImageId > 0)
                {
                    return(Json(list, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("NO", JsonRequestBehavior.AllowGet));
                }
            }
        }
        public ActionResult Save_TaxMaster(string isOnlyDelete, string TaxDefinationID, string TaxName)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                TaxMasterInfo objBank = new TaxMasterInfo();

                objBank.TaxDefinationID = TaxDefinationID;
                objBank.TaxName         = TaxName;

                if (iGstSvc.Save_TaxMaster(isOnlyDelete.Trim().ToUpper() == "Y", objBank, ((UserInfo)Session["UserDetails"]), out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 14
0
        public static string ListTaxes(string SelectedItem)
        {
            List <TaxMasterInfo> Suppliers = null;

            System.Text.StringBuilder sbSupplierList = new System.Text.StringBuilder();

            try
            {
                if (System.Web.HttpContext.Current.Application["Taxmasterlist"] == null)
                {
                    Suppliers = new iGst_Svc.GSTServiceClient().GetList_TaxMaster(0, "");
                    System.Web.HttpContext.Current.Application["Taxmasterlist"] = Suppliers;
                }
                else
                {
                    Suppliers = (List <TaxMasterInfo>)System.Web.HttpContext.Current.Application["Taxmasterlist"];
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrors_Comments(ex.Message + ex.InnerException + ex.StackTrace, "Controler", "Organization ist", "");
                Suppliers = new List <TaxMasterInfo>();
            }

            sbSupplierList.AppendLine("<option value=\"\">Select one</option>");

            if (Suppliers != null && Suppliers.Count > 0)
            {
                foreach (TaxMasterInfo country in Suppliers)
                {
                    if (!string.IsNullOrEmpty(SelectedItem) && country.TaxDefinationID.Trim() == SelectedItem.Trim())
                    {
                        sbSupplierList.AppendLine("<option value=\"" + country.TaxDefinationID + "\" selected=\"selected\">" + country.TaxName + "</option>");
                    }
                    else
                    {
                        sbSupplierList.AppendLine("<option value=\"" + country.TaxDefinationID + "\">" + country.TaxName + "</option>");
                    }
                }
            }

            return(sbSupplierList.ToString());
        }
        public ActionResult Save_TaxExpenseCountryCategoryMap(string isOnlyDelete, string TaxDefinationID, string CountryId, string CategoryId, string ApplicableType, string Percentage)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                TaxCountryCategoryMapInfo objBank = new TaxCountryCategoryMapInfo();

                objBank.TaxDefinationID = TaxDefinationID;
                objBank.CountryId       = CountryId;
                objBank.CategoryId      = CategoryId;
                objBank.ApplicableType  = ApplicableType;
                objBank.Percentage      = Percentage;

                if (iGstSvc.Save_TaxExpenseCountryCategoryMap(isOnlyDelete.Trim().ToUpper() == "Y", objBank, ((UserInfo)Session["UserDetails"]), out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 16
0
        public ActionResult GetList_ExpenseOrganization()
        {
            if (Session["Language"] == null)
            {
                Session["Language"] = 0;
            }

            string OrganizationCode = "";

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                ViewBag.Organizations = CommonMethods.ListOrganizations("");

                return(View("~/Views/MasterPages/ExpenseOrganizationList.cshtml", new Expense_Svc.ExpenseServiceClient().GetList_ExpenseOrganization("", "", "", OrganizationCode, "", true, Session["Language"].ToString())));
            }
        }
        public ActionResult GetDetails_ProductOrganizationAddEdit(string OrganizationproductId, string org)
        {
            if (Session["Language"] == null)
            {
                Session["Language"] = 0;
            }

            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                org = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                // Modified on [30th August 2019] by [Partha] cause [Adding isExpense parameter]
                var list = new Product_Svc.ProductServiceClient().GetList_ProductOrganization(OrganizationproductId, "", "", org, "", true, Session["Language"].ToString());
                // END: Modified on[30th August 2019] by[Partha]

                if (string.IsNullOrEmpty(org) && (list != null && list[0] != null) && list[0].OrganizationCode != null)
                {
                    org = list[0].OrganizationCode;
                }


                ViewBag.Organizations = CommonMethods.ListOrganizations(org);

                ViewBag.Customers         = CommonMethods.ListSupplier(org, list[0].SupplierId.ToString());
                ViewBag.PreferedSuppliers = CommonMethods.ListSupplier(org, list[0].SupplierId.ToString());
                ViewBag.IncomeAccounts    = CommonMethods.ListBanks(org, (list != null && list[0] != null) && list[0].IncomeAccount != null ? list[0].IncomeAccount : "");
                ViewBag.Categories        = CommonMethods.ListCategory((list != null && list[0] != null) && list[0].CategoryId != null ? list[0].CategoryId : "", "0");
                ViewBag.ServiceUnits      = CommonMethods.ListServiceUnit(list[0].Unit.ToString());
                ViewBag.ServiceTypes      = CommonMethods.ListServiceType(list[0].ServiceType.ToString());
                ViewBag.ServiceClasses    = CommonMethods.ListServiceClass(list[0].Class.ToString());

                return(PartialView("~/Views/MasterPages/ProductOrganizationAddEdit.cshtml", list[0]));
            }
        }
Exemplo n.º 18
0
        public ActionResult UploadImageOpen(string type, string ParentId)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                //List<ProductOrganiztionImageInfo> list = iGstSvc.GetList_ProductOrganizationImage("", OrganizationProductId, "", "", "");
                ViewBag.type     = type;
                ViewBag.ParentId = ParentId;
                //if (list != null && list.Count > 0 && list[0].ImageId > 0)
                //{
                return(PartialView("~/Views/MasterPages/UploadImage.cshtml"));
                //}
                //else
                //{
                //    list = new List<ProductOrganiztionImageInfo>();
                //    ProductOrganiztionImageInfo obj = new ProductOrganiztionImageInfo();
                //    obj.FileData = new byte[] { };
                //    obj.FileName = "";
                //    obj.FileType = "";
                //    list.Add(obj);

                //    return PartialView("~/Views/MasterPages/UploadImage.cshtml", list);
                //}
            }
        }
Exemplo n.º 19
0
        public ActionResult UploadFile(string type, bool Overwrite)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                bool bReturn = false;
                var  result  = new { Success = "False", Message = "Error Message" };

                string OrganizationCode = "1";

                if (((UserInfo)Session["UserDetails"]).UserType == "R")
                {
                    OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode;
                }

                try
                {
                    for (int i = 0; i < Request.Files.Count; i++)
                    {
                        System.Data.DataSet ds = GetDataSet_Excel(Request.Files[0], out ErrorMessage);

                        if (ErrorMessage.Trim().Length > 0)
                        {
                            result = new { Success = "False", Message = ErrorMessage };
                            return(Json(result, JsonRequestBehavior.AllowGet));
                        }

                        bool flag = false;

                        if (type == "C")
                        {
                            new Bill_Svc.BillServiceClient().Upload_Customer("C", Overwrite, ds, OrganizationCode, ((UserInfo)Session["UserDetails"]).UserCode, out bReturn, out ErrorMessage);
                            if (ErrorMessage.Trim().Length == 0)
                            {
                                flag = true;
                            }
                        }
                        else if (type == "S")
                        {
                            new Bill_Svc.BillServiceClient().Upload_Customer("S", Overwrite, ds, OrganizationCode, ((UserInfo)Session["UserDetails"]).UserCode, out bReturn, out ErrorMessage);
                            if (ErrorMessage.Trim().Length == 0)
                            {
                                flag = true;
                            }
                        }
                        else if (type == "CA")
                        {
                            flag = new Master_Svc.MasterServiceClient().Upload_Category(Overwrite, ds, ((UserInfo)Session["UserDetails"]).UserCode, out bReturn, out ErrorMessage);
                        }
                        else if (type == "P")
                        {
                            flag = new Product_Svc.ProductServiceClient().Upload_Product(Overwrite, ds, ((UserInfo)Session["UserDetails"]), out bReturn, out ErrorMessage);
                        }
                        else if (type == "BT")
                        {
                            flag = new Master_Svc.MasterServiceClient().Upload_BankTransaction(Overwrite, false, ds, "", OrganizationCode, ((UserInfo)Session["UserDetails"]), out bReturn, out ErrorMessage);
                        }

                        if (ErrorMessage.Trim().Length > 0)
                        {
                            result = new { Success = "False", Message = ErrorMessage };
                            return(Json(result, JsonRequestBehavior.AllowGet));
                        }
                        else if (!flag)
                        {
                            result = new { Success = "False", Message = "No upload activity has been processed." };
                            return(Json(result, JsonRequestBehavior.AllowGet));
                        }
                    }
                }
                catch (Exception ex)
                {
                    result = new { Success = "False", Message = "Error in Uploading file. Please cocntact with the authority" + ex.Message };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }

                result = new { Success = "True", Message = "Data uploaded" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult Save_Role(string isDelete, string isActive, string isOnlyForModerateUsers, string RoleID, string RoleName,
                                      string chk_Customer_View, string chk_Customer_Add, string chk_Customer_Edit, string chk_Customer_Delete, string chk_Customer_Audit,
                                      string chk_Product_View, string chk_Product_Add, string chk_Product_Edit, string chk_Product_Delete, string chk_Product_Audit,
                                      string chk_Organization_View, string chk_Organization_Add, string chk_Organization_Edit, string chk_Organization_Delete, string chk_Organization_Audit,
                                      string chk_Branch_View, string chk_Branch_Add, string chk_Branch_Edit, string chk_Branch_Delete, string chk_Branch_Audit,
                                      string chk_Category_View, string chk_Category_Add, string chk_Category_Edit, string chk_Category_Delete, string chk_Category_Audit,
                                      string chk_Bill_View, string chk_Bill_Add, string chk_Bill_Edit, string chk_Bill_Delete, string chk_Bill_Audit,
                                      string chk_Language_View, string chk_Language_Add, string chk_Language_Edit, string chk_Language_Delete, string chk_Language_Audit,
                                      string chk_DefineLanguage_View, string chk_DefineLanguage_Add, string chk_DefineLanguage_Edit, string chk_DefineLanguage_Delete, string chk_DefineLanguage_Audit,
                                      string chk_StaticValue_View, string chk_StaticValue_Add, string chk_StaticValue_Edit, string chk_StaticValue_Delete, string chk_StaticValue_Audit,
                                      string chk_Terms_View, string chk_Terms_Add, string chk_Terms_Edit, string chk_Terms_Delete, string chk_Terms_Audit,
                                      string chk_UserRegistered_View, string chk_UserRegistered_Add, string chk_UserRegistered_Edit, string chk_UserRegistered_Delete, string chk_UserRegistered_Audit,
                                      string chk_UserModerate_View, string chk_UserModerate_Add, string chk_UserModerate_Edit, string chk_UserModerate_Delete, string chk_UserModerate_Audit,
                                      string chk_Role_View, string chk_Role_Add, string chk_Role_Edit, string chk_Role_Delete, string chk_Role_Audit,
                                      string chk_Function_View, string chk_Function_Add, string chk_Function_Edit, string chk_Function_Delete, string chk_Function_Audit,
                                      object objUserInfo)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                RoleInfo objRoleInfo = new RoleInfo();

                objRoleInfo.RoleID   = RoleID;
                objRoleInfo.RoleName = RoleName;
                objRoleInfo.IsActive = isActive == "Y";
                objRoleInfo.IsOnlyForModerateUsers = isOnlyForModerateUsers == "Y";

                objRoleInfo.Customer_View   = chk_Customer_View == "Y";
                objRoleInfo.Customer_Add    = chk_Customer_Add == "Y";
                objRoleInfo.Customer_Edit   = chk_Customer_Edit == "Y";
                objRoleInfo.Customer_Delete = chk_Customer_Delete == "Y";
                objRoleInfo.Customer_Audit  = chk_Customer_Audit == "Y";

                objRoleInfo.Product_View   = chk_Product_View == "Y";
                objRoleInfo.Product_Add    = chk_Product_Add == "Y";
                objRoleInfo.Product_Edit   = chk_Product_Edit == "Y";
                objRoleInfo.Product_Delete = chk_Product_Delete == "Y";
                objRoleInfo.Product_Audit  = chk_Product_Audit == "Y";

                objRoleInfo.Organization_View   = chk_Organization_View == "Y";
                objRoleInfo.Organization_Add    = chk_Organization_Add == "Y";
                objRoleInfo.Organization_Edit   = chk_Organization_Edit == "Y";
                objRoleInfo.Organization_Delete = chk_Organization_Delete == "Y";
                objRoleInfo.Organization_Audit  = chk_Organization_Audit == "Y";

                objRoleInfo.Branch_View   = chk_Branch_View == "Y";
                objRoleInfo.Branch_Add    = chk_Branch_Add == "Y";
                objRoleInfo.Branch_Edit   = chk_Branch_Edit == "Y";
                objRoleInfo.Branch_Delete = chk_Branch_Delete == "Y";
                objRoleInfo.Branch_Audit  = chk_Branch_Audit == "Y";

                objRoleInfo.Role_View   = chk_Role_View == "Y";
                objRoleInfo.Role_Add    = chk_Role_Add == "Y";
                objRoleInfo.Role_Edit   = chk_Role_Edit == "Y";
                objRoleInfo.Role_Delete = chk_Role_Delete == "Y";
                objRoleInfo.Role_Audit  = chk_Role_Audit == "Y";

                objRoleInfo.Function_View   = chk_Function_View == "Y";
                objRoleInfo.Function_Add    = chk_Function_Add == "Y";
                objRoleInfo.Function_Edit   = chk_Function_Edit == "Y";
                objRoleInfo.Function_Delete = chk_Function_Delete == "Y";
                objRoleInfo.Function_Audit  = chk_Function_Audit == "Y";

                objRoleInfo.Category_View   = chk_Category_View == "Y";
                objRoleInfo.Category_Add    = chk_Category_Add == "Y";
                objRoleInfo.Category_Edit   = chk_Category_Edit == "Y";
                objRoleInfo.Category_Delete = chk_Category_Delete == "Y";
                objRoleInfo.Category_Audit  = chk_Category_Audit == "Y";

                objRoleInfo.Bill_View   = chk_Bill_View == "Y";
                objRoleInfo.Bill_Add    = chk_Bill_Add == "Y";
                objRoleInfo.Bill_Edit   = chk_Bill_Edit == "Y";
                objRoleInfo.Bill_Delete = chk_Bill_Delete == "Y";
                objRoleInfo.Bill_Audit  = chk_Bill_Audit == "Y";

                objRoleInfo.Language_View   = chk_Language_View == "Y";
                objRoleInfo.Language_Add    = chk_Language_Add == "Y";
                objRoleInfo.Language_Edit   = chk_Language_Edit == "Y";
                objRoleInfo.Language_Delete = chk_Language_Delete == "Y";
                objRoleInfo.Language_Audit  = chk_Language_Audit == "Y";

                objRoleInfo.DefineLanguage_View   = chk_DefineLanguage_View == "Y";
                objRoleInfo.DefineLanguage_Add    = chk_DefineLanguage_Add == "Y";
                objRoleInfo.DefineLanguage_Edit   = chk_DefineLanguage_Edit == "Y";
                objRoleInfo.DefineLanguage_Delete = chk_DefineLanguage_Delete == "Y";
                objRoleInfo.DefineLanguage_Audit  = chk_DefineLanguage_Audit == "Y";

                objRoleInfo.StaticValue_View   = chk_StaticValue_View == "Y";
                objRoleInfo.StaticValue_Add    = chk_StaticValue_Add == "Y";
                objRoleInfo.StaticValue_Edit   = chk_StaticValue_Edit == "Y";
                objRoleInfo.StaticValue_Delete = chk_StaticValue_Delete == "Y";
                objRoleInfo.StaticValue_Audit  = chk_StaticValue_Audit == "Y";

                objRoleInfo.Terms_View   = chk_Terms_View == "Y";
                objRoleInfo.Terms_Add    = chk_Terms_Add == "Y";
                objRoleInfo.Terms_Edit   = chk_Terms_Edit == "Y";
                objRoleInfo.Terms_Delete = chk_Terms_Delete == "Y";
                objRoleInfo.Terms_Audit  = chk_Terms_Audit == "Y";

                objRoleInfo.UserRegistered_View   = chk_UserRegistered_View == "Y";
                objRoleInfo.UserRegistered_Add    = chk_UserRegistered_Add == "Y";
                objRoleInfo.UserRegistered_Edit   = chk_UserRegistered_Edit == "Y";
                objRoleInfo.UserRegistered_Delete = chk_UserRegistered_Delete == "Y";
                objRoleInfo.UserRegistered_Audit  = chk_UserRegistered_Audit == "Y";

                objRoleInfo.UserModerate_View   = chk_UserModerate_View == "Y";
                objRoleInfo.UserModerate_Add    = chk_UserModerate_Add == "Y";
                objRoleInfo.UserModerate_Edit   = chk_UserModerate_Edit == "Y";
                objRoleInfo.UserModerate_Delete = chk_UserModerate_Delete == "Y";
                objRoleInfo.UserModerate_Audit  = chk_UserModerate_Audit == "Y";

                if (iGstSvc.Save_Role(isDelete == "Y", objRoleInfo, (UserInfo)Session["UserDetails"], out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetList_ProductForDropdownlist()
        {
            if (Session["ProductList"] != null && ((List <ProductInfo>)Session["ProductList"]).Count > 0)
            {
                return(Json((List <ProductInfo>)Session["ProductList"], JsonRequestBehavior.AllowGet));
            }
            else
            {
                using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
                {
                    if (Session["Language"] == null)
                    {
                        Session["Language"] = 0;
                    }

                    if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
                    {
                        string OrganizationCode = "";
                        OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();

                        List <ProductInfo> list = new Product_Svc.ProductServiceClient().GetList_ProductDropdownlist("", "", false, OrganizationCode, "", false, Session["Language"].ToString());

                        if (list != null && list.Count > 0)
                        {
                            Session["ProductList"] = list;
                            return(Json(list, JsonRequestBehavior.AllowGet));
                        }
                        else
                        {
                            //return Json(new HttpStatusCodeResult(410, "You have to select your products from Product/ service page."), JsonRequestBehavior.AllowGet);
                            return(new HttpStatusCodeResult(410, "You have to select your products from Product/ service page."));
                        }
                    }
                    else if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "M")
                    {
                        List <ProductInfo> list = new Product_Svc.ProductServiceClient().GetList_ProductDropdownlist("", "", false, "", "", false, Session["Language"].ToString());

                        if (list != null && list.Count > 0)
                        {
                            Session["ProductList"] = list;
                            return(Json(list, JsonRequestBehavior.AllowGet));
                        }
                        else
                        {
                            //return Json(new HttpStatusCodeResult(410, "There some problem arrised in product listing."), JsonRequestBehavior.AllowGet);
                            return(new HttpStatusCodeResult(410, "There some problem arrised in product listing."));
                        }
                    }
                    else
                    {
                        List <ProductInfo> list = new Product_Svc.ProductServiceClient().GetList_ProductDropdownlist("", "", false, "", "", false, Session["Language"].ToString());

                        if (list != null && list.Count > 0)
                        {
                            Session["ProductList"] = list;
                            return(Json(list, JsonRequestBehavior.AllowGet));
                        }
                        else
                        {
                            return(Json(new HttpStatusCodeResult(410, "There some problem arrised in product listing."), JsonRequestBehavior.AllowGet));
                        }
                    }
                }
            }
        }
Exemplo n.º 22
0
        public System.Data.DataSet GetDataSet_Excel(HttpPostedFileBase file, out string ErrorMessage)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                System.Data.DataSet ds = null;
                ErrorMessage = "";

                try
                {
                    System.Data.OleDb.OleDbConnection  conn = null;
                    System.Data.OleDb.OleDbCommand     cmd = null;
                    System.Data.OleDb.OleDbDataAdapter da = null;
                    string TableName = "", ConnectionString = "";

                    var fileName = System.IO.Path.GetFileName(file.FileName);
                    var path = System.IO.Path.Combine(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["UploadDataPath"].ToString()), fileName);

                    switch (System.IO.Path.GetExtension(path).Trim().ToUpper())
                    {
                    case ".XLS":
                        ConnectionString = string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel03ConnStr"].ConnectionString, path);
                        break;

                    case ".XLSX":
                        ConnectionString = string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel07ConnStr"].ConnectionString, path);
                        break;

                    default:
                        ErrorMessage = "Please select a valid excel file";
                        break;
                    }

                    if (ErrorMessage.Trim().Length == 0)
                    {
                        try
                        {
                            try
                            {
                                file.SaveAs(path);
                            }
                            catch (Exception ex)
                            {
                                Common.ErrorLog.LogErrors_Comments(ex.Message, "Master Page Controller", "Excel upload - Saveas", "Error");
                                ErrorMessage = "Problem in saving file:" + ex.Message;
                                return(null);
                            }

                            try
                            {
                                conn = new System.Data.OleDb.OleDbConnection(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel15ConnStr"].ConnectionString, path));
                                conn.Open();
                            }
                            catch
                            {
                                try
                                {
                                    conn = new System.Data.OleDb.OleDbConnection(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel14ConnStr"].ConnectionString, path));
                                    conn.Open();
                                }
                                catch
                                {
                                    try
                                    {
                                        conn = new System.Data.OleDb.OleDbConnection(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel13ConnStr"].ConnectionString, path));
                                        conn.Open();
                                    }
                                    catch
                                    {
                                        try
                                        {
                                            conn = new System.Data.OleDb.OleDbConnection(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel07ConnStr"].ConnectionString, path));
                                            conn.Open();
                                        }
                                        catch
                                        {
                                            try
                                            {
                                                conn = new System.Data.OleDb.OleDbConnection(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["Excel03ConnStr"].ConnectionString, path));
                                                conn.Open();
                                            }
                                            catch (Exception ex)
                                            {
                                                Common.ErrorLog.LogErrors_Comments(ex.Message, "Master Page Controller", "Excel upload - Connection", "Error");
                                                ErrorMessage = "Problem in saving file:" + ex.Message;
                                                return(null);
                                            }
                                        }
                                    }
                                }
                            }

                            try
                            {
                                TableName = conn.GetSchema("Tables").Rows[0]["TABLE_NAME"].ToString();
                                cmd       = new System.Data.OleDb.OleDbCommand(@"SELECT * FROM [" + TableName + "]", conn);

                                da = new System.Data.OleDb.OleDbDataAdapter(cmd);
                                ds = new System.Data.DataSet();
                                da.Fill(ds);
                                da.Dispose();
                                cmd.Dispose();
                                conn.Dispose();
                                return(ds);
                            }
                            catch (Exception ex)
                            {
                                Common.ErrorLog.LogErrors_Comments(ex.Message, "Master Page Controller", "Excel upload - GetDataSet", "Error");
                                ErrorMessage = "Inner Problem in reading file";
                                return(null);
                            }
                        }
                        catch (Exception ex)
                        {
                            Common.ErrorLog.LogErrors_Comments(ex.Message, "Master Page Controller", "Excel upload - GetDataSet", "Error");
                            ErrorMessage = "Problem in reading file";
                            return(null);
                        }
                    }

                    if (System.IO.File.Exists(path))
                    {
                        System.IO.File.Delete(path);
                    }
                }
                catch (Exception ex)
                {
                    ErrorMessage = "Problem in reading file" + ex.Message;
                    return(null);
                }

                return(null);
            }
        }