Beispiel #1
0
 private void EditNmMJabatan_Leave(object sender, EventArgs e)
 {
     if (!EditNmMJabatan.Text.Trim().Equals(""))
     {
         if (GMJabatan.IdMJabatan != 0)
         {
             if (!GMJabatan.NmMJabatan.Equals(EditNmMJabatan.Text.Trim()))
             {
                 if (!GDBMJabatan.SelectByNama(EditNmMJabatan.Text.Trim(), ref GMJabatan))
                 {
                     ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_NOTEXIST, "Nama Jabatan: ", EditNmMJabatan.Text.Trim()));
                     GMJabatan = GDBMJabatan.Clear();
                 }
                 ShowMJabatan(GMJabatan);
             }
         }
         else
         {
             if (!GDBMJabatan.SelectByNama(EditNmMJabatan.Text.Trim(), ref GMJabatan))
             {
                 ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_NOTEXIST, "Nama Jabatan: ", EditNmMJabatan.Text.Trim()));
                 GMJabatan = GDBMJabatan.Clear();
             }
             ShowMJabatan(GMJabatan);
         }
     }
 }
 public void CopyToObject(ref ASPMKaryawan_DO MKaryawan, MySqlDataReader data)
 {
     try
     {
         if (data.Read())
         {
             MKaryawan.IdMKaryawan   = data.GetInt16("IdMKaryawan");
             MKaryawan.KdMKaryawan   = data.GetString("KdMKaryawan");
             MKaryawan.NmMKaryawan   = data.GetString("NmMKaryawan");
             MKaryawan.Alamat        = data.GetString("Alamat");
             MKaryawan.NoHP          = data.GetString("NoHP");
             MKaryawan.IdMJabatan    = data.GetInt16("IdMJabatan");
             MKaryawan.Aktif         = ASPCast.IntToBool(data.GetInt16("Aktif"));
             MKaryawan.IdMUserCreate = data.GetInt16("IdMUserCreate");
             MKaryawan.TglCreate     = data.GetMySqlDateTime("TglCreate");
             MKaryawan.IdMUserUpdate = data.GetInt16("IdMUserUpdate");
             MKaryawan.TglUpdate     = data.GetMySqlDateTime("TglUpdate");
             MKaryawan.Hapus         = ASPCast.IntToBool(data.GetInt16("Hapus"));
         }
     }
     catch (MySqlException ex)
     {
         ASPMsgCmp.WarningMessage(ex.Message);
     }
 }
Beispiel #3
0
        protected override bool CekValidate()
        {
            bool Result = base.CekValidate();

            if (Result)
            {
                if (EditNmMKaryawan.Text.Trim().Equals(""))
                {
                    ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_CANNOTNULL, "Nama Karyawan"));
                    Result = false;
                }
            }

            if (Result)
            {
                if (EditAlamat.Text.Trim().Equals(""))
                {
                    ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_CANNOTNULL, "Alamat"));
                    Result = false;
                }
            }

            if (Result)
            {
                if (EditNoHP.Text.Trim().Equals(""))
                {
                    ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_CANNOTNULL, "No. HP"));
                    Result = false;
                }
            }

            if (Result)
            {
                if (GMJabatan.IdMJabatan == 0)
                {
                    ASPMsgCmp.WarningMessage(string.Format(ASPMessage.wm_CANNOTNULL, "Jabatan"));
                    Result = false;
                }
            }

            if (Result)
            {
                Result = (ASPMsgCmp.QuestionMessage(ASPMessage.cm_SAVE) == DialogResult.Yes);
            }

            return(Result);
        }
