예제 #1
0
        public static bool Save_TaxCountryMap(bool isOnlyDelete, TaxCountryMapInfo objBankInfo, UserInfo objUserInfo, out string errormsg)
        {
            errormsg = "";

            #region Validations
            if (!Validations.ValidateDataType(objBankInfo.TaxDefinationID, Validations.ValueType.Integer, true, "Tax", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(objBankInfo.CountryId, Validations.ValueType.Integer, false, "Country", out errormsg))
            {
                return(false);
            }
            if (!Validations.ValidateDataType(objBankInfo.ApplicableType, Validations.ValueType.AlphaNumericSpecialChar, false, "Applicable Type", out errormsg))
            {
                return(false);
            }
            #endregion

            using (DBHelper dbhlper = new DBHelper("[spTaxMapCountrySave]", true))
            {
                DBHelper.AddPparameter("@TaxDefinationID", objBankInfo.TaxDefinationID.Trim().Length > 0 ? Convert.ToInt32(objBankInfo.TaxDefinationID) : 0, DBHelper.param_types.Int);
                DBHelper.AddPparameter("@CountryId", objBankInfo.CountryId, DBHelper.param_types.BigInt);
                DBHelper.AddPparameter("@ApplicableType", objBankInfo.ApplicableType, DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@UserCode", objUserInfo.UserCode.ToString().Trim(), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@isOnlyDelete", (isOnlyDelete ? 'Y' : 'N'), DBHelper.param_types.Varchar);
                DBHelper.AddPparameter("@NewDatauniqueID", 0, DBHelper.param_types.BigInt, 50, DBHelper.param_direction.Output);
                DBHelper.AddPparameter("@ErrorMessage", errormsg, DBHelper.param_types.Varchar, 500, DBHelper.param_direction.Output);

                return(DBHelper.Execute_NonQuery(out errormsg));
            }
        }
예제 #2
0
        public static List <TaxCountryMapInfo> GetList_TaxCountryMap(int mode, string TaxDefinationID, string CountryId)
        {
            using (DBHelper dbhlper = new DBHelper("spTaxMapCountryGet"))
            {
                DBHelper.AddPparameter("@Mode", mode);
                DBHelper.AddPparameter("@TaxDefinationID", TaxDefinationID);
                DBHelper.AddPparameter("@CountryId", CountryId);

                using (DataSet ds = DBHelper.Execute_Query())
                {
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        List <TaxCountryMapInfo> list = new List <TaxCountryMapInfo>();
                        TaxCountryMapInfo        obj  = null;

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            obj = new TaxCountryMapInfo();
                            obj.TaxDefinationID = dr["TaxDefinationID"].ToString();
                            obj.TaxName         = dr["TaxName"].ToString();
                            obj.CountryId       = dr["CountryId"].ToString();
                            obj.CountryName     = dr["CountryName"].ToString();
                            obj.ApplicableType  = dr["ApplicableType"].ToString();
                            obj.IsExist         = dr["IsExist"].ToString().Trim() == "Y";

                            list.Add(obj);
                        }

                        return(list);
                    }
                }
            }

            return(null);
        }
        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 Save_TaxCountryMap(string isOnlyDelete, string TaxDefinationID, string CountryId, string ApplicableType)
        {
            using (iGst_Svc.GSTServiceClient iGstSvc = new iGst_Svc.GSTServiceClient())
            {
                TaxCountryMapInfo objBank = new TaxCountryMapInfo();

                objBank.TaxDefinationID = TaxDefinationID;
                objBank.CountryId       = CountryId;
                objBank.ApplicableType  = ApplicableType;

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

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public static TaxCountryMapInfo GetDetails_TaxCountryMap(int mode, string TaxDefinationID, string CountryId)
        {
            if (!string.IsNullOrEmpty(TaxDefinationID) && !string.IsNullOrEmpty(CountryId))
            {
                List <TaxCountryMapInfo> list = GetList_TaxCountryMap(mode, TaxDefinationID, CountryId);

                if (list != null && list.Count() > 0)
                {
                    return(list[0]);
                }
            }

            TaxCountryMapInfo obj = new TaxCountryMapInfo();

            obj.TaxDefinationID = "0";
            obj.CountryId       = "0";
            obj.CountryName     = "";
            obj.TaxName         = "";

            return(obj);
        }
예제 #6
0
 public bool Save_TaxCountryMap(bool isOnlyDelete, TaxCountryMapInfo objBankInfo, UserInfo objUserInfo, out string errormsg)
 {
     return(wscalls.Save_TaxCountryMap(isOnlyDelete, objBankInfo, objUserInfo, out errormsg));
 }