/// <summary> /// To search Program Lead details by different conditions /// </summary> /// <param name="DvProLead"></param> /// <param name="Column"></param> /// <param name="Operator"></param> /// <param name="Value"></param> public void FilterDataview(DataView DvProLead, string Column, string Operator, string Value) { DvProLead.RowFilter = Column + " " + Operator + "'" + Value + "'"; if (DvProLead.ToTable().Rows.Count == 0) { MsgProLead.Msg = "Record(s) not found"; MsgProLead.showmsg(); ViewState["DtProLead"] = DvProLead.ToTable(); BindProLead(DvProLead.ToTable()); ddlCol.SelectedIndex = 0; ddlOpe.SelectedIndex = 0; ddlVal.SelectedIndex = 0; } else { ViewState["DtProLead"] = DvProLead.ToTable(); BindProLead(DvProLead.ToTable()); } }
/// <summary> /// To save and update Program Lead details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { ProgramLeadBAL ProgramLeadBAL = new ProgramLeadBAL(); int UserID = Convert.ToInt32(ddlProLeadUser.SelectedValue.ToString()); string Status = ddlProLeadStatus.SelectedValue.ToString(); bool IsActive = true; if (Status == "Active") { IsActive = true; } else if (Status == "InActive") { IsActive = false; } if (btnSave.Text == "Save") { try { int Result = ProgramLeadBAL.InsertProgramLead(UserID, IsActive, LoginUser, Ret); DtProLead = ProLeadDetails(); ViewState["DtProLead"] = DtProLead; BindProLead(DtProLead); MsgProLead.Msg = "Program Lead added successfully"; MsgProLead.showmsg(); } catch (Exception ee) { if (ee.Message == "DuProLeadicate Entry") { MsgProLead.Msg = "Program Lead already exists"; MsgProLead.showmsg(); ClearProLead(); } } finally { ProgramLeadBAL = null; } } }