public string Dao_InsertCashRegisterOutPut(BoCashRegister pCashRegister) { this.LListParam = new List <SqlParameter>(); dao_Addparameters(this.LListParam, SqlDbType.Int, "@IdCashRegister", pCashRegister.LIdCashRegister.ToString()); dao_Addparameters(this.LListParam, SqlDbType.Decimal, "@ValueInput", pCashRegister.LValue.ToString()); dao_Addparameters(this.LListParam, SqlDbType.VarChar, "@Description", pCashRegister.LDescription); return(Dao_executeSqlTransactionWithProcedement(this.LListParam, "LTranInsertCashOutPut", "spr_CreateCashOutPut")); }
public string bll_DeleteCash(int pIdCash, bool pIsInput) { var lCash = new BoCashRegister { LIdCash = pIdCash }; return(pIsInput ? this.LiCashRegister.Dao_DeleteCashRegisterInput(lCash) : this.LiCashRegister.Dao_DeleteCashRegisterOutPut(lCash)); }
public string bll_CreateCashInput(int pIdCashRegister, decimal pValue, string pDescription) { var lCashOutPut = new BoCashRegister { LIdCashRegister = pIdCashRegister, LValue = pValue, LDescription = pDescription }; return(this.LiCashRegister.Dao_InsertCashRegisterInput(lCashOutPut)); }
public List <BoCashRegister> Dao_getListLastCashRegister() { SqlConnection lConex = new SqlConnection(); using (lConex = DaoUtilsLib.Dao_SqlConnection(lConex)) { var lListCashRegister = new List <BoCashRegister>(); try { var lCommand = new SqlCommand { CommandText = "spr_GetAllItemsCashRegister", CommandTimeout = 30, CommandType = CommandType.StoredProcedure, Connection = lConex }; var lReader = lCommand.ExecuteReader(); if (lReader.HasRows) { while (lReader.Read()) { var lCashRegister = new BoCashRegister { LCreationDate = Convert.ToDateTime(lReader["CreationDate"].ToString()), LModificationDate = Convert.ToDateTime(lReader["ModificationDate"].ToString()), LValue = Convert.ToDecimal(lReader["Value"].ToString()), LDescription = lReader["Description"].ToString(), LIdCash = Convert.ToInt32(lReader["IdCash"].ToString()), LIdCashRegister = Convert.ToInt32(lReader["IdCashRegister"].ToString()), LIsInput = Convert.ToBoolean(lReader["IsInput"].ToString()) }; lListCashRegister.Add(lCashRegister); } } DaoUtilsLib.Dao_CloseSqlconnection(lConex); return(lListCashRegister); } catch (Exception e) { lListCashRegister = new List <BoCashRegister>(); var lCash = new BoCashRegister { LException = e.Message, LMessageDao = BoErrors.MsgErrorGetSql }; if (e.InnerException != null) { lCash.LInnerException = e.InnerException.ToString(); } DaoUtilsLib.Dao_CloseSqlconnection(lConex); lListCashRegister.Add(lCash); return(lListCashRegister); } } }
public static MCashRegister ToMCashRegister(this BoCashRegister pCashRegister) { var lMCashRegister = new MCashRegister { LDescription = pCashRegister.LDescription, LIdCash = pCashRegister.LIdCash, LIdCashRegister = pCashRegister.LIdCashRegister, LIsInput = pCashRegister.LIsInput, LValue = pCashRegister.LValue, LCreationDate = pCashRegister.LCreationDate, LModificationDate = pCashRegister.LModificationDate }; return(lMCashRegister); }
public BoCashRegister Dao_getCashOutPut(int pIdCash) { SqlConnection lConex = new SqlConnection(); using (lConex = DaoUtilsLib.Dao_SqlConnection(lConex)) { var lCashOutPut = new BoCashRegister(); try { var lCommand = new SqlCommand { CommandText = "spr_GetCashOutPut", CommandTimeout = 30, CommandType = CommandType.StoredProcedure, Connection = lConex }; lCommand.Parameters.Add(new SqlParameter("IdCash", pIdCash)); var lReader = lCommand.ExecuteReader(); if (lReader.HasRows) { while (lReader.Read()) { lCashOutPut.LCreationDate = Convert.ToDateTime(lReader["CreationDate"].ToString()); lCashOutPut.LModificationDate = Convert.ToDateTime(lReader["ModificationDate"].ToString()); lCashOutPut.LValue = Convert.ToDecimal(lReader["ValueOutPut"].ToString()); lCashOutPut.LDescription = lReader["Descriptions"].ToString(); lCashOutPut.LIdCash = Convert.ToInt32(lReader["IdCashOutPut"].ToString()); lCashOutPut.LIsInput = true; } } DaoUtilsLib.Dao_CloseSqlconnection(lConex); return(lCashOutPut); } catch (Exception e) { lCashOutPut = new BoCashRegister { LException = e.Message, LMessageDao = BoErrors.MsgErrorGetSql }; if (e.InnerException != null) { lCashOutPut.LInnerException = e.InnerException.ToString(); } DaoUtilsLib.Dao_CloseSqlconnection(lConex); return(lCashOutPut); } } }
public string Dao_DeleteCashRegisterOutPut(BoCashRegister pCashRegister) { this.LListParam = new List <SqlParameter>(); dao_Addparameters(this.LListParam, SqlDbType.Int, "@IdCash", pCashRegister.LIdCash.ToString()); return(Dao_executeSqlTransactionWithProcedement(this.LListParam, "LTranDeleteCashOutPut", "spr_DeleteCashOutPut")); }