protected void btnSave_Click(object sender, EventArgs e) { try { if (Mode == "Insert") { if (!LeadTypeController.IsLeadType(txtLeadType.Text.Trim())) { InsertLeadType(); ClearValues(); PanelVisibility(true, false); BindGrid(); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), new Guid().ToString(), "MessageBox('Message','LeadType already exists..!');", true); } } else { UpdateLeadType(); ClearValues(); PanelVisibility(true, false); BindGrid(); } } catch (Exception ex) { throw ex; } }
private void BindLeadTypeValues() { try { LeadTypeMaster objLeadTypeMaster = LeadTypeController.GetLeadTypeByID(LeadId); txtLeadType.Text = objLeadTypeMaster.LeadTypeName; } catch (Exception ex) { throw ex; } }
private void BindGrid() { try { grdLeadType.DataSource = LeadTypeController.GetLeadTypes(txtSearchText.Text, SortField, SortDir); grdLeadType.DataBind(); } catch (Exception ex) { throw ex; } }
private void UpdateLeadType() { try { LeadTypeMaster objLeadTypeMaster = LeadTypeController.GetLeadTypeByID(LeadId); objLeadTypeMaster.LeadTypeName = txtLeadType.Text; new LeadTypeController().UpdateLeadType(objLeadTypeMaster); } catch (Exception ex) { throw ex; } }
private void InsertLeadType() { try { LeadTypeMaster objLeadTypes = new LeadTypeMaster(); objLeadTypes.LeadTypeName = txtLeadType.Text; objLeadTypes = new LeadTypeController().InsertLeadType(objLeadTypes); } catch (Exception ex) { throw ex; } }