/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> protected 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.Select(); 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); } if (InspectionFormatName_txt.Text == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, InspectionFormatName_txt.Text); popUpMessage.Warning(messageData, Text); InspectionFormatName_txt.Focus(); return(false); } return(true); }
/// <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(); }