Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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));
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 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 + ")";
 }
Beispiel #7
0
        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));
        }
Beispiel #8
0
        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));
        }
Beispiel #9
0
        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);
        }
Beispiel #10
0
        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);
        }
Beispiel #11
0
        public bool Delete(int Id)
        {
            string Query = "DELETE FROM " + TABLENAMED + " WHERE IdMGroup = " + ASPCast.SQLIntToStr(Id);

            return(aspQueryD.ExecCUD(Query));
        }
Beispiel #12
0
        public bool FindById(int Id)
        {
            string condition = "IdMGroup = " + ASPCast.SQLIntToStr(Id);

            return(aspQuery.Find(condition));
        }