コード例 #1
0
        private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }

            if (!(itemTypeIdLabel1.Text.Trim().Equals("0") || string.IsNullOrEmpty(itemTypeIdLabel1.Text.Trim())))
            {
                tipe = (MItemType)DataMaster.GetObjectByProperty(typeof(MItemType), MItemType.ColumnNames.ItemTypeId, int.Parse(itemTypeIdLabel1.Text));
            }
            else
            {
                tipe = new MItemType();
            }

            tipe.ItemTypeName = itemTypeNameTextBox.Text;
            tipe.ModifiedBy   = lbl_UserName.Text;
            tipe.ModifiedDate = DateTime.Now;

            DataMaster.SaveOrUpdate(tipe);

            ModuleControlSettings.SaveLog(ListOfAction.Update, itemTypeNameTextBox.Text, ListOfTable.MGroup, lbl_UserName.Text);
            BindData();
        }
コード例 #2
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(itemTypeIdLabel1.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             tipe = (MItemType)DataMaster.GetObjectByProperty(typeof(MItemType), MItemType.ColumnNames.ItemTypeId, int.Parse(itemTypeIdLabel1.Text));
             DataMaster.Delete(tipe);
             ModuleControlSettings.SaveLog(ListOfAction.Delete, itemTypeNameTextBox.Text, ListOfTable.MGroup, lbl_UserName.Text);
             BindData();
         }
     }
 }