public List <CLayer.Tax> GetAmadeusTaxRates(long bookingId, int InventoryAPIType) { List <CLayer.Tax> taxrates = BLayer.Tax.GetAllTypeTaxRate(bookingId); List <CLayer.Rates> AmadeusRates = (List <CLayer.Rates>)Session["AmadeusRates"]; TempData.Keep("AmadeusRates"); List <CLayer.Tax> Amadeustaxrates = new List <CLayer.Tax>(); if (InventoryAPIType == (int)CLayer.ObjectStatus.InventoryAPIType.Amadeus) { foreach (var item in AmadeusRates) { CLayer.Tax objTax = new CLayer.Tax(); if (item.IsCustStateEqualtoBillingEntity) { // objTax.Title = "CGST"; objTax.TotalCGSTTaxAmount = Math.Round(item.CGSTTax, 2, MidpointRounding.AwayFromZero); objTax.TotalSGSTTaxAmount = Math.Round(item.SGSTTax, 2, MidpointRounding.AwayFromZero); objTax.CGSTTitle = "CGST"; objTax.SGSTTitle = "SGST"; } else { objTax.TotalIGSTTaxAmount = Math.Round(item.IGSTTax, 2, MidpointRounding.AwayFromZero); objTax.IGSTTitle = "IGST"; } Amadeustaxrates.Add(objTax); } } return(Amadeustaxrates); }
public void AddAmadeusTaxRates(CLayer.Tax data) { try { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pTaxId", DataPlug.DataType._BigInt, data.TaxId)); param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, data.PropertyId)); param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, data.AccommodationId)); param.Add(Connection.GetParameter("pBookingID", DataPlug.DataType._BigInt, data.BookingId)); param.Add(Connection.GetParameter("pTaxRate", DataPlug.DataType._Double, data.TaxRate)); param.Add(Connection.GetParameter("pTaxAmount", DataPlug.DataType._BigInt, data.PropertyId)); param.Add(Connection.GetParameter("pTotalCGSTTaxAmount", DataPlug.DataType._Decimal, data.TotalCGSTTaxAmount)); param.Add(Connection.GetParameter("pTotalSGSTTaxAmount", DataPlug.DataType._Decimal, data.TotalSGSTTaxAmount)); param.Add(Connection.GetParameter("pTotalIGSTTaxAmount", DataPlug.DataType._Decimal, data.TotalIGSTTaxAmount)); param.Add(Connection.GetParameter("pCGSTTitle", DataPlug.DataType._Varchar, data.CGSTTitle)); param.Add(Connection.GetParameter("pSGSTTitle", DataPlug.DataType._Varchar, data.SGSTTitle)); param.Add(Connection.GetParameter("pIGSTTitle", DataPlug.DataType._Varchar, data.IGSTTitle)); param.Add(Connection.GetParameter("pBookingCode", DataPlug.DataType._Varchar, data.BookingCode)); param.Add(Connection.GetParameter("pCGSTTaxRate", DataPlug.DataType._Double, data.CGSTTaxRate)); param.Add(Connection.GetParameter("pSGSTTaxRate", DataPlug.DataType._Double, data.SGSTTaxRate)); param.Add(Connection.GetParameter("pIGSTTaxRate", DataPlug.DataType._Double, data.IGSTTaxRate)); param.Add(Connection.GetParameter("pBookingType", DataPlug.DataType._Double, data.BookingType)); Connection.ExecuteQuery("amadeustaxrates_save", param); } catch (Exception ex) { throw ex; } }
public int Save(CLayer.Tax data) { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pTaxId", DataPlug.DataType._Int, data.TaxId)); param.Add(Connection.GetParameter("pTaxTitleId", DataPlug.DataType._Int, data.TaxTitleId)); param.Add(Connection.GetParameter("pRate", DataPlug.DataType._Decimal, data.Rate)); param.Add(Connection.GetParameter("pCountryId", DataPlug.DataType._Int, data.CountryId)); param.Add(Connection.GetParameter("pStateId", DataPlug.DataType._Int, data.StateId)); param.Add(Connection.GetParameter("pCityId", DataPlug.DataType._Int, data.CityId)); param.Add(Connection.GetParameter("pNotes", DataPlug.DataType._Varchar, data.Notes)); param.Add(Connection.GetParameter("pStatus", DataPlug.DataType._Int, data.Status)); param.Add(Connection.GetParameter("pStartDate", DataPlug.DataType._DateTime, data.StartDate)); param.Add(Connection.GetParameter("pEndDate", DataPlug.DataType._DateTime, data.EndDate)); param.Add(Connection.GetParameter("pOnDate", DataPlug.DataType._Int, data.OnDate)); param.Add(Connection.GetParameter("pOnTotalAmount", DataPlug.DataType._Bool, data.OnTotalAmount)); param.Add(Connection.GetParameter("pPriceUpto", DataPlug.DataType._Decimal, data.PriceUpto)); param.Add(Connection.GetParameter("pUpdatedBy", DataPlug.DataType._BigInt, data.UpdatedBy)); param.Add(Connection.GetParameter("pUpdatedDate", DataPlug.DataType._DateTime, data.UpdatedDate)); param.Add(Connection.GetParameter("pUnlimitedPrice", DataPlug.DataType._Bool, data.Unlimited)); object result = Connection.ExecuteQueryScalar("tax_Save", param); return(Connection.ToInteger(result)); }
public int SaveTax(CLayer.Tax data) { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pTaxTitleId", DataPlug.DataType._Int, data.TaxTitleId)); param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._Decimal, data.PropertyId)); param.Add(Connection.GetParameter("pRate", DataPlug.DataType._Decimal, data.Rate)); param.Add(Connection.GetParameter("pUpdatedBy", DataPlug.DataType._BigInt, data.UpdatedBy)); param.Add(Connection.GetParameter("pUpdatedDate", DataPlug.DataType._DateTime, data.UpdatedDate)); object result = Connection.ExecuteQueryScalar("taxproperty_Save", param); return(Connection.ToInteger(result)); }
public List <CLayer.Tax> GetAmadeusTaxRates(long PropertyID) { List <CLayer.Tax> result = new List <CLayer.Tax>(); try { string sql = "Select * From amadeustaxrates Where PropertyID=" + PropertyID + ""; DataTable dt = Connection.GetSQLTable(sql); CLayer.Tax temp; foreach (DataRow dr in dt.Rows) { temp = new CLayer.Tax(); temp.TaxId = Connection.ToInteger(dr["TaxId"]); temp.PropertyId = Connection.ToLong(dr["PropertyID"]); temp.BookingCode = Connection.ToString(dr["BookingCode"]); temp.BookingId = Connection.ToLong(dr["BookingId"]); temp.CGSTTitle = Connection.ToString(dr["CGSTTitle"]); temp.SGSTTitle = Connection.ToString(dr["SGSTTitle"]); temp.IGSTTitle = Connection.ToString(dr["IGSTTitle"]); temp.TotalCGSTTaxAmount = Connection.ToDecimal(dr["TotalCGSTTaxAmount"]); temp.TotalSGSTTaxAmount = Connection.ToDecimal(dr["TotalSGSTTaxAmount"]); temp.TotalIGSTTaxAmount = Connection.ToDecimal(dr["TotalIGSTTaxAmount"]); temp.AccommodationId = Connection.ToLong(dr["AccommodationId"]); temp.TaxRate = Connection.ToDouble(dr["TaxRate"]); temp.CGSTTaxRate = Connection.ToDouble(dr["CGSTTaxRate"]); temp.SGSTTaxRate = Connection.ToDouble(dr["SGSTTaxRate"]); temp.IGSTTaxRate = Connection.ToDouble(dr["IGSTTaxRate"]); temp.CGSTTaxRate = (temp.CGSTTaxRate <= 0) ? Convert.ToDouble(GetValue(CLayer.Settings.CGST_TAXRATE)) : temp.CGSTTaxRate; temp.SGSTTaxRate = (temp.SGSTTaxRate <= 0) ? Convert.ToDouble(GetValue(CLayer.Settings.SGST_TAXRATE)) : temp.SGSTTaxRate; temp.IGSTTaxRate = (temp.IGSTTaxRate <= 0) ? Convert.ToDouble(GetValue(CLayer.Settings.IGST_TAXRATE)) : temp.IGSTTaxRate; result.Add(temp); } } catch (Exception ex) { result = null; throw ex; } return(result); }
public ActionResult Edit(int id) { try { ViewBag.Saved = false; Models.TaxModel mbt = new Models.TaxModel() { TaxId = 0, TaxTitleId = 0 }; CLayer.Tax pt = BLayer.Tax.Get(id); if (pt != null) { mbt = new Models.TaxModel(pt.CountryId.Value, ((pt.StateId.Value > 0) ? pt.StateId.Value : -1), ((pt.CityId.Value > 0) ? pt.CityId.Value : -1)) // ,, { TaxId = pt.TaxId, Title = pt.Title, TaxTitleId = pt.TaxTitleId, Rate = pt.Rate, CountryId = pt.CountryId, StateId = pt.StateId, CityId = pt.CityId, Notes = pt.Notes, Status = pt.Status, StartDate = pt.StartDate.ToShortDateString(), EndDate = pt.EndDate.ToShortDateString(), OnDate = pt.OnDate, OnTotalAmount = pt.OnTotalAmount, PriceUpto = pt.PriceUpto, UpdatedDate = pt.UpdatedDate, Unlimited = pt.Unlimited } } ; return(PartialView("~/Areas/Admin/Views/Tax/_Edit.cshtml", mbt)); } catch (Exception ex) { Common.LogHandler.HandleError(ex); return(Redirect("~/Admin/ErrorPage")); } }
public List <CLayer.Tax> GetAllTypeTaxRate(long BookingId) { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); List <CLayer.Tax> result = new List <CLayer.Tax>(); param.Add(Connection.GetParameter("pBookingId", DataPlug.DataType._BigInt, BookingId)); DataTable dt = Connection.GetTable("ratesbooking_GetAllTypeTaxRate", param); CLayer.Tax rt1; foreach (DataRow dr in dt.Rows) { rt1 = new CLayer.Tax(); rt1.TaxTitleId = Connection.ToInteger(dr["TaxTitleId"]); rt1.Title = Connection.ToString(dr["TaxTitleName"]); rt1.BookingId = BookingId; rt1.Rate = Connection.ToDecimal(dr["Rate"]); rt1.TotalTaxAmount = Connection.ToDecimal(dr["Amount"]); result.Add(rt1); } return(result); }
public CLayer.Tax Get(int taxId) { CLayer.Tax result = null; List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pTaxId", DataPlug.DataType._Int, taxId)); DataTable dt = Connection.GetTable("tax_Get", param); if (dt.Rows.Count > 0) { result = new CLayer.Tax() { TaxId = Connection.ToInteger(dt.Rows[0]["TaxId"]), Title = Connection.ToString(dt.Rows[0]["Title"]), TaxTitleId = Connection.ToInteger(dt.Rows[0]["TaxTitleId"]), Rate = Connection.ToDecimal(dt.Rows[0]["Rate"]), CountryId = Connection.ToInteger(dt.Rows[0]["CountryId"]), Country = Connection.ToString(dt.Rows[0]["CountryName"]), StateId = Connection.ToInteger(dt.Rows[0]["StateId"]), State = Connection.ToString(dt.Rows[0]["StateName"]), CityId = Connection.ToInteger(dt.Rows[0]["CityId"]), City = Connection.ToString(dt.Rows[0]["CityName"]), Notes = Connection.ToString(dt.Rows[0]["Notes"]), Status = Connection.ToInteger(dt.Rows[0]["Status"]), StartDate = Connection.ToDate(dt.Rows[0]["StartDate"]), EndDate = Connection.ToDate(dt.Rows[0]["EndDate"]), OnDate = Connection.ToInteger(dt.Rows[0]["OnDate"]), OnTotalAmount = Connection.ToBoolean(dt.Rows[0]["OnTotalAmount"]), PriceUpto = Connection.ToDecimal(dt.Rows[0]["PriceUpto"]), UpdatedBy = Connection.ToLong(dt.Rows[0]["UpdatedBy"]), UpdatedDate = Connection.ToDate(dt.Rows[0]["UpdatedDate"]), Unlimited = Connection.ToBoolean(dt.Rows[0]["UnlimitedPrice"]) }; } return(result); }
public static void AddAmadeusTaxRates(CLayer.Tax data) { DataLayer.Tax task = new DataLayer.Tax(); task.AddAmadeusTaxRates(data); }
public static int SaveTax(CLayer.Tax data) { DataLayer.Tax task = new DataLayer.Tax(); return(task.SaveTax(data)); }
public ActionResult Edit(Models.TaxModel data) { try { string Userid = User.Identity.GetUserId(); long id = 0; long.TryParse(Userid, out id); DateTime StartDate = DateTime.Today; DateTime.TryParse(data.StartDate, out StartDate); DateTime EndDate = DateTime.Today; DateTime.TryParse(data.EndDate, out EndDate); if (data.Unlimited == true) { data.PriceUpto = 0; } if (data.CountryId == -1) { data.CountryId = null; } if (data.StateId == -1) { data.StateId = null; } if (data.CityId == -1) { data.CityId = null; } CLayer.Tax pt = new CLayer.Tax() { TaxId = data.TaxId, TaxTitleId = TitleId, Rate = data.Rate, CountryId = data.CountryId, StateId = data.StateId, CityId = data.CityId, Notes = data.Notes, Status = data.Status, StartDate = StartDate, EndDate = EndDate, OnDate = data.OnDate, OnTotalAmount = data.OnTotalAmount, PriceUpto = data.PriceUpto, UpdatedBy = id, UpdatedDate = DateTime.Now, Unlimited = data.Unlimited }; if (data.StateId > 0) { pt.StateId = data.StateId; } if (data.StateId == 0) { pt.StateId = null; } BLayer.Tax.Save(pt); ViewBag.Saved = true; return(RedirectToAction("Index", new { id = TitleId })); } catch (Exception ex) { Common.LogHandler.HandleError(ex); return(Redirect("~/Admin/ErrorPage")); } }