public bool Insert(ASPMGroup_DO MGroup, List <ASPMGroupD_DO> MGroupD) { bool Result = true; string Values = ASPCast.SQLIntToStr(GetNewId()) + ", " + ASPCast.SQLStr(MGroup.KdMGroup) + ", " + ASPCast.SQLStr(MGroup.NmMGroup) + ", " + ASPCast.SQLIntToStr(MGroup.IdMManager) + ", " + ASPCast.SQLBoolToStr(MGroup.Aktif) + ", " + ASPCast.SQLIntToStr(MGroup.IdMUserCreate) + ", " + ASPCast.SQLDateTimeToStr(MGroup.TglCreate) + ", " + ASPCast.SQLIntToStr(MGroup.IdMUserUpdate) + ", " + ASPCast.SQLDateTimeToStr(MGroup.TglUpdate) + ", " + ASPCast.SQLBoolToStr(MGroup.Hapus); string query = "INSERT INTO " + TABLENAME + " (" + FIELDNAME + ") VALUES (" + Values + ")"; if (Result) { Result = GGroupD_DBC.Insert(MGroupD); } if (Result) { Result = aspQuery.ExecCUD(query); } return(Result); }
public bool Update(ASPMGroup_DO MGroup, List <ASPMGroupD_DO> MGroupD) { bool Result = true; string Values = " KdMGroup = " + ASPCast.SQLStr(MGroup.KdMGroup) + ", NmMGroup = " + ASPCast.SQLStr(MGroup.NmMGroup) + ", IdMManager = " + ASPCast.SQLIntToStr(MGroup.IdMManager) + ", Aktif = " + ASPCast.SQLBoolToStr(MGroup.Aktif) + ", IdMUserCreate = " + ASPCast.SQLIntToStr(MGroup.IdMUserCreate) + ", TglCreate = " + ASPCast.SQLDateTimeToStr(MGroup.TglCreate) + ", IdMUserUpdate = " + ASPCast.SQLIntToStr(MGroup.IdMUserUpdate) + ", TglUpdate = " + ASPCast.SQLDateTimeToStr(MGroup.TglUpdate); string condition = " WHERE IdMGroup = " + ASPCast.SQLIntToStr(MGroup.IdMGroup); string query = "UPDATE " + TABLENAME + " SET " + Values + condition; if (Result) { Result = GGroupD_DBC.Delete(MGroup.IdMGroup); } if (Result) { Result = GGroupD_DBC.Insert(MGroupD); } if (Result) { Result = aspQuery.ExecCUD(query); } return(Result); }
public bool Delete(ASPMGroup_DO MGroup) { string Values = "IdMUserUpdate = " + MGroup.IdMUserUpdate + ", TglUpdate = " + MGroup.TglUpdate + ", Hapus = " + MGroup.Hapus; string Condition = " WHERE IdMGroup = " + ASPCast.SQLIntToStr(MGroup.IdMGroup); string Query = "UPDATE " + TABLENAME + " SET " + Values + Condition; return(aspQuery.ExecCUD(Query)); }
public bool Delete(ASPMKaryawan_DO MKaryawan) { string Values = "IdMUserUpdate = " + ASPCast.SQLIntToStr(MKaryawan.IdMUserUpdate) + ", TglUpdate = " + ASPCast.SQLDateTimeToStr(MKaryawan.TglUpdate) + ", Hapus = " + ASPCast.SQLBoolToStr(MKaryawan.Hapus); string Condition = " WHERE IdMKaryawan = " + ASPCast.SQLIntToStr(MKaryawan.IdMKaryawan); string Query = "UPDATE " + TABLENAME + " SET " + Values + Condition; return(aspQuery.ExecCUD(Query)); }
public ASPMUser_DO SelectById(int Id) { ASPMUser_DO MUser = new ASPMUser_DO(); string condition = " WHERE IdMUser = "******"SELECT " + FIELDNAME + " FROM " + TABLENAME + condition; MySqlDataReader data = null; if (aspQuery.Select(query, ref data)) { CopyToObject(ref MUser, data); } return(MUser); }
private void CreateValues(ref string values, List <ASPMGroupD_DO> MGroupD) { values = values + "("; for (int i = 0; i < MGroupD.Count; i++) { values = values + ASPCast.SQLIntToStr(MGroupD[i].IdMGroupD) + ", " + ASPCast.SQLIntToStr(MGroupD[i].IdMGroup) + ", " + ASPCast.SQLIntToStr(MGroupD[i].IdMAnggota); if (i != MGroupD.Count - 1) { values = values + "), ("; } } values = values + ")"; }
public bool Update(ASPMJabatan_DO MJabatan) { string Values = " KdMJabatan = " + ASPCast.SQLStr(MJabatan.KdMJabatan) + ", NmMJabatan = " + ASPCast.SQLStr(MJabatan.NmMJabatan) + ", Aktif = " + ASPCast.SQLBoolToStr(MJabatan.Aktif) + ", IdMUserCreate = " + ASPCast.SQLIntToStr(MJabatan.IdMUserCreate) + ", TglCreate = " + ASPCast.SQLDateTimeToStr(MJabatan.TglCreate) + ", IdMUserUpdate = " + ASPCast.SQLIntToStr(MJabatan.IdMUserUpdate) + ", TglUpdate = " + ASPCast.SQLDateTimeToStr(MJabatan.TglUpdate); string condition = " WHERE IdMJabatan = " + ASPCast.SQLIntToStr(MJabatan.IdMJabatan); string query = "UPDATE " + TABLENAME + " SET " + Values + condition; return(aspQuery.ExecCUD(query)); }
public bool Insert(ASPMJabatan_DO MJabatan) { string Values = ASPCast.SQLIntToStr(GetNewId()) + ", " + ASPCast.SQLStr(MJabatan.KdMJabatan) + ", " + ASPCast.SQLStr(MJabatan.NmMJabatan) + ", " + ASPCast.SQLBoolToStr(MJabatan.Aktif) + ", " + ASPCast.SQLIntToStr(MJabatan.IdMUserCreate) + ", " + ASPCast.SQLDateTimeToStr(MJabatan.TglCreate) + ", " + ASPCast.SQLIntToStr(MJabatan.IdMUserUpdate) + ", " + ASPCast.SQLDateTimeToStr(MJabatan.TglUpdate) + ", " + ASPCast.SQLBoolToStr(MJabatan.Hapus); string query = "INSERT INTO " + TABLENAME + " (" + FIELDNAME + ") VALUES (" + Values + ")"; return(aspQuery.ExecCUD(query)); }
public bool SelectById(int Id, ref ASPMGroup_DO MGroup) { bool Result = false; string condition = " WHERE IdMGroup = " + ASPCast.SQLIntToStr(Id); string query = "SELECT " + FIELDNAME + " FROM " + TABLENAME + condition; MySqlDataReader data = null; if (aspQuery.Select(query, ref data)) { if (data.HasRows) { CopyToObject(ref MGroup, data); Result = true; } } aspQuery.MySqlConnect.CloseConnection(); return(Result); }
public bool SelectById(int Id, ref ASPSysInfo_DO SysInfo) { bool Result = true; string condition = " WHERE IdSysInfo = " + ASPCast.SQLIntToStr(Id); string query = "SELECT " + FIELDNAME + " FROM " + TABLENAME + condition; MySqlDataReader data = null; if (aspQuery.Select(query, ref data)) { CopyToObject(ref SysInfo, data); } else { Result = false; } return(Result); }
public bool Delete(int Id) { string Query = "DELETE FROM " + TABLENAMED + " WHERE IdMGroup = " + ASPCast.SQLIntToStr(Id); return(aspQueryD.ExecCUD(Query)); }
public bool FindById(int Id) { string condition = "IdMGroup = " + ASPCast.SQLIntToStr(Id); return(aspQuery.Find(condition)); }