private void FrmAddItem_Load(object sender, EventArgs e) { if (!IS_UPDATING) { //get max item Id txt_itemID.Text = MANAGEDB.getMaxItemId().ToString(); this.WindowState = FormWindowState.Maximized; } }
/// <summary> /// when create item /// </summary> /// <param name="userName"></param> public FrmAddItem(string userName) { COM_MESSAGE = new CommonControls.Classes.ClsMessages(); VALIDATION = new CommonControls.Classes.ClsValidation(); COMM_METHODS = new CommonControls.Classes.ClsCommonMethods(); CREATEITEM = new BLL.ClsItemData(); MANAGEDB = new BLL.ClsInventoryManageDbChanges(); InitializeComponent(); txt_itemID.Text = MANAGEDB.getMaxItemId().ToString(); //fill data for itemType from db dropDown_itemType.DataSource = MANAGEDB.getItemTypeList(); dropDown_itemType.DisplayMember = "itemType"; dropDown_itemType.ValueMember = "typeId"; dropDown_itemType.BindingContext = this.BindingContext; dropDown_itemType.SelectedIndex = -1; USERNAME = userName; btn_cancel.Visible = true; btn_create.Visible = true; btn_delete.Visible = false; btn_update.Visible = false; this.WindowState = FormWindowState.Maximized; this.ActiveControl = txt_itemCode; }