private void button1_Click(object sender, EventArgs e) { string Result = ""; try { Result = DatabaseCalls.AddItem(ItemNewName_txt.Text, ItemModel_txt.Text, Convert.ToInt32(ItemQuantity_txt.Text), Convert.ToDecimal(ItemPrice_txt.Text), ItemPictureBox.ImageLocation, ItemCategory_txt.Text); if (Result.StartsWith("Item Added with") != true) { Variables.NotificationStatus = true; Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = Result; return; } ItemDataSet = DatabaseCalls.GetItems(); ItemCode_txt.Items.Clear(); foreach (DataRow asdf in ItemDataSet.Tables[0].Rows) { ItemCode_txt.Items.Add(asdf["CODE"]); } ItemCode_txt.Focus(); Variables.NotificationStatus = true; Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = Result; } catch (Exception ex) { Variables.NotificationStatus = true; Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = ex.Message; } }
public void NewRecord() { SubFormGrid.Enabled = false; MPOLineNo_txt.Clear(); MPO_txt.Clear(); ItemCode_txt.Clear(); ItemName_txt.Clear(); Color_txt.Clear(); SawingIn_txt.Clear(); SawingOut_txt.Clear(); PackingOut_txt.Clear(); OrderQty_txt.Clear(); Status_txt.Clear(); cutPrGrpNo_txt.Clear(); //ProductionNo_txt.Clear(); LineNo_txt.Clear(); lbl_G.Text = ""; lbl_I.Text = ""; lbl_H.Text = ""; lbl_J.Text = ""; lbl_A.Text = ""; lbl_B.Text = ""; lbl_C.Text = ""; lbl_D.Text = ""; lbl_E.Text = ""; lbl_F.Text = ""; SubFormGrid.Enabled = true; }
private void AddDataToGrid() { try { decimal PriceMultiplied_TQuantity = (Convert.ToDecimal(Price_txt.Text) * Convert.ToDecimal(TQuantity_txt.Text)); string[] row = { (ConsignmentDataGridView.NewRowIndex + 1).ToString(), ItemCode_txt.Text, Description_txt.Text, Ctn_txt.Text, QtyPerBox_txt.Text, TQuantity_txt.Text, Price_txt.Text, PriceMultiplied_TQuantity.ToString() }; textBox7.Text = (ConsignmentDataGridView.NewRowIndex + 1).ToString(); textBox8.Text = (Convert.ToDecimal(textBox8.Text) + Convert.ToDecimal(Ctn_txt.Text)).ToString(); textBox1.Text = (Convert.ToDecimal(textBox1.Text) + Convert.ToDecimal(TQuantity_txt.Text)).ToString(); textBox9.Text = (Convert.ToDecimal(textBox9.Text) + PriceMultiplied_TQuantity).ToString(); RandomAlgos.AddDataInConsignmentFile((ConsignmentDataGridView.NewRowIndex).ToString(), ItemCode_txt.Text, Description_txt.Text, QtyPerBox_txt.Text, Ctn_txt.Text, TQuantity_txt.Text, Price_txt.Text, (Convert.ToDecimal(TQuantity_txt.Text) * Convert.ToDecimal(Price_txt.Text)).ToString(), ConsignmentNumber_txt.Text, textBox8.Text, textBox7.Text, textBox9.Text); ConsignmentDataGridView.Rows.Add(row); ConsignmentDataGridView.Update(); ItemCode_txt.Text = ""; QtyPerBox_txt.Text = "0"; Description_txt.Text = "None"; Ctn_txt.Text = "0"; TQuantity_txt.Text = "0"; Price_txt.Text = "0"; ItemCode_txt.Focus(); } catch (Exception ex) { Variables.NotificationStatus = true; Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = ex.Message; } }
/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> private bool CheckMandatory() { //if (ItemId_cmb.Text == string.Empty || ItemId_cmb.SelectedIndex < 0) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, ItemId_lbl.Text); // popUpMessage.Warning(messageData, Text); // ItemId_cmb.Focus(); // return false; //} if (ItemCode_txt.Text == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, ItemId_lbl.Text); popUpMessage.Warning(messageData, Text); ItemCode_txt.Focus(); return(false); } if (LineId_cmb.Text == string.Empty || LineId_cmb.SelectedIndex < 0) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, LineId_lbl.Text); popUpMessage.Warning(messageData, Text); LineId_cmb.Focus(); return(false); } return(true); }
/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> private bool CheckMandatory() { if (ItemCode_txt.Text == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, ItemCode_lbl.Text); popUpMessage.Warning(messageData, Text); ItemCode_txt.Focus(); return(false); } if (ItemName_txt.Text == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, ItemName_lbl.Text); popUpMessage.Warning(messageData, Text); ItemName_txt.Focus(); return(false); } if (UnitType_cmb.Text == string.Empty || UnitType_cmb.SelectedIndex < 0) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, UnitType_lbl.Text); popUpMessage.Warning(messageData, Text); UnitType_cmb.Focus(); return(false); } return(true); }
/// <summary> /// form load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InspectionProcessListForm_Load(object sender, EventArgs e) { Ok_btn.Enabled = false; LoadCombo(); ItemCode_txt.Select(); // GridBind(new InspectionProcessVo()); this.Activate(); }
/// <summary> /// form loading /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemForm_Load(object sender, EventArgs e) { if (!this.DesignMode) { Update_btn.Enabled = Delete_btn.Enabled = false; ItemCode_txt.Select(); } }
/// <summary> /// form load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InspectionFormatMasterForm_Load(object sender, EventArgs e) { Ok_btn.Enabled = false; LoadCombo(); ItemCode_txt.Select(); // GridBind(new InspectionFormatVo()); //this.Activate(); }
/// <summary> /// event to clear the controls of search criteria /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Clear_btn_Click(object sender, EventArgs e) { InspectionFormatCode_txt.Text = string.Empty; InspectionFormatName_txt.Text = string.Empty; //ItemId_cmb.SelectedIndex = LineId_cmb.SelectedIndex = -1; LineId_cmb.SelectedIndex = -1; InspectionFormatDetails_dgv.DataSource = null; //ItemId_cmb.Select(); sapItemSearchVo = null; ItemCode_txt.Text = string.Empty; ItemCode_txt.Select(); Process_btn.Enabled = Update_btn.Enabled = Delete_btn.Enabled = false; }
/// <summary> /// form load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InspectionFormatMasterForm_Load(object sender, EventArgs e) { if (DesignMode) { return; } Process_btn.Enabled = Update_btn.Enabled = Delete_btn.Enabled = false; StartProgress(Properties.Resources.mmci00009); LoadCombo(); CompleteProgress(); //ItemId_cmb.Select(); ItemCode_txt.Select(); }
/// <summary> /// Form load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemCodeSearchForm_Load(object sender, EventArgs e) { //if(sapItemSearchVo != null && sapItemSearchVo.GetList() != null && sapItemSearchVo.GetList().Count > 0) //{ // sapItemSearchVo.GetList().ForEach(v => v.SapItemName = v.SapItemName.Replace(v.SapItemCode + " - ", "")); // Item_dgv.AutoGenerateColumns = false; // BindingSource buildingSource = new BindingSource(sapItemSearchVo.GetList(), null); // Item_dgv.DataSource = buildingSource; // Item_dgv.ClearSelection(); // grdCellChecked(true); //} ItemCode_txt.Select(); }
/// <summary> /// form load, loads item data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void AddItemForm_Load(object sender, EventArgs e) { if (!this.DesignMode) { ItemCode_txt.Select(); LoadUnityType(); if (string.Equals(mode, CommonConstants.MODE_UPDATE)) { LoadUserData(updateData); ItemCode_txt.Enabled = false; ItemName_txt.Select(); var resourceMngr = new ResourceManager(this.GetType()); this.Text = resourceMngr.GetString("UpdateForm"); } } }
/// <summary> /// load screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InspectionFormatMasterForm_Load(object sender, EventArgs e) { if (DesignMode) { return; } LoadCombo(); //ItemId_cmb.Select(); ItemCode_txt.Select(); if (updateData != null && updateData.InspectionFormatIdCopy > 0) { InspectionFormatId = updateData.InspectionFormatIdCopy; CopyFormat_txt.Text = updateData.InspectionFormatName; } if (string.Equals(mode, CommonConstants.MODE_UPDATE)) { LoadInspectionFormatData(updateData); //ItemId_cmb.Enabled = false; ItemSearch_btn.Enabled = false; LineId_cmb.Enabled = false; CopyFormat_btn.Enabled = false; InspectionFormatName_txt.Select(); ItemCode_txt.Enabled = false; CopyFormat_txt.Enabled = false; } this.Activate(); }
/// <summary> /// Loads Mold form /// Fill item combobox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemSearchForm_Load(object sender, EventArgs e) { ItemCode_txt.Select(); Ok_btn.Enabled = false; }