public ActionResult Save_CurrencyOrganization(string isOnlyDelete, string OrganizationproductId, string CurrencyId, 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 (Currency_Svc.CurrencyServiceClient iGstSvc = new Currency_Svc.CurrencyServiceClient())
            {
                // Modified on [3rd August 2019] by [Partha] cause [Giving NULL reference exception
                // when Organisation Code is null] - Start
                if (OrganizationproductId == null)
                {
                    OrganizationproductId = "";
                }
                // End: Modified on [3rd August 2019]
                CurrencyOrganiztionInfo objProduct = new CurrencyOrganiztionInfo();
                objProduct.OrganizationproductId = OrganizationproductId.Trim().Length == 0 ? 0 : Convert.ToInt32(OrganizationproductId.Trim());
                objProduct.OrganizationCode      = OrganizationCode;
                objProduct.CurrencyId            = CurrencyId;

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

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public static string ListApplicableCurrencies(string SelectedCurrency)
        {
            List <CurrencyOrganiztionInfo> Currencies = null;

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

            try
            {
                string OrganizationCode = "";
                if (System.Web.HttpContext.Current.Session["UserDetails"] != null && ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode != null)
                {
                    OrganizationCode = ((UserInfo)System.Web.HttpContext.Current.Session["UserDetails"]).OrganizationCode.Trim();
                }

                if (System.Web.HttpContext.Current.Session["Currencies"] == null)
                {
                    Currencies = new Currency_Svc.CurrencyServiceClient().GetDetails_BUCurrencies("", "", OrganizationCode);
                    System.Web.HttpContext.Current.Session["Currencies"] = Currencies;
                }
                else
                {
                    Currencies = (List <CurrencyOrganiztionInfo>)System.Web.HttpContext.Current.Session["Currencies"];
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrors_Comments(ex.Message + ex.InnerException + ex.StackTrace, "Controler", "Organization ist", "");
                Currencies = new List <CurrencyOrganiztionInfo>();
            }

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

            if (Currencies != null && Currencies.Count > 0)
            {
                foreach (CurrencyOrganiztionInfo obj in Currencies)
                {
                    if (!string.IsNullOrEmpty(SelectedCurrency) && obj.CurrencyId.Trim() == SelectedCurrency.Trim())
                    {
                        sbCurrencies.AppendLine("<option value=\"" + obj.CurrencyId + "\" selected=\"selected\">" + obj.CurrencyName + "</option>");
                    }
                    else
                    {
                        sbCurrencies.AppendLine("<option value=\"" + obj.CurrencyId + "\">" + obj.CurrencyName + "</option>");
                    }
                }
            }

            return(sbCurrencies.ToString());
        }
        public ActionResult GetDetails_CurrencyOrganization()
        {
            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();
            }

            ViewBag.Organizations = CommonMethods.ListOrganizations(OrganizationCode);

            using (Currency_Svc.CurrencyServiceClient iGstSvc = new Currency_Svc.CurrencyServiceClient())
            {
                return(View("~/Views/MasterPages/SettingsApplicableCurrency.cshtml", iGstSvc.GetDetails_CurrencyOrganization("", "", OrganizationCode)));
            }
        }