public MainWindow() { InitializeComponent(); TxtTitle.Focus(); _noteServices = new NoteServices(); _notes = new List <Note>(); }
protected void BtnSave_Click(object sender, EventArgs e) { int InsertRow = 0; try { Ds = Obj_TermsConditionMaster.ChkDuplicate(TxtTitle.Text.Trim(), out StrError); if (Ds.Tables[0].Rows.Count > 0) { obj_Comman.ShowPopUpMsg("Title Name Already Exist..!", this.Page); TxtTitle.Focus(); } else { Entity_TermsConditionMaster.Title = TxtTitle.Text; Entity_TermsConditionMaster.TermsConditions = TxtDescription.Text; Entity_TermsConditionMaster.UserId = Convert.ToInt32(Session["UserId"]); Entity_TermsConditionMaster.LoginDate = DateTime.Now; InsertRow = Obj_TermsConditionMaster.InsertRecord(ref Entity_TermsConditionMaster, out StrError); if (InsertRow > 0) { obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page); MakeEmptyForm(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { TxtTitle.Focus(); this.Form.DefaultButton = BtnAdd.UniqueID; } LblDuplicateTitleError.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { TxtTitle.Focus(); this.Form.DefaultButton = BtnUpdate.UniqueID; MyJobPortalModel.Title ObjTitle = new MyJobPortalModel.Title(int.Parse(Request.QueryString["Id"])); TxtTitle.Text = ObjTitle.TitleName; DdlGender.SelectedValue = ObjTitle.ApplicableToGender; DdlStatus.SelectedValue = ObjTitle.Status; } }
private void CtrlNHandler() { if ((TrVwNotesList.SelectedNode as NoteNode)?.IsSaved ?? true) { TxtTitle.Text = RTxtDesc.Text = string.Empty; TxtTitle.Enabled = RTxtDesc.Enabled = true; TxtTitle.Focus(); TreeNode node = new NoteNode(); node.ForeColor = Color.Yellow; node.BackColor = Color.Red; TrVwNotesList.Nodes.Add(node); TrVwNotesList.SelectedNode = node; } }
private void MakeEmptyForm() { ViewState["EditID"] = null; if (!FlagAdd) { BtnSave.Visible = true; } BtnUpdate.Visible = false; BtnDelete.Visible = false; TxtTitle.Text = string.Empty; TxtDescription.Text = string.Empty; // GetSupplierCode(); ReportGrid(StrCondition); TxtTitle.Focus(); }
private bool CheckValues() { if (string.IsNullOrEmpty(CboDocumentType.Text)) { MessageBox.Show("请选择或输入文件类型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); CboDocumentType.Focus(); return(false); } if (string.IsNullOrEmpty(CboSecretLevel.Text)) { MessageBox.Show("请选择文件密级", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); CboSecretLevel.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTitle.Text)) { MessageBox.Show("请输入文件标题", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); TxtTitle.Focus(); return(false); } if (string.IsNullOrEmpty(TxtSerialNum.Text) && string.IsNullOrEmpty(TxtISN.Text)) { //文号或机号至少要填写一个 MessageBox.Show("文号或机号至少要填写一个", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (string.IsNullOrEmpty(TxtISN.Text)) { TxtISN.Focus(); } else { TxtSerialNum.Focus(); } return(false); } if (NumQuantity.Value <= 0) { MessageBox.Show("来文份数应为大于0的整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); NumQuantity.Focus(); return(false); } return(true); }
protected void BtnUpdate_Click(object sender, EventArgs e) { if (this.IsValid == true) { bool AllOk = true; DataTable ObjTitleTable = MyJobPortalModel.Title.GetTitleRecords("TitleName ='" + TxtTitle.Text.Replace("'", "''").Trim() + "' and Id<>" + Request.QueryString["Id"]); if ((int)ObjTitleTable.Rows.Count > 0) { LblDuplicateTitleError.Visible = true; AllOk = false; TxtTitle.Focus(); return; } if (AllOk == true) { MyJobPortalModel.Title ObjTitle = new MyJobPortalModel.Title(int.Parse(Request.QueryString["Id"])); ObjTitle.TitleName = TxtTitle.Text.Replace("'", "''"); ObjTitle.ApplicableToGender = DdlGender.SelectedValue; ObjTitle.Status = DdlStatus.SelectedValue; ObjTitle.Update(); Response.Redirect("TitleList.aspx?Message=Record has been Updated"); } } }
private void Window_ContentRendered(object sender, EventArgs e) { TxtTitle.Focus(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { TxtTitle.Focus(); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { TxtTitle.Focus(); }
/*************************************** * * This is where the EMPLOYEE DATA METHODS are. * ***************************************/ /// <summary> /// This will check the shared values for all employee fields /// </summary> /// <param name="creatingEmployee"> This is the employee that needs to be saved.</param> /// <returns></returns> private bool CheckBaseValues(Employee creatingEmployee) { uint tempUint = 0; if (uint.TryParse(TxtEmpID.Text, out tempUint)) { creatingEmployee.EmpID = tempUint; } else { LblStatus.Text = errorMessageUint; TxtEmpID.Focus(); return(false); } if (TxtLastName.Text == "") { LblStatus.Text = "Last name cannot be empty."; TxtLastName.Focus(); return(false); } if (TxtFirstName.Text == "") { LblStatus.Text = "First name cannot be empty."; TxtFirstName.Focus(); return(false); } if (TxtMaritalStatus.Text == "") { LblStatus.Text = "Marital Status cannont be empty."; TxtMaritalStatus.Focus(); return(false); } if (TxtDepartment.Text == "") { LblStatus.Text = "Department cannont be empty."; TxtDepartment.Focus(); return(false); } if (TxtTitle.Text == "") { LblStatus.Text = "Title cannot be emtpy."; TxtTitle.Focus(); return(false); } if (TxtStartDate.Text == "") { LblStatus.Text = "Start Date cannot be empty."; TxtStartDate.Focus(); return(false); } /* * //Middle Name Not required. * if (TxtMiddleName.Text == "") * { * LblStatus.Text = "Middle name cannot be empty."; * TxtMiddleName.Focus(); * return false; * } */ creatingEmployee.EmpType = CbxEmployeeType.Text; creatingEmployee.FirstName = TxtFirstName.Text; creatingEmployee.LastName = TxtLastName.Text; creatingEmployee.MiddleName = TxtMiddleName.Text; creatingEmployee.MaritalStatus = TxtMaritalStatus.Text; creatingEmployee.Department = TxtDepartment.Text; creatingEmployee.Title = TxtTitle.Text; creatingEmployee.StartDate = TxtStartDate.Text; if (CkbBenefits.Checked) { creatingEmployee.Benefits = true; } else { creatingEmployee.Benefits = false; } if (CkbActiveEmployee.Checked) { creatingEmployee.ActiveEmployee = true; } else { creatingEmployee.ActiveEmployee = false; } return(true); }