public ActionResult GetDetails(string Email) { OfflinePaymentModel model = new OfflinePaymentModel(); long UserId = BLayer.User.GetUserId(Email); if (UserId > 0) { CLayer.Address byAddress = BLayer.Address.GetAddressOnUserId(UserId); CLayer.Address adrs = BLayer.Address.GetPrimaryOnUser(UserId); if (byAddress != null && adrs != null) { model.Name = byAddress.Firstname; model.Email = byAddress.Email; model.Mobile = adrs.Mobile; model.CityId = adrs.CityId; model.State = adrs.State; model.CountryId = adrs.CountryId; model.ZipCode = adrs.ZipCode; model.Address = adrs.AddressText; model.LoadPlaces(); return(View("_Details", model)); } else { return(View("_Details", model)); } } else { return(View("_Details", model)); } }
public int InsertChequeDetails(OfflinePaymentModel offlinePaymentModel) { DataSet ds = new DataSet(); int result = 0; try { conn = Db.Connection; MySqlCommand cmd = new MySqlCommand("SP_InsertChequeDetails", conn); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ChequeNumber", offlinePaymentModel.ChequeNumber); cmd.Parameters.AddWithValue("@ChequeAmount", offlinePaymentModel.ChequeAmount); cmd.Parameters.AddWithValue("@ChequeDate", offlinePaymentModel.ChequeDate); cmd.Parameters.AddWithValue("@FromCompanyName", offlinePaymentModel.FromCompanyName); cmd.Parameters.AddWithValue("@PaidToname", offlinePaymentModel.PaidToname); cmd.Parameters.AddWithValue("@TenantID", offlinePaymentModel.TenantID); cmd.Parameters.AddWithValue("@PaymentModeID", offlinePaymentModel.PaymentModeID); result = Convert.ToInt32(cmd.ExecuteNonQuery()); } catch (Exception ex) { throw ex; } return(result); }
public ActionResult Index() { long UserId = GetUserId(); CLayer.Address byAddress = BLayer.Address.GetAddressOnUserId(UserId); CLayer.Address adrs = BLayer.Address.GetPrimaryOnUser(UserId); OfflinePaymentModel model = new OfflinePaymentModel(); if (byAddress != null && adrs != null) { model.Name = byAddress.Firstname; model.Email = byAddress.Email; model.Mobile = adrs.Mobile; model.CityId = adrs.CityId; model.City = adrs.City; model.State = adrs.State; model.CountryId = adrs.CountryId; model.ZipCode = adrs.ZipCode; model.Address = adrs.AddressText; if (model.State > 0) { List <CLayer.City> cities = null; cities = BLayer.City.GetOnState(model.State); cities.Add(new CLayer.City() { CityId = -1, Name = "Other" }); model.CityList = new SelectList(cities, "CityId", "Name"); } model.LoadPlaces(); return(View(model)); } else { return(View(model)); } }
public ResponseModel InsertChequeDetails([FromBody] OfflinePaymentModel offlinePaymentModel) { PaymentCaller newPaymentCaller = new PaymentCaller(); ResponseModel objResponseModel = new ResponseModel(); int statusCode = 0; string statusMessage = ""; try { ////Get token (Double encrypted) and get the tenant id string token = Convert.ToString(Request.Headers["X-Authorized-Token"]); Authenticate authenticate = new Authenticate(); //authenticate.TenantId = 0; authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token)); offlinePaymentModel.CreatedBy = authenticate.UserMasterID; offlinePaymentModel.TenantID = authenticate.TenantId; int result = newPaymentCaller.InsertChequeDetails(new PaymentService(Cache, Db), offlinePaymentModel); statusCode = result == 0 ? (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success; statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode); objResponseModel.Status = true; objResponseModel.StatusCode = statusCode; objResponseModel.Message = statusMessage; objResponseModel.ResponseData = result; } catch (Exception) { throw; } return(objResponseModel); }
public int InsertChequeDetails(IPayment _payment, OfflinePaymentModel offlinePaymentModel) { _PaymentList = _payment; return(_PaymentList.InsertChequeDetails(offlinePaymentModel)); }