public static EmployeeModel SelectEmployeeByIdentification(string id) { try { string[] employee = new string[] { id }; if (ValidateData.VerifyFields(employee)) { EmployeeModel employeeModel = new EmployeeModel() { Identification = id }; //return EmployeeConnection.SelectEmployeeByIdentification(employeeModel); return(null); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
public static bool UpdateSubCategoryById(string idSubCategory, string idCategory, string name) { try { string[] subCategory = new string[] { idSubCategory, name }; if (ValidateData.VerifyFields(subCategory)) { SubCategoryModel subCategoryModel = new SubCategoryModel() { IdsubCategory = int.Parse(idSubCategory), IdCategory = int.Parse(idCategory), Name = name }; DBSubCategory.UpdateSubCategory(subCategoryModel); return(true); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="toSearch"></param> /// <returns></returns> public static EmployeeModel SelecEmployeeByNameOrLastName(string toSearch) { try { string[] client = new string[] { toSearch }; if (ValidateData.VerifyFields(client)) { EmployeeModel employeeModel = new EmployeeModel() { Name = toSearch, LastName = toSearch }; //return EmployeeConnection.SelectEmployeeByNameOrLastName(employeeModel); return(null); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="idCategory"></param> /// <returns></returns> public static bool InsertSubCategory(string name, string idCategory) { try { string[] subCategory = new string[] { name, idCategory }; if (ValidateData.VerifyFields(subCategory)) { SubCategoryModel subCategoryModel = new SubCategoryModel() { IdCategory = int.Parse(idCategory), Name = name, }; DBSubCategory.InsertSubCategory(subCategoryModel); return(true); } else { return(false); } } catch (Exception ex) { return(false); //Log4Net } }
/// <summary> /// /// </summary> /// <param name="idCategory"></param> /// <param name="name"></param> /// <returns></returns> public static bool UpdateCategoryById(string idCategory, string name) { try { //TEMP string[] category = new string[] { idCategory, name }; if (ValidateData.VerifyFields(category)) { CategoryModel categoryModel = new CategoryModel() { Name = name, IdCategory = int.Parse(idCategory) }; return(DBCategory.UpdateCategory(categoryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
//public static bool InsertUser(string userName, string password, string idEmployee) //{ // try // { // string[] user = new string[] { userName, password, idEmployee }; // UserModel userModel = new UserModel() // { // UserName = userName, // Password = password, // IdRole = 0 // }; // if (ValidateData.VerifyFields(user)) // { // return UserConnection.InsertUser(userModel); // } // else // { // return false; // } // } // catch (Exception ex) // { // //Log4Net // return false; // } //} //Para qué? //public static bool UpdateUserById(string idUser, string userName, string password, string[] idRole, string name, string lastName) //{ // try // { // string[] user = new string[] { idUser, userName, name, lastName }; // if (ValidateData.VerifyFields(user)) // { // UserConnection.UpdateUser(); // return true; // } // else // { // return false; // } // } // catch (Exception ex) // { // //Log4Net // return false; // } //} /// <summary> /// /// </summary> /// <param name="idUser"></param> /// <param name="password"></param> /// <returns></returns> public static bool UpdateUserPassword(string idUser, string password) { try { string[] user = new string[] { idUser, password }; if (ValidateData.VerifyFields(user)) { UserModel userModel = new UserModel() { IdUser = int.Parse(idUser), Password = PasswordManagement.HashPassword(password) }; return(true); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
public static bool UpdateQuantity(string idProduct, string quantity) { try { string[] product = new string[] { idProduct, quantity }; if (ValidateData.VerifyFields(product)) { ProductModel productModel = new ProductModel() { IdProduct = int.Parse(idProduct), variableQuantity = int.Parse(quantity) }; return(DBProduct.UpdateQuantity(productModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idBrand"></param> /// <param name="name"></param> /// <returns></returns> public static bool UpdateBrandById(string idBrand, string name) { try { string[] brand = new string[] { idBrand, name }; if (ValidateData.VerifyFields(brand)) { BrandModel brandModel = new BrandModel() { IdBrand = int.Parse(idBrand), name = name }; return(DBBrand.UpdateBrand(brandModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idSalary"></param> /// <param name="salaryAmount"></param> /// <param name="registrationDate"></param> /// <returns></returns> public static bool UpdateSalaryById(string idSalary, string salaryAmount) { try { string[] salary = new string[] { idSalary, salaryAmount }; if (ValidateData.VerifyFields(salary)) { SalaryModel salaryModel = new SalaryModel() { IdSalary = int.Parse(idSalary), SalaryAmount = decimal.Parse(salaryAmount) }; return(DBSalary.UpdateSalary(salaryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idPosition"></param> /// <param name="positionName"></param> /// <param name="idSalary"></param> /// <returns></returns> public static bool UpdatePositionById(string idPosition, string positionName, string idSalary) { try { string[] position = new string[] { idPosition, positionName }; if (ValidateData.VerifyFields(position)) { PositionModel positionModel = new PositionModel() { IdSalary = int.Parse(idSalary), IdPosition = int.Parse(idPosition), PositionName = positionName }; return(DBPosition.UpdatePosition(positionModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idBusiness"></param> /// <returns></returns> public static BusinessModel SelectBusinessById(string idBusiness) { try { //TEMP string[] business = new string[] { idBusiness }; if (ValidateData.VerifyFields(business)) { BusinessModel businessModel = new BusinessModel() { IdBusiness = int.Parse(idBusiness) }; return(DBBusiness.SelectBusinessId(businessModel)); } else { return(null); } } catch (Exception ex) { return(null); //Log4Net } }
/// <summary> /// /// </summary> /// <param name="idClient"></param> /// <param name="name"></param> /// <param name="lastName"></param> /// <param name="id"></param> /// <param name="idType"></param> /// <param name="email"></param> /// <param name="bornDate"></param> /// <returns></returns> public static bool UpdateClientById(string idClient, string name, string lastName, string id, string idType, string email, string bornDate) { try { string[] client = new string[] { idClient, name, lastName, id, idType, email, bornDate }; if (ValidateData.VerifyFields(client)) { ClientModel clientModel = new ClientModel() { IdClient = Int32.Parse(idClient), Name = name, Lastname = lastName, Identification = id, IdentificationType = idType, Email = email, BornDate = DateTime.Parse(bornDate) }; return(DBClient.UpdateClient(clientModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="toSearch"></param> /// <returns></returns> public static List <ClientModel> SelectClientByNameOrLastName(string toSearch) { try { string[] client = new string[] { toSearch }; if (ValidateData.VerifyFields(client)) { ClientModel clientModel = new ClientModel() { Name = toSearch, Lastname = toSearch }; return(DBClient.SelectNameOrLastName(clientModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idClient"></param> /// <returns></returns> public static ClientModel SelectClientById(string idClient) { try { string[] client = new string[] { idClient }; if (ValidateData.VerifyFields(client)) { ClientModel clientModel = new ClientModel() { IdClient = int.Parse(idClient) }; //return ClientConnection.SelectClient(clientModel);} return(null); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="registrationDate"></param> /// <returns></returns> public static SalaryModel SelectSalaryByRegistrationDate(string registrationDate) { try { string[] salary = new string[] { registrationDate }; if (ValidateData.VerifyFields(salary)) { SalaryModel salaryModel = new SalaryModel() { RegistrationDate = registrationDate }; //return SalaryConnection.SelectSalaryByDate(salaryModel); return(null); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idProduct"></param> /// <param name="code"></param> /// <param name="style"></param> /// <param name="idBrand"></param> /// <param name="description"></param> /// <param name="idCategory"></param> /// <param name="idSubCategory"></param> /// <param name="normalPrice"></param> /// <param name="lowerPrice"></param> /// <param name="estableQuantity"></param> /// <param name="variableQuantity"></param> /// <param name="image"></param> /// <param name="ivi"></param> /// <param name="existingInvoice"></param> /// <param name="size"></param> /// <returns></returns> public static bool UpdateProductById( string idProduct, string code, string style, string idBrand, string description, string idSubCategory, string normalPrice, string lowerPrice, string estableQuantity, string variableQuantity, byte[] image, bool ivi, bool existingInvoice ) { try { string[] product = new string[] { idProduct, code, style, idBrand, description, idSubCategory, normalPrice, lowerPrice, estableQuantity, variableQuantity }; if (ValidateData.VerifyFields(product)) { ProductModel productModel = new ProductModel() { IdProduct = int.Parse(idProduct), Code = code, Style = style, IdBrand = int.Parse(idBrand), Description = description, IdSubCategory = int.Parse(idSubCategory), NormalPrice = decimal.Parse(normalPrice), LowerPrice = decimal.Parse(lowerPrice), EstableQuantity = int.Parse(estableQuantity), VariableQuantity = int.Parse(variableQuantity), Ivi = ivi, ExistingInvoice = existingInvoice, Image = image }; return(DBProduct.UpdateProduct(productModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
public static bool updateExternalSellinvoice( string NumberInvoice, DateTime ActualDate, int IdClient, int IdEmployee, int IdBusiness, string CurrencyType, string IviAmount, string CashDeposit, string CreditDeposit, decimal TotalDiscount, decimal SubTotal, decimal Total ) { try { string[] externalSellinvoice = new string[] { NumberInvoice, CurrencyType, IviAmount, CashDeposit, CreditDeposit }; if (ValidateData.VerifyFields(externalSellinvoice)) { DetailExternalSellinvoiceModel externalSellinvoiceModel = new DetailExternalSellinvoiceModel() { NumberInvoice = int.Parse(NumberInvoice), ActualDate = ActualDate, IdClient = IdClient, IdEmployee = IdEmployee, IdBusiness = IdBusiness, CurrencyType = CurrencyType, IviAmount = decimal.Parse(IviAmount), CashDeposit = decimal.Parse(CashDeposit), CreditDeposit = decimal.Parse(CreditDeposit), TotalDiscount = TotalDiscount, SubTotal = SubTotal, Total = Total }; return(DBDetailExternalInvoiceSell.UpdateExternalInvoice(externalSellinvoiceModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idBusiness"></param> /// <param name="fantasyName"></param> /// <param name="societyName"></param> /// <param name="legalCertification"></param> /// <param name="telephone"></param> /// <param name="mainAddress"></param> /// <param name="generalAddress"></param> /// <param name="email"></param> /// <param name="webPage"></param> /// <param name="logo"></param> /// <returns></returns> public static bool UpdateBusinessById( string idBusiness, string fantasyName, string societyName, string legalCertification, string telephone, string mainAddress, string generalAddress, string email, string webPage, byte[] logo ) { try { string[] business = new string[] { idBusiness, fantasyName, societyName, legalCertification, telephone, mainAddress, generalAddress, email, webPage }; if (ValidateData.VerifyFields(business)) { BusinessModel businessModel = new BusinessModel() { IdBusiness = int.Parse(idBusiness), FantasyName = fantasyName, SocietyName = societyName, LegalCertification = legalCertification, Telephone = telephone, MainAddress = mainAddress, GeneralAddress = generalAddress, Email = email, WebPage = webPage, Logo = logo }; return(DBBusiness.UpdateBusiness(businessModel)); } else { return(false); } } catch (Exception ex) { return(false); //Log4Net } }
public static bool InsertExternalSellinvoice( int IdClient, int IdEmployee, int IdBusiness, string CurrencyType, decimal IviAmount, decimal CashDeposit, decimal CreditDeposit, decimal TotalDiscount, decimal SubTotal, decimal Total ) { try { string[] externalSellinvoice = new string[] { CurrencyType, }; if (ValidateData.VerifyFields(externalSellinvoice)) { DetailExternalSellinvoiceModel externalSellinvoiceModel = new DetailExternalSellinvoiceModel() { IdClient = IdClient, IdEmployee = IdEmployee, IdBusiness = IdBusiness, CurrencyType = CurrencyType, IviAmount = IviAmount, CashDeposit = CashDeposit, CreditDeposit = CreditDeposit, TotalDiscount = TotalDiscount, SubTotal = SubTotal, Total = Total }; return(DBDetailExternalInvoiceSell.InsertExternalInvoice(externalSellinvoiceModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <returns></returns> public static bool InsertCategory(string name) { try { string[] category = new string[] { name }; if (ValidateData.VerifyFields(category)) { CategoryModel categoryModel = new CategoryModel() { Name = name, }; return(DBCategory.InsertCategory(categoryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="description"></param> /// <returns></returns> public static List <ProductModel> SelectProductByDescription(string description) { try { string[] product = new string[] { description }; if (ValidateData.VerifyFields(product)) { ProductModel productModel = new ProductModel() { Description = description, }; return(DBProduct.SelectDescription(productModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idCategory"></param> /// <returns></returns> //public static CategoryModel SelectCategoryById(string idCategory) //{ // try // { // string[] category = new string[] { idCategory }; // if (ValidateData.VerifyFields(category)) // { // CategoryModel categoryModel = new CategoryModel() // { // IdCategory = int.Parse(idCategory) // }; // return DBCategory.S(categoryModel); // } // else // { // return null; // } // } // catch (Exception ex) // { // //Log4Net // return null; // } //} public static CategoryModel SelectCategoryByName(string name) { try { string[] category = new string[] { name }; if (ValidateData.VerifyFields(category)) { CategoryModel categoryModel = new CategoryModel() { Name = name }; return(DBCategory.SelectCategoryName(categoryModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idSalary"></param> /// <returns></returns> public static bool DeleteSalaryById(string idSalary) { try { string[] salary = new string[] { idSalary }; if (ValidateData.VerifyFields(salary)) { SalaryModel salaryModel = new SalaryModel() { IdSalary = int.Parse(idSalary) }; return(DBSalary.DeleteSalary(salaryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idCategory"></param> /// <returns></returns> public static bool DeleteCategoryById(string idCategory) { try { string[] category = new string[] { idCategory }; if (ValidateData.VerifyFields(category)) { CategoryModel categoryModel = new CategoryModel() { IdCategory = int.Parse(idCategory) }; return(DBCategory.DeleteCategory(categoryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="salaryAmount"></param> /// <param name="registrationDate"></param> /// <returns></returns> public static bool InsertSalary(string salaryAmount) { try { string[] salary = new string[] { salaryAmount }; if (ValidateData.VerifyFields(salary)) { SalaryModel salaryModel = new SalaryModel() { SalaryAmount = decimal.Parse(salaryAmount), }; return(DBSalary.InsertSalary(salaryModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
/// <summary> /// /// </summary> /// <param name="idSalary"></param> /// <returns></returns> public static List <SalaryModel> SelectSalaryById(string idSalary) { try { string[] salary = new string[] { idSalary }; if (ValidateData.VerifyFields(salary)) { SalaryModel salaryModel = new SalaryModel() { IdSalary = int.Parse(idSalary) }; return(DBSalary.SelectidSalary(salaryModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idSellinvoice"></param> /// <returns></returns> public static CreditInvoiceModel SelecCreditInvoiceById(string idSellinvoice) { try { string[] creditInvoice = new string[] { idSellinvoice }; if (ValidateData.VerifyFields(creditInvoice)) { CreditInvoiceModel creditInvoiceModel = new CreditInvoiceModel() { IdSellinvoice = int.Parse(idSellinvoice) }; return(null); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="style"></param> /// <returns></returns> public static ProductModel SelectProductByStyle(string style) { try { string[] product = new string[] { style }; if (ValidateData.VerifyFields(product)) { ProductModel productModel = new ProductModel() { Style = style, }; return(DBProduct.SelectStyle(productModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }
/// <summary> /// /// </summary> /// <param name="idPosition"></param> /// <returns></returns> public static bool DeletePositionById(string idPosition) { try { string[] position = new string[] { idPosition }; if (ValidateData.VerifyFields(position)) { PositionModel positionModel = new PositionModel() { IdPosition = int.Parse(idPosition) }; return(DBPosition.DeletePosition(positionModel)); } else { return(false); } } catch (Exception ex) { //Log4Net return(false); } }
public static List <ProductModel> SelectProductByIdSubCategory(string idSubCategory) { try { string[] product = new string[] { idSubCategory }; if (ValidateData.VerifyFields(product)) { ProductModel productModel = new ProductModel() { IdSubCategory = int.Parse(idSubCategory), }; return(DBProduct.SelectidSubCategory(productModel)); } else { return(null); } } catch (Exception ex) { //Log4Net return(null); } }