예제 #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);
        }
예제 #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);
        }
예제 #3
0
        private void GetTable()
        {
            BrowseGrid.DataSource = null;
            BrowseGrid.Refresh();

            Condition = "  WHERE " + ColumnSearch + " LIKE " + ASPCast.SQLStr("%" + ValueSearch + "%");

            BrowseGrid.DataSource = GDBBrowse.GetTable(Query + Condition);
            TableSetting();
            BrowseGrid.FirstDisplayedCell.Selected = true;

            GDBBrowse.aspQuery.MySqlConnect.CloseConnection();
        }
예제 #4
0
        public ASPMUser_DO SelectByUsername(string Username)
        {
            ASPMUser_DO     MUser     = new ASPMUser_DO();
            string          condition = " WHERE Username = "******"SELECT " + FIELDNAME + " FROM " + TABLENAME + condition;
            MySqlDataReader data      = null;

            if (aspQuery.Select(query, ref data))
            {
                CopyToObject(ref MUser, data);
            }
            aspQuery.MySqlConnect.CloseConnection();
            return(MUser);
        }
예제 #5
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));
        }
예제 #6
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));
        }
예제 #7
0
        public bool SelectByNama(string Nama, ref ASPMGroup_DO MGroup)
        {
            bool            Result    = false;
            string          condition = " WHERE NmMGroup = " + ASPCast.SQLStr(Nama);
            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);
        }
예제 #8
0
        public bool SelectByKode(string Kode, ref ASPMJabatan_DO MJabatan)
        {
            bool            Result    = false;
            string          condition = " WHERE KdMJabatan = " + ASPCast.SQLStr(Kode);
            string          query     = "SELECT " + FIELDNAME + " FROM " + TABLENAME + condition;
            MySqlDataReader data      = null;

            if (aspQuery.Select(query, ref data))
            {
                if (data.HasRows)
                {
                    CopyToObject(ref MJabatan, data);
                    Result = true;
                }
            }
            aspQuery.MySqlConnect.CloseConnection();
            return(Result);
        }
예제 #9
0
        private List <KeyValuePair <string, string> > GetCondition()
        {
            List <KeyValuePair <string, string> > Result       = new List <KeyValuePair <string, string> >();
            KeyValuePair <string, string>         selectedItem = (KeyValuePair <string, string>)CbColumns.SelectedItem;

            if (!EditSearch.Text.Trim().Equals(""))
            {
                Result.Add(new KeyValuePair <string, string>(
                               "`" + selectedItem.Key + "`",
                               ASPCast.SQLStr("%" + EditSearch.Text.Trim() + "%")
                               ));
            }

            Result.Add(new KeyValuePair <string, string>(
                           "`" + selectedItem.Key + "`",
                           CbOrder.SelectedItem.ToString()
                           ));

            return(Result);
        }
예제 #10
0
        public bool FindByKode(String Kode)
        {
            String Condition = "KdMGroup = " + ASPCast.SQLStr(Kode);

            return(aspQuery.Find(Condition));
        }
예제 #11
0
        public bool FindByUsername(String Username)
        {
            String Condition = "Username = " + ASPCast.SQLStr(Username);

            return(aspQuery.Find(Condition));
        }