public DataResultArgs <bool> Set_Admin(AdminEntity entity) { try { DataProcess.ControlAdminAuthorization(true); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DatabaseProcess", entity.DatabaseProcess); cmd.Parameters.AddWithValue("@id", entity.Id); cmd.Parameters.AddWithValue("@userName", entity.UserName); cmd.Parameters.AddWithValue("@password", entity.Password); cmd.Parameters.AddWithValue("@isActive", entity.IsActive); cmd.Parameters.AddWithValue("@LastLoginDate", entity.LastLoginDate); cmd.Parameters.AddWithValue("@AdminType", entity.AdminType); using (SqlConnection con = Connection.Conn) { con.Open(); DataResultArgs <bool> resultSet = DataProcess.ExecuteProc(con, cmd, "set_Admin"); con.Close(); return(resultSet); } } catch (Exception e) { DataResultArgs <bool> result = new DataResultArgs <bool>(); result.HasError = true; result.ErrorDescription = e.Message; return(result); } }
public DataResultArgs <bool> Set_PaymentType(PaymentTypeEntity entity) { try { DataProcess.ControlAdminAuthorization(true); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DatabaseProcess", entity.DatabaseProcess); cmd.Parameters.AddWithValue("@id", entity.Id); cmd.Parameters.AddWithValue("@name", entity.Name); cmd.Parameters.AddWithValue("@amount", entity.Amount); cmd.Parameters.AddWithValue("@isActive", entity.IsActive); using (SqlConnection con = Connection.Conn) { con.Open(); DataResultArgs <bool> resultSet = DataProcess.ExecuteProc(con, cmd, "set_PaymentType"); con.Close(); staticPaymentTypeList = null; return(resultSet); } } catch (Exception ex) { DataResultArgs <bool> result = new DataResultArgs <bool>(); result.HasError = true; result.ErrorDescription = ex.Message; return(result); } }