/// <summary> /// for load, loads Line and binds treeview /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LineBuildingForm_Load(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; LoadBuilding(); Cursor.Current = Cursors.Default; Building_cmb.Select(); }
/// <summary> /// form load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FactoryProductionDaysMasterForm_Load(object sender, EventArgs e) { GetBuildingInfomation(); Year_txt.Text = Convert.ToString(DateTime.Now.Year); Building_cmb.Select(); Update_btn.Enabled = Delete_btn.Enabled = false; }
/// <summary> /// event to clear the controls of search criteria /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void Clear_btn_Click(object sender, EventArgs e) { Building_cmb.SelectedIndex = -1; Building_cmb.Text = string.Empty; // Year_txt.Text = string.Empty; FactoryProductionDays_dgv.DataSource = null; Building_cmb.Select(); }
/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> private bool CheckMandatory() { if (Building_cmb.SelectedIndex == -1) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Building_lbl.Text); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Building_cmb.Select(); return(false); } if (string.IsNullOrEmpty(Year_txt.Text) || Year_txt.TextLength < 4) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Year_lbl.Text); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Year_txt.Select(); return(false); } if (Month_cmb.SelectedIndex == -1) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, "Month"); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Month_cmb.Select(); return(false); } if (string.IsNullOrEmpty(Date_txt.Text)) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, "Date"); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Date_txt.Select(); return(false); } if (Convert.ToInt32(Date_txt.Text) > 31) { messageData = new MessageData("mmce00023", Properties.Resources.mmce00023); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Date_txt.Text = string.Empty; Date_txt.Select(); return(false); } DateTime dDate; if (!DateTime.TryParse(Year_txt.Text + "-" + Month_cmb.Text + "-" + Date_txt.Text, out dDate)) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, "Validate Date"); logger.Info(messageData); popUpMessage.Warning(messageData, Text); Date_txt.Text = string.Empty; Date_txt.Select(); return(false); } return(true); }
/// <summary> /// load screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddFactoryProductionDaysMasterForm_Load(object sender, EventArgs e) { GetBuildingInfomation(); Building_cmb.Select(); if (string.Equals(mode, CommonConstants.MODE_UPDATE)) { LoadFactoryProductionDaysData(updateData); Building_cmb.Enabled = false; Year_txt.Enabled = false; Month_cmb.Enabled = false; Date_txt.Select(); } }