Beispiel #4
0
 public void CopyToObject(ref ASPSysInfo_DO SysInfo, MySqlDataReader data)
 {
     try
     {
         //if (data.Read())
         //{
         //    SysInfo.IdSysInfo = data.GetInt16("IdSysInfo");
         //    SysInfo.AppVersion = data.GetString("AppVersion");
         //    SysInfo.LocalLicenseCode = data.GetString("LocalLicenseCode");
         //    SysInfo.GlobalLicenseCode = data.GetString("GlobalLicenseCode");
         //    SysInfo.TrialLicenseCode = data.("TrialLicenseCode");
         //    SysInfo.TrialDateLimit = data.GetMySqlDateTime("TrialDateLimit");
         //}
     }
     catch (MySqlException ex)
     {
         ASPMsgCmp.WarningMessage(ex.Message);
     }
 }
Beispiel #5
0
        public bool Select(String query, ref MySqlDataReader dataReader)
        {
            bool Result = true;

            Command.Connection = MySqlConnect.connection;
            if (!MySqlConnect.IsOpen)
            {
                MySqlConnect.OpenConnection();
            }
            try
            {
                Command.CommandText = query;
                dataReader          = Command.ExecuteReader();
            }
            catch (MySqlException ex)
            {
                ASPMsgCmp.WarningMessage(ex.Message);
                Result = false;
            }

            return(Result);
        }
Beispiel #6
0
 public void CopyToObject(ref ASPMGroup_DO MGroup, MySqlDataReader data)
 {
     try
     {
         if (data.Read())
         {
             MGroup.IdMGroup      = data.GetInt16("IdMGroup");
             MGroup.KdMGroup      = data.GetString("KdMGroup");
             MGroup.NmMGroup      = data.GetString("NmMGroup");
             MGroup.IdMManager    = data.GetInt16("IdMManager");
             MGroup.Aktif         = ASPCast.IntToBool(data.GetInt16("Aktif"));
             MGroup.IdMUserCreate = data.GetInt16("IdMUserCreate");
             MGroup.TglCreate     = data.GetMySqlDateTime("TglCreate");
             MGroup.IdMUserUpdate = data.GetInt16("IdMUserUpdate");
             MGroup.TglUpdate     = data.GetMySqlDateTime("TglUpdate");
             MGroup.Hapus         = ASPCast.IntToBool(data.GetInt16("Hapus"));
         }
     }
     catch (MySqlException ex)
     {
         ASPMsgCmp.WarningMessage(ex.Message);
     }
 }
Beispiel #7
0
 public void CopyToObject(ref ASPMUser_DO MUser, MySqlDataReader data)
 {
     try
     {
         if (data.Read())
         {
             MUser.IdMUser       = data.GetInt16("IdMUser");
             MUser.Username      = data.GetString("Username");
             MUser.Password      = data.GetString("Password");
             MUser.IdMKaryawan   = data.GetInt16("IdMKaryawan");
             MUser.Aktif         = ASPCast.IntToBool(data.GetInt16("Aktif"));
             MUser.IdMUserCreate = data.GetInt16("IdMUserCreate");
             MUser.TglCreate     = data.GetMySqlDateTime("TglCreate");
             MUser.IdMUserUpdate = data.GetInt16("IdMUserUpdate");
             MUser.TglUpdate     = data.GetMySqlDateTime("TglUpdate");
             MUser.Hapus         = ASPCast.IntToBool(data.GetInt16("Hapus"));
         }
     }
     catch (MySqlException ex)
     {
         ASPMsgCmp.WarningMessage(ex.Message);
     }
 }
Beispiel #8
0
        public bool Select(String query, ref BindingSource bindingSource)
        {
            bool             Result = true;
            MySqlDataAdapter adapter;
            DataTable        dataTable = new DataTable();

            if (!MySqlConnect.IsOpen)
            {
                MySqlConnect.OpenConnection();
            }
            try
            {
                adapter = new MySqlDataAdapter(query, MySqlConnect.connection);
                adapter.Fill(dataTable);
                bindingSource.DataSource = dataTable;
            }
            catch (MySqlException ex)
            {
                ASPMsgCmp.WarningMessage(ex.Message);
                Result = false;
            }

            return(Result);
        }