public void SaveClient(Client pClient) { SqlCommand cmd; try { cmd = new SqlCommand() { CommandType = CommandType.StoredProcedure, CommandText = "save_client" }; cmd.Parameters.Add("@client_name", SqlDbType.VarChar, 100).Value = pClient.client_name; cmd.Parameters.Add("@client_document", SqlDbType.VarChar, 50).Value = pClient.client_document; cmd.Parameters.Add("@client_birthday", SqlDbType.Date).Value = pClient.client_birthday; tools.Getds(cmd); ResponseStatus = tools.Status(); ResponseMessage = string.IsNullOrEmpty(tools.Error()) ? string.Empty : tools.Error(); } catch (Exception ex) { ResponseMessage = "UserMaint - SaveClient - " + ex.Message; ResponseStatus = false; throw ex; } }
public void SavePayment(Payment pPayment) { SqlCommand cmd; try { cmd = new SqlCommand() { CommandType = CommandType.StoredProcedure, CommandText = "save_payment" }; cmd.Parameters.Add("@client_id", SqlDbType.Int).Value = pPayment.client_id; cmd.Parameters.Add("@transaction_amount", SqlDbType.Money).Value = pPayment.transaction_amount; tools.Getds(cmd); ResponseStatus = tools.Status(); ResponseMessage = string.IsNullOrEmpty(tools.Error()) ? string.Empty : tools.Error(); } catch (Exception ex) { ResponseMessage = "UesrPayment - SavePayment - " + ex.Message; ResponseStatus = false; } }
public SysUser GetUserByUser(string pUser) { SysUser sysUser = new SysUser(); try { SqlCommand cmd = new SqlCommand() { CommandType = CommandType.StoredProcedure, CommandText = "Sys_GetUserByUser" }; cmd.Parameters.Add("@pUser", SqlDbType.VarChar).Value = pUser; sysUser = tools.Getds(cmd).Tables[0].ToList <SysUser>().First(); bStatus = tools.Status(); strMessage = string.IsNullOrEmpty(tools.Error())?string.Empty:tools.Error(); } catch (Exception ex) { bStatus = false; strMessage = "SysUserDB - GetUserByUser - " + ex.Message; sysUser = null; } return(sysUser); }