public Printer() { dataAccess = DataAccess.DataAccess.Instance; titleFont = new Font("Calibri", 16, FontStyle.Bold, GraphicsUnit.Point); normalFont = new Font("Calibri", 14, FontStyle.Regular, GraphicsUnit.Point); boldFont = new Font("Calibri", 14, FontStyle.Bold, GraphicsUnit.Point); }
public void GetStateByStateNameTest() { DataAccess.DataAccess dl = new DataAccess.DataAccess(); var result = dl.GetStateByStateName("Michigan"); Assert.That(result.state_cd, Is.EqualTo("MI")); }
public ApplicationUser GetByLogin(string loginName) { var result = new DataAccess.DataAccess().ExecuteReader<ApplicationUser>("avz_usr_getByLogin", new { userid = loginName }); if (result.Count > 0) return result[0]; return null; }
public GroupPermissionModel GetUserGroup(long userId) { var result = new DataAccess.DataAccess().ExecuteReader<GroupPermissionModel>("avz_usr_getUserGroup", new { userid = userId }); if (result.Count > 0) return result[0]; return null; }
public ApplicationUser GetById(long id) { var result = new DataAccess.DataAccess().ExecuteReader<ApplicationUser>("avz_usr_getById", new { id = id }); if (result.Count > 0) return result[0]; return null; }
public void AddChargingStationDataTest() { DataAccess.DataAccess dl = new DataAccess.DataAccess(); var result = dl.AddChargingStationData("85254", 3, 5); Assert.That(result, Is.GreaterThan(0)); }
public void Update(long CityID, long StateID, string CityName) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_CityID", CityID.ToString()); para.Add("@i_StateID", StateID.ToString()); para.Add("@i_CityName", CityName); para.Add("@i_UserID", CurrentUser.UserID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_City_Update", para, true, ref mException, ref mErrorMsg, "City - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void UpdateTNC_NEW(string code, string XmlString, Int64 Cnt) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); //para.Add("@i_TNCID", TNCID.ToString()); para.Add("@i_Code", code.ToString()); para.Add("@i_XmlString", XmlString); para.Add("@i_Cnt", Cnt.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); //para.Add("@i_TNCID", TNCID.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_SalesTNC_Update", para, false, ref mException, ref mErrorMsg, "Sales - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void Update(long BankID, string BankName, string Bankaddr, string IFSCcode, string AccNo, string PhNo) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_BankID", BankID.ToString()); para.Add("@i_BankAddr", Bankaddr); para.Add("@i_IFSCcode", IFSCcode); para.Add("@i_BankName", BankName); para.Add("@i_AccNo", AccNo); para.Add("@i_PhNo", PhNo); para.Add("@i_ModifiedBy", CurrentUser.UserID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_Bank_Update", para, true, ref mException, ref mErrorMsg, "Bank - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void Update(long AdjustmentID, DateTime AdjustDate, long ItemID, decimal Qty, string Narration, int GodownID) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_AdjustmentID", AdjustmentID.ToString()); para.Add("@i_AdjustDate", AdjustDate.ToString("MM/dd/yyyy")); para.Add("@i_ItemID", ItemID.ToString()); para.Add("@i_Qty", Qty.ToString()); para.Add("@i_Narration", Narration); para.Add("@i_GodownID", GodownID.ToString()); para.Add("@i_UserID", CurrentUser.UserID.ToString()); para.Add("@i_CompanyID", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_ItemAdjustment_Update", para, true, ref mException, ref mErrorMsg, "ItemAdjustment - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public Boleta Read(decimal nro_boleta) { Boleta boleta = null; using (da = new DataAccess.DataAccess()) { da.GenerarComando("select nro_boleta, fecha_venta, total_boleta, es_fiado, id_usuario, anulada from boleta where nro_boleta = :nro_boleta"); da.AgregarParametro(":nro_boleta", nro_boleta); IDataReader reader = da.ExecuteReader(); while (reader.Read()) { string fecha_venta = reader["fecha_venta"].ToString(); boleta = new Boleta { NroBoleta = Convert.ToDecimal(reader["nro_boleta"].ToString()), FechaVenta = Convert.ToDateTime(fecha_venta), TotalBoleta = Convert.ToDecimal(reader["total_boleta"].ToString()), BoletaFiada = reader["es_fiado"].ToString() == "y", Anulada = reader["anulada"].ToString() == "y", UsuarioVendedor = mantenedorUsuarios.Read(reader["id_usuario"].ToString()), Productos = ObtenerProductosDeBoleta(nro_boleta).Select(cod_producto => mantenedorProductos.Read(cod_producto)).ToList() }; } } return(boleta); }
public void Update(long UOMID, string UOMName, string Abbreviation) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_UOMID", UOMID.ToString()); para.Add("@i_UOMName", UOMName); para.Add("@i_Abbr", Abbreviation); para.Add("@i_UserID", CurrentUser.UserID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_UOM_Update", para, true, ref mException, ref mErrorMsg, "UOMBL - Upadte"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public async Task AddIngredientAsyncAdds() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("AddIngredientAsyncAdds") .Options; Ingredient ingredient = new Ingredient { Id = 1, TypeId = 1, Name = "name", Price = 1, IngredientType = new IngredientType { Id = 1, Name = "name", } }; using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); await repo.AddIngredientAsync(ingredient); await repo.SaveAsync(); using var arrangeContext = new Project2JAGVContext(options); var result = arrangeContext.Ingredients; Assert.NotNull(result); }
public async Task AddAddressAsyncAdds() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("AddAddressAsyncGets") .Options; Address address = new Address { Id = 1, Street = "Street", City = "City", State = "State", ZipCode = "ZipCode", }; using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); // act await repo.AddAddressAsync(address); await repo.SaveAsync(); using var arrangeContext = new Project2JAGVContext(options); var result = arrangeContext.Addresses; // assert Assert.NotNull(result); }
public void Update(long ConTypeID, string ConType_name, string Desc) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_CallID", ConTypeID.ToString()); para.Add("@i_Call_Name", ConType_name); para.Add("@i_Desc", Desc); para.Add("@i_ModifiedBy", CurrentUser.UserID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_TypeOfCall_Update", para, true, ref mException, ref mErrorMsg, "TypeOfCall - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void InsertLeadDocument(long LeadID, string DocName) { SetDefaultException(); //NameValueCollection padoc = new NameValueCollection(); //padoc.Add("@i_leaddocno", leaddocno.ToString()); //DataAccess.DataAccess objleaddoc = new DataAccess.DataAccess(); //objDA.ExecuteSP("usp_Leaddocno", padoc, false, ref mException, ref mErrorMsg, "Sale - Insert"); //dtblLOV = objDA.ListOfRecord("usp_Customer_Lead_LOV", para, "Customer LOV - LoadList"); NameValueCollection para = new NameValueCollection(); para.Add("@i_LeadID", LeadID.ToString()); para.Add("@i_DocName", DocName); //para.Add("@i_Remarks", Remarks); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_LeadDocList_Insert", para, false, ref mException, ref mErrorMsg, "Sale - Insert"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void GetUsersAsyncGetsAllUsers() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("GetUsersAsyncGetsAllUsers") .Options; using var arrangeContext = new Project2JAGVContext(options); int id = 1; string name = "name"; string password = "******"; int addressId = 1; int userTypeId = 1; arrangeContext.Users.Add(new Users { Id = id, Name = name, Password = password, UserTypeId = userTypeId, AddressId = addressId, }); arrangeContext.SaveChanges(); using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); // act var result = repo.GetUsersAsync(id: id, name: name, password: password); // assert Assert.NotNull(result); }
public async Task GetIngredientsAsyncGets() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("GetIngredientsAsyncGets") .Options; Ingredients ingredients = new Ingredients { Id = 1, Name = "name", Price = 1, }; using var arrangeContext = new Project2JAGVContext(options); arrangeContext.Add(ingredients); arrangeContext.SaveChanges(); using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); var result = await repo.GetIngredientsAsync(); Assert.NotNull(result); }
public void UpdateQContact(int ContactType, string RefID, String Code, string ContactData, long Cnt) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_Code", Code.ToString()); para.Add("@i_ContactType", ContactType.ToString()); para.Add("@i_RefID", RefID.ToString()); para.Add("@i_ContactData", ContactData); para.Add("@i_Cnt", Cnt.ToString()); para.Add("@i_UserID", CurrentUser.UserID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_QContactDetail_Update", para, true, ref mException, ref mErrorMsg, "ContactPerson - Insert"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public async Task AddOrderAsyncAdds() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("AddOrderAsyncAdds") .Options; Order order = new Order { Id = 1, UserId = 1, DelivererId = 1, Delivered = false, Date = DateTime.Now, }; using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); await repo.AddOrderAsync(order); await repo.SaveAsync(); using var arrangeContext = new Project2JAGVContext(options); var result = arrangeContext.Orders; Assert.NotNull(result); }
public void Insert(long AccountID, DateTime DOE, Decimal CrAmount, Decimal DBAmount, string Narration) { SetDefaultException(); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); NameValueCollection Para = new NameValueCollection(); Para.Add("@i_FYID", CurrentUser.FYID.ToString()); Para.Add("@i_AccountID", AccountID.ToString()); Para.Add("@i_Date", String.Format("{0:MM/dd/yyyy}", DOE)); Para.Add("@i_CRAmount", CrAmount.ToString()); Para.Add("@i_DBAmount", DBAmount.ToString()); Para.Add("@i_Narration", Narration); objDA.ExecuteSP("usp_Commission_Insert", Para, true, ref mException, ref mErrorMsg, "Account - Insert"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public async Task GetOrdersAsynGetsc() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("GetOrdersAsynGetsc") .Options; Orders orders = new Orders { Id = 1, UserId = 1, DelivererId = 1, Delivered = false, Date = DateTime.Now, }; using var arrangeContext = new Project2JAGVContext(options); arrangeContext.Add(orders); arrangeContext.SaveChanges(); using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); var result = await repo.GetOrdersAsync(id : orders.Id, userId : orders.UserId, delivererId : orders.DelivererId, delivered : orders.Delivered, date : orders.Date); Assert.NotNull(result); }
public async Task AddPizzaAsyncAdds() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("AddOrderAsyncAdds") .Options; Pizza pizza = new Pizza { Id = 1, OrderId = 1, Name = "name", }; using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); await repo.AddPizzaAsync(pizza); await repo.SaveAsync(); using var arrangeContext = new Project2JAGVContext(options); var result = arrangeContext.Pizzas; Assert.NotNull(result); }
public async Task GetPizzasAsyncGets() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("GetOrdersAsynGetsc") .Options; Pizzas pizzas = new Pizzas { Id = 1, OrderId = 1, Name = "name", }; using var arrangeContext = new Project2JAGVContext(options); arrangeContext.Add(pizzas); arrangeContext.SaveChanges(); using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); var result = await repo.GetPizzasAsync(id : pizzas.Id, orderId : pizzas.OrderId, name : pizzas.Name); Assert.NotNull(result); }
public DataTable GetSelectedUserPriviliegiesList(Int64 UserID) { SetDefaultException(); DataTable dt = new DataTable(); NameValueCollection paralist = new NameValueCollection(); paralist.Add("@i_UserID", UserID.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); dt = objDA.ExecuteDataTableSP("usp_GetSelectedPrivilegeList", paralist, false, ref mException, ref mErrorMsg, "User - GetSelectedUserPriviliegiesList"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } else { return(dt); } } else { this.Exception = mException; } return(dt); }
public DataTable GetColumnsList(NameValueCollection paralist, string SpName) { SetDefaultException(); DataTable dt = new DataTable(); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); dt = objDA.ExecuteDataTableSP(SpName, paralist, false, ref mException, ref mErrorMsg, "User - GetColumnsList"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } else { return(dt); } } else { this.Exception = mException; } return(dt); }
public void UpdateAppConfigByNameTest() { DataAccess.DataAccess dl = new DataAccess.DataAccess(); var result = dl.UpdateAppConfig(@"test/@test", "test" + DateTime.Now.ToFileTimeUtc().ToString()); Assert.That(result, Is.EqualTo(true)); }
public DataTable GetUserPriviliegiesList() { SetDefaultException(); DataTable dt = new DataTable(); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); dt = objDA.ExecuteDataTableSP("usp_GetPrivilege_List", null, false, ref mException, ref mErrorMsg, "User - GetUserPriviliegiesList"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } else { return(dt); } } else { this.Exception = mException; } return(dt); }
public bool Prueba() { using (da = new DataAccess.DataAccess()) { } return(true); }
public void GetAppConfigTest() { DataAccess.DataAccess dl = new DataAccess.DataAccess(); var record = dl.GetAppConfigs(); Assert.That(record[0], Is.InstanceOf <app_config>()); }
public void GetChargingStationDataByPostalCodeTest() { DataAccess.DataAccess dl = new DataAccess.DataAccess(); var result = dl.GetChargingStationDataByPostalCode("85254"); Assert.That(result[0], Is.InstanceOf <charging_station_data>()); }
public void UpdatePrice(long VendorID, string ItemData, long Cnt, string StrDelete) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_VendorID", VendorID.ToString()); para.Add("@i_ItemData", ItemData); para.Add("@i_Cnt", Cnt.ToString()); para.Add("@i_StrDelete", StrDelete); para.Add("@i_UserID", CurrentUser.UserID.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_Vendor_UpdatePrice", para, true, ref mException, ref mErrorMsg, "Vendor - UpdatePrice"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public void Update(long StockID, long ItemID, decimal QOH, decimal MinLevel, decimal MaxLevel, decimal ReOrderLvl, string Location, string RackNo, DateTime StockDate, int GodownID) { SetDefaultException(); NameValueCollection para = new NameValueCollection(); para.Add("@i_StockID", StockID.ToString()); para.Add("@i_ItemID", ItemID.ToString()); para.Add("@i_QOH", QOH.ToString()); para.Add("@i_MinLevel", MinLevel.ToString()); para.Add("@i_MaxLevel", MaxLevel.ToString()); para.Add("@i_ReOrderLvl", ReOrderLvl.ToString()); para.Add("@i_Location", Location); para.Add("@i_RackNo", RackNo); para.Add("@i_Date", StockDate.ToString("MM/dd/yyyy")); para.Add("@i_UserID", CurrentUser.UserID.ToString()); para.Add("@i_GodownID", GodownID.ToString()); para.Add("@i_CompId", CurrentCompany.CompId.ToString()); DataAccess.DataAccess objDA = new DataAccess.DataAccess(); objDA.ExecuteSP("usp_ItemStock_Update", para, true, ref mException, ref mErrorMsg, "ItemStock - Update"); if (mException == null) { if (mErrorMsg != "") { this.ErrorMessage = mErrorMsg; } } else { this.Exception = mException; } }
public CreateResponse CreateExercise(Models.Exercise exercise) { var resp = new CreateResponse(); //set datetime exercise.date = DateTime.Now.ToString("s").Replace('T', ' ') + "UTC"; DataAccess.DataAccess da = new DataAccess.DataAccess(); da.CreateExerciseCollection(exercise); return resp; }
private static void Main(string[] args) { IDataAccess data = new DataAccess.DataAccess(); var blogPosts = data.GetBlogPosts(); if (blogPosts.Any()) Console.WriteLine("Get Blog Posts: Passed"); else Console.WriteLine("Get Blog Posts: Failed"); var blogPost = data.GetBlogPost(1); if (blogPost != null) Console.WriteLine("Get Blog Post: Passed"); else Console.WriteLine("Get Blog Post: Failed"); var blogPostCreated = data.CreateBlogPost(new BlogPost { Content = "TEST BLOG POST", DatePosted = DateTime.Now, Id = 0 }); if (blogPostCreated != null && blogPostCreated.Id > 0) Console.WriteLine("Create Blog Post: Passed"); else Console.WriteLine("Create Blog Post: Failed"); var blogPostUpdated = data.UpdateBlogPost(new BlogPost { Content = "TEST BLOG POST Updated", DatePosted = DateTime.Now, Id = 2 }); if (blogPostUpdated) Console.WriteLine("Update Blog Post: Passed"); else Console.WriteLine("Update Blog Post: Failed"); var blogPostDelete = data.DeleteBlogPost(new BlogPost { Id = 1 }); if (blogPostDelete) Console.WriteLine("Delete Blog Post: Passed"); else Console.WriteLine("Delete Blog Post: Failed"); Console.ReadKey(); }
// bool CheckProcessorExist(ProcessorLookupModel entity); public bool CheckProcessorExist(ProcessorLookupModel entity) { int result = new DataAccess.DataAccess().ExecuteScalar<int>("avz_proc_CheckprocessorNameExist", new { Name = entity.Name, ProcessorId = entity.ProcessorId }); if (result > 0) { return true; } else { return false; } }
public IList<GeneralModel> RetreiveDeclineReasons() { GeneralModel declinemodel = null; IList<GeneralModel> lstDeclinereason = new List<GeneralModel>(); DataSet ds = new DataAccess.DataAccess().ExecuteDataSet("avz_ren_spRetrieveDeclineReasons", null); for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { declinemodel = new GeneralModel(); declinemodel.keyId = Convert.ToInt32(ds.Tables[0].Rows[i]["DeclineReasonId"]); declinemodel.description = Convert.ToString(ds.Tables[0].Rows[i]["ReasonDescription"]); lstDeclinereason.Add(declinemodel); }; return lstDeclinereason; }
/// <summary> /// /// </summary> /// <param name="contractId"></param> /// <param name="merchantId"></param> /// <returns></returns> public DataSet RetrieveIOUDetails(Int64 contractId, Int64 merchantId) { DataSet dsData = new DataSet(); dsData = new DataAccess.DataAccess().ExecuteDataSet("avz_cnt_spGenrateIOU", new { ContractId = contractId, MerchantId = merchantId }); return dsData; }
/// <summary> /// To retrieve funding details /// </summary> /// <param name="contractId"></param> /// <param name="merchantId"></param> /// <returns></returns> public FundingModel RetrieveFundingDetails(Int64 contractId, Int64 merchantId) { FundingModel obj = new DataAccess.DataAccess().ExecuteReader<FundingModel>("AVZ_CNT_spFunding", new { ContractId = contractId, MerchantId = merchantId }).FirstOrDefault(); //obj.AdministrativeExpensesList = new DataAccess.DataAccess().ExecuteReader<GeneralModel>("avz_cnt_spRetrieveAdministrationExpenses", new { ContractId = contractId }); return obj; }
/// <summary> /// Retrieve merchant from the db /// </summary> /// <param name="merchantId"></param> /// <param name="businessName"></param> /// <param name="rnc"></param> /// <returns></returns> public IList<OwnerModel> ListMerchantOwner(Int64 merchantId) { IList<OwnerModel> ownerList = new DataAccess.DataAccess().ExecuteReader<OwnerModel>("avz_mrc_spRetrieveOwner", new { merchantId = merchantId }); return ownerList; }
public VerificationModel RetrieveVerificationDetails(Int64 contractId, Int64 merchantId, string entity) { var t = new DataAccess.DataAccess().ExecuteReader<QuestionsModel, VerificationModel>("avz_cnt_RetriveVeriCall", new { ContractId = contractId, Entity = entity }); var vc = t.Item2.Count > 0 ? t.Item2[0] : new VerificationModel(); vc.questions = t.Item1; MerchantDetailQuestionModel mod = new MerchantDetailQuestionModel(); using (ContractTier dT = new ContractTier()) { mod = dT.GetMerchantDetailsForVerification(merchantId); } vc.MerchantDetails = mod; return vc; }
/// <summary> /// Retrieve merchant from the db /// </summary> /// <param name="merchantId"></param> /// <param name="businessName"></param> /// <param name="rnc"></param> /// <returns></returns> public IList<MerchantProfile> ListCreditCardProfiles(Int64 merchantId) { IList<MerchantProfile> ccList = new DataAccess.DataAccess().ExecuteReader<MerchantProfile>("avz_mrc_spretrieveCreditCardActivity", new { merchantId = merchantId }); return ccList; }
/// <summary> /// Retrieve merchant from the db /// </summary> /// <param name="merchantId"></param> /// <param name="businessName"></param> /// <param name="rnc"></param> /// <returns></returns> public IList<MerchantTempModel> ListMerchantQueue() { IList<MerchantTempModel> merchantsList = new DataAccess.DataAccess().ExecuteReader<MerchantTempModel>("avz_mrc_spRetrieveTempQueue", null); return merchantsList; }
public IList<SearchResultsModel> ListMerchantsSeach(string businessName, string rnc, string legalName, string ownerName, long? merchantId, long? contractId, long? workflowId, long? statusId, long? processornbr, string processorName, long? tasktype, Int16? showTemp, string SearchType, Int64 assignedUserId) { IList<SearchResultsModel> merchantsList = new DataAccess.DataAccess().ExecuteReader<SearchResultsModel>("avz_mrc_spRetrievemerchantSearchResults", new { merchantId = merchantId, businessName = businessName, rnc = rnc, legalName = legalName, ownerName = ownerName, contractId = contractId, workflowId = workflowId, statusId = statusId, processornbr = processornbr, processorName = processorName, tasktype = tasktype, showTemp = showTemp, SearchType = SearchType, AssignedUserId = assignedUserId }); return merchantsList; }
public AnnualSaleModel RetrieveAnnualSalesFile(long merchantId, long contractId) { var model = new DataAccess.DataAccess().ExecuteReader<AnnualSaleModel>("AVZ_Cnt_GetAnnualSalesCalcFile", new { MerchantId = merchantId, ContractId = contractId }); if (model.Count > 0) return model[0]; return new AnnualSaleModel { }; }
/// <summary> /// /// </summary> /// <returns></returns> public DataSet RetrieveRenewalsList() { DataSet renewalsList = null; renewalsList = new DataAccess.DataAccess().ExecuteDataSet("avz_ren_spRetrievRenewalsList", null); return renewalsList; }
public MerchantOffer RetrieveMerchantOffer(Int64 merchantId, Int64 contractId) { DataSet dsMoffer = new DataAccess.DataAccess().ExecuteDataSet("avz_mcr_merchantOffer", new { merchantId = merchantId, contractId = contractId }); var merchantOffer = new MerchantOffer(); if (dsMoffer.Tables[0].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Merchant, dsMoffer.Tables[0].Rows[0]); if (dsMoffer.Tables[1].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Merchant.Address, dsMoffer.Tables[1].Rows[0]); if (dsMoffer.Tables[2].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Owner, dsMoffer.Tables[2].Rows[0]); if (dsMoffer.Tables[3].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Owner.Address, dsMoffer.Tables[3].Rows[0]); if (dsMoffer.Tables[4].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Contract, dsMoffer.Tables[4].Rows[0]); if (dsMoffer.Tables[5].Rows.Count > 0) foreach (DataRow r in dsMoffer.Tables[5].Rows) { var offer = new OfferModel(); DataHelper.FillObjectFromDataRow(offer, r); merchantOffer.Offers.Add(offer); } return merchantOffer; }
public IList<EmailModel> RetriveEmails(Int64 SalesRepId) { IList<EmailModel> email = new DataAccess.DataAccess().ExecuteReader<EmailModel>("AVZ_spGetEmails", new { SalesRep = SalesRepId }); return email; }
public IList<MerchantTempModel> RetriveMerchantSalesForce(string businessName, string rnc, string legalName, string ownerName) { //avz_mrc_spRetrieveSalesForce IList<MerchantTempModel> merchantsList = new DataAccess.DataAccess().ExecuteReader<MerchantTempModel>(" avz_mrc_spRetrievemerchantSearch", new { rnc = rnc == null ? string.Empty : rnc, businessName = businessName == null ? string.Empty : businessName, legalName = legalName == null ? string.Empty : legalName, ownerName = ownerName == null ? string.Empty : ownerName, merchantId = 0, contractId = 0, workflowId = 0, statusId = 0, processornbr = 0, processorName = string.Empty, taskType = 0 }); return merchantsList; }
/// <summary> /// Save the merchant in the temp table and also if isCompleted is 1 then a new merchant would be created and the status would be inactive. /// </summary> /// <param name="entity"></param> /// <param name="merchantId"></param> /// <param name="isCompleted"></param> /// <returns></returns> public Int64 Save(MerchantTempModel entity, Int64 merchantId, string isCompleted) { Int64 _merchantId = 0; if (merchantId != 0) { _merchantId = new DataAccess.DataAccess().ExecuteNonQuery("avz_mrc_spUpdateMerchantTemp", new { merchantId = merchantId, businessName = entity.businessName, businessStartDate = entity.businessStartDate, legalName = entity.legalName, industryTypeid = entity.industryTypeid, businessTypeId = entity.businessTypeId, rnc = entity.rnc, salesRepId = entity.salesRepId, modifyuserId = entity.userId, isCompleted = isCompleted, isDuplicate = entity.IsDuplicate == true ? "1" : "0", }, new { merchantId = 0 }); } else { _merchantId = new DataAccess.DataAccess().ExecuteNonQuery("avz_mrc_spInsertMerchantTemp", new { merchantId = 0, businessName = entity.businessName, businessStartDate = entity.businessStartDate, legalName = entity.legalName, industryTypeid = entity.industryTypeid, businessTypeId = entity.businessTypeId, rnc = entity.rnc, salesRepId = entity.salesRepId, insertDate = DateTime.Now, insertUserId = entity.userId, isCompleted = isCompleted, }, new { merchantId = 0 }); } return _merchantId; }
/// <summary> /// To Retrieve Corporate Document details /// </summary> /// <param name="contractId"></param> /// <param name="merchantId"></param> /// <returns></returns> public DataSet RetrieveCorpDetails(Int64 contractId, Int64 merchantId) { DataSet dsData = new DataSet(); dsData = new DataAccess.DataAccess().ExecuteDataSet("AVZ_CNT_spCorporateDocVerification", new { ContractId = contractId, MerchantId = merchantId }); return dsData; }
/// <summary> /// Retrieve merchant from the db /// </summary> /// <param name="merchantId"></param> /// <param name="businessName"></param> /// <param name="rnc"></param> /// <returns></returns> public IList<MerchantsModel> ListMerchants(string businessName, string rnc, string legalName, string ownerName, Int64? merchantId, Int64? contractId, Int64? workflowId, Int64? statusId, Int64? processornbr, string processorName, Int64? tasktype) { IList<MerchantsModel> merchantsList = new DataAccess.DataAccess().ExecuteReader<MerchantsModel>("avz_mrc_spRetrievemerchantSearch", new { rnc = rnc == null ? string.Empty : rnc, businessName = businessName == null ? string.Empty : businessName, legalName = legalName == null ? string.Empty : legalName, ownerName = ownerName == null ? string.Empty : ownerName, merchantId = merchantId == null ? 0 : merchantId, contractId = contractId == null ? 0 : contractId, workflowId = workflowId == null ? 0 : workflowId, statusId = statusId == null ? 0 : statusId, processornbr = processornbr == null ? 0 : processornbr, processorName = processorName == null ? string.Empty : processorName, taskType = tasktype == null ? 0 : tasktype, }); return merchantsList; }
/// <summary> /// To Retrieve BLA Details for a particular Contract - Generate Contract Screen /// </summary> /// <param name="contractId"></param> /// <param name="merchantId"></param> /// <returns></returns> public DataSet RetrieveBLADetails(Int64 contractId, Int64 merchantId) { DataSet dsData = new DataSet(); dsData = new DataAccess.DataAccess().ExecuteDataSet("AVZ_CNT_spGenerateBLA", new { ContractId = contractId, MerchantId = merchantId }); return dsData; }
public MerchantsModel ListMerchants(Int64 merchantId) { IList<MerchantsModel> merchantsList = new DataAccess.DataAccess().ExecuteReader<MerchantsModel>("avz_mrc_spRetrieveMerchant", new { merchantId = merchantId }); MerchantsModel merchant = merchantsList.FirstOrDefault(); return merchant; }
//public IList<RenewalModel> RenewalsList(string filter) //{ // return new DataAccess.DataAccess().ExecuteReader<RenewalModel>("avz_ren_spRetrievRenewalsList", new { Filter = filter }); //} public DataSet RetrieveRenewalsList(string filter) { DataSet renewalsList = null; renewalsList = new DataAccess.DataAccess().ExecuteDataSet("avz_ren_spRetrievRenewalsList", new { Filter = filter }); return renewalsList; }
public DataSet GetMerchantDetailsForQuestion(Int64 merchantId) { DataSet dsData = new DataSet(); dsData = new DataAccess.DataAccess().ExecuteDataSet("avz_sp_reterieveMerchantLandlord", new { merchantId = merchantId }); return dsData; }
public void DataAccess() { IDataAccess _da = new DataAccess.DataAccess(); DataTable dt = new DataTable(); DataSet ds = new DataSet(); Mock<DataSet> moqOrders = new Mock<DataSet>(); //Solution directory TODO: |DataDirectory| string dir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName; //SqlConnection connection = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Klaus\Desktop\Andrew\github\Ergolys\ObjectModels\NORTHWND.MDF;Integrated Security=True"); SqlConnection connection = new SqlConnection( String.Format(@"Data Source=(LocalDB)\v11.0;AttachDbFilename={0}{1};Integrated Security=True", dir, "\\Northwind\\Data\\NORTHWND.MDF")); connection.Open(); SqlCommand command = new SqlCommand("Select * from Orders", connection); SqlDataAdapter adapter = new SqlDataAdapter(command); adapter.Fill(ds); dt = ds.Tables[0]; }
/// <summary> /// /// </summary> /// <param name="contractId"></param> /// <returns></returns> public ContractModel GetAdminExp(Int64 contractId) { ContractModel obj = new DataAccess.DataAccess().ExecuteReader<ContractModel>("avz_spreterieveAdminExp", new { ContractId = contractId }).FirstOrDefault(); return obj; }
public IList<GeneralModel> RetriveMerchantContracts(int merchantId) { IList<GeneralModel> statusList = new DataAccess.DataAccess().ExecuteReader<GeneralModel>("avz_MRC_spRetrieveAllMerchantContracts", new { merchantId = merchantId }); return statusList; }
public DataSet RetrieveContractDetatis(Int64 contractId) { DataSet contInformtion = null; contInformtion = new DataAccess.DataAccess().ExecuteDataSet("avz_ren_spretrieveContractInformation", new { contractId = contractId }); return contInformtion; }