private void AddProcessWForm_Load(object sender, EventArgs e) { ValueObjectList <ModelVo> modelvolist = (ValueObjectList <ModelVo>)DefaultCbmInvoker.Invoke(new GetModelCbm(), new ModelVo()); Model_cmb.DisplayMember = "ModelCode"; BindingSource b1 = new BindingSource(modelvolist.GetList(), null); Model_cmb.DataSource = b1; Model_cmb.Text = ""; ProcessVo processvo = (ProcessVo)DefaultCbmInvoker.Invoke(new GetProcessMasterMntCbm(), new ProcessVo()); Assy_cmb.DisplayMember = "ProcessName"; BindingSource b2 = new BindingSource(processvo.ProcessListVo, null); Assy_cmb.DataSource = b2; Assy_cmb.Text = ""; MachineVo machinevo = (MachineVo)DefaultCbmInvoker.Invoke(new GetMachineMasterMntCbm(), new MachineVo()); Machine_cmb.DisplayMember = "MachineName"; BindingSource b4 = new BindingSource(machinevo.MachineListVo, null); Machine_cmb.DataSource = b4; Machine_cmb.Text = ""; ProcessCode_txt.Select(); Model_cmb.ResetText(); Assy_cmb.ResetText(); Machine_cmb.ResetText(); if (vo.ProcessWorkId > 0) { ProcessCode_txt.Text = vo.ProcessWorkCode; ProcessName_txt.Text = vo.ProcessWorkName; Model_cmb.Text = vo.Model; Assy_cmb.Text = vo.Assy; Machine_cmb.Text = vo.Machine; } }
/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> private bool CheckMandatory() { if (MoldCode_txt.Text == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, MoldCode_lbl.Text); popUpMessage.Warning(messageData, Text); MoldCode_txt.Focus(); return(false); } //if (string.IsNullOrWhiteSpace(GlobalItemCode_txt.Text)) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, GlobalItemCode_lbl.Text); // popUpMessage.Warning(messageData, Text); // MoldCode_txt.Focus(); // return false; //} //if (MoldName_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, MoldName_lbl.Text); // popUpMessage.Warning(messageData, Text); // MoldName_txt.Focus(); // return false; //} //if (Width_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Width_lbl.Text); // popUpMessage.Warning(messageData, Text); // Width_txt.Focus(); // return false; //} //if (Depth_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Depth_lbl.Text); // popUpMessage.Warning(messageData, Text); // Depth_txt.Focus(); // return false; //} //if (Height_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Height_lbl.Text); // popUpMessage.Warning(messageData, Text); // Height_txt.Focus(); // return false; //} //if (Weight_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Weight_lbl.Text); // popUpMessage.Warning(messageData, Text); // Weight_txt.Focus(); // return false; //} //if (FixedAssetNo_txt.Text == string.Empty) //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, FixedAssetNo_lbl.Text); // popUpMessage.Warning(messageData, Text); // FixedAssetNo_txt.Focus(); // return false; //} //if (LifeShotCount_txt.Text == string.Empty || LifeShotCount_txt.Text == "0") //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, LifeShotCount_lbl.Text); // popUpMessage.Warning(messageData, Text); // LifeShotCount_txt.Focus(); // return false; //} if (!(MoldCategory_cmb.SelectedIndex > -1)) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, MoldCategory_lbl.Text); popUpMessage.Warning(messageData, Text); MoldCategory_cmb.Focus(); return(false); } if (!(Model_cmb.SelectedIndex > -1)) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Model_lbl.Text); popUpMessage.Warning(messageData, Text); Model_cmb.Focus(); return(false); } //if (LifeAlarmShot_txt.Text == string.Empty || LifeAlarmShot_txt.Text == "0") //{ // messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, LifeAlarmShotCount_lbl.Text); // popUpMessage.Warning(messageData, Text); // LifeAlarmShot_txt.Focus(); // return false; //} if (string.IsNullOrWhiteSpace(MoldDrawingNo_txt.Text)) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, MoldDrawingNo_lbl.Text); popUpMessage.Warning(messageData, Text); MoldDrawingNo_txt.Focus(); return(false); } return(true); }