You are on page 1of 16

using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.

Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using Kotak.Data.Services; using Kotak.Data.Domains; using System.Collections.Generic; using System.Reflection; using System.IO; using log4net; public partial class AddEmployeeMaster : System.Web.UI.Page { #region PAGE EVENTS #region PAGE LOAD EVENTS protected Int32 Photoid = 0; protected Int32 Signid = 0;

/// <summary> /// On Loading the page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// private static readonly ILog log = LogManager.GetLogger(typeof(AddEmployeeMaster).Name); protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { FetchCompanyCode(); FetchDesgination(); FetchDepartment(); Page.Form.DefaultButton = btnSave.UniqueID; if (Request.QueryString["emplrecordid"] != null && Request.Query String["emplrecordid"] != String.Empty) { Photoid = Convert.ToInt32(Request.QueryString["emplrecordid" ]); Signid = Convert.ToInt32(Request.QueryString["emplrecordid"] ); btnSave.AlternateText = "Update"; btnSave.ToolTip = "Update Employee Master"; btnSave.ImageUrl = "~/images/newUpdateButton.jpg"; BindControls(); btnAdd.Visible = false;

ImagePhoto.Attributes.Add("onclick", "window.open('ImageHand ler.ashx?Photoid=" + Photoid + "', 'newwindow','toolbar=yes,location=no,menubar= no,width=450,height=450,resizable=yes,scrollbars=yes,top=200,left=250');return f alse;"); imageSign.Attributes.Add("onclick", "window.open('ImageHandl er.ashx?Signid=" + Signid + "', 'newwindow','toolbar=yes,location=no,menubar=no, width=450,height=450,resizable=yes,scrollbars=yes,top=200,left=250');return fals e;"); } else { btnSave.AlternateText = "Save"; btnSave.ToolTip = "Save Employee Master"; btnSave.ImageUrl = "~/images/Save_Button.jpg"; ClearControls(); btnAdd.Visible = true; imageSign.Visible = false; ImagePhoto.Visible = false; trImagePhoto.Visible = false; trimageSign.Visible = false; //trDeleteRow.Visible = false; //trdeleterow1.Visible = false; } } else { if (lblpopupvisibilityHidden.Text != "" && lblpopupvisibilityHid den.Text != null) { Control toAdd = new Control(); String CurrentLOV_Desc = String.Empty; String CurrentLookupID = String.Empty; String FillControlID = String.Empty; if (lblpopupvisibilityHidden.Text == Enum.GetName(typeof(Dom ainBase.SYS_LOV_DESC), DomainBase.SYS_LOV_DESC.AUTH_SIG_LOB_LOV)) { Kotak.Data.Domains.ListItem item = LOVService.GetListOfV alues(lblpopupvisibilityHidden.Text); CurrentLOV_Desc = item.ReturnValue1; CurrentLookupID = DBNull.Value.ToString(); FillControlID = txtlob.ID; toAdd = LoadControl("~/UserControls/LookupList.ascx", Cu rrentLOV_Desc, CurrentLookupID, FillControlID, lblpopupvisibilityHidden.ID, true ); } else if (lblpopupvisibilityHidden.Text == Enum.GetName(typeo f(DomainBase.SYS_LOV_DESC), DomainBase.SYS_LOV_DESC.AUTH_SIG_LOC_LOV)) { Kotak.Data.Domains.ListItem item = LOVService.GetListOfV alues(lblpopupvisibilityHidden.Text); CurrentLOV_Desc = item.ReturnValue1; CurrentLookupID = DBNull.Value.ToString(); FillControlID = txtloc.ID; toAdd = LoadControl("~/UserControls/LookupList.ascx", Cu rrentLOV_Desc, CurrentLookupID, FillControlID, lblpopupvisibilityHidden.ID, true ); } else if (lblpopupvisibilityHidden.Text == Enum.GetName(typeo

f(DomainBase.SYS_LOV_DESC), DomainBase.SYS_LOV_DESC.AUTH_SIG_CC_LOV)) { Kotak.Data.Domains.ListItem item = LOVService.GetListOfV alues(lblpopupvisibilityHidden.Text); CurrentLOV_Desc = item.ReturnValue1; CurrentLookupID = DBNull.Value.ToString(); FillControlID = txtcc.ID; toAdd = LoadControl("~/UserControls/LookupList.ascx", Cu rrentLOV_Desc, CurrentLookupID, FillControlID, lblpopupvisibilityHidden.ID, true ); } divLookup.Controls.Add(toAdd); } } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #region BUTTON CLICK EVENT

protected void btnSave_Click(object sender, ImageClickEventArgs e) { try { EmployeeMaster EmployeeMasterdetail = new EmployeeMaster(); if (FillEmployeeMasterDetail(ref EmployeeMasterdetail)) { if (Page.IsValid) { Message.ClearMessage(); if (SessionMapper.CurrentUser != null) EmployeeMasterdetail.LoginId = SessionMapper.CurrentUser .ToString(); else Response.Redirect("UnauthorizedLogin.aspx"); bool result = EmployeeMasterMapper.SaveEmployeeMaster(Employ eeMasterdetail); if (result) { Message.ClearMessage(); Message.ShowMessage(EmployeeMasterdetail.ErrorCode + ":" + EmployeeMasterdetail.ErrorDesc, AppMessages.MessageType.Info); Response.Redirect("EmployeeMaster.aspx?Mode=S"); } else { Message.ClearMessage(); Message.ShowMessage(EmployeeMasterdetail.ErrorCode + ":"

+ EmployeeMasterdetail.ErrorDesc, AppMessages.MessageType.Error); } ClearControls(); } } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void btnCancel_Click(object sender, ImageClickEventArgs e) { try { Response.Redirect("EmployeeMaster.aspx?Mode=C"); } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void btnAdd_Click(object sender, ImageClickEventArgs e) { try { ClearControls(); Session["emplrecordid"] = ""; btnSave.AlternateText = "Save"; btnSave.ToolTip = "Save Employee Master"; btnSave.ImageUrl = "~/images/Save_Button.jpg"; } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #region USER DEFINED METHODS //Fill exchange obj for trasfering To DB private bool FillEmployeeMasterDetail(ref EmployeeMaster EmployeeMasterdetai l) { try { EmployeeMaster objEmp = new EmployeeMaster();

if (Request.QueryString["emplrecordid"] ng["emplrecordid"].ToString() != String.Empty) { EmployeeMasterdetail.DbActionMode = se.DBACTIONMODE), DomainBase.DBACTIONMODE.UPDATE); EmployeeMasterdetail.emplrecordid = yString["emplrecordid"]); } else { EmployeeMasterdetail.DbActionMode = se.DBACTIONMODE), DomainBase.DBACTIONMODE.INSERT); EmployeeMasterdetail.emplrecordid = }

!= null && Request.QueryStri Enum.GetName(typeof(DomainBa Convert.ToInt32(Request.Quer

Enum.GetName(typeof(DomainBa 0;

//Upload Photo Image string PhotImagefilename = Path.GetFileName(filephotoimage.FileName) ; if (PhotImagefilename != string.Empty) { string FileUploadLocation = Server.MapPath("~/") + "UploadImages //" + PhotImagefilename; filephotoimage.SaveAs(FileUploadLocation); using (FileStream fs = new FileStream(FileUploadLocation, FileMo de.Open, FileAccess.Read)) { byte[] imageData = new Byte[fs.Length]; fs.Read(imageData, 0, System.Convert.ToInt32(fs.Length)); fs.Close(); EmployeeMasterdetail.photoimage = imageData; EmployeeMasterdetail.photo_image_ext = filephotoimage.Posted File.ContentType; } FileInfo TheFile = new FileInfo(FileUploadLocation); if (TheFile.Exists) { File.Delete(FileUploadLocation); } } else if (Request.QueryString["emplrecordid"] != null) { if (Session["EmployeeMaster"] != null) { objEmp = (EmployeeMaster)Session["EmployeeMaster"]; if (objEmp.photoimage != null) { if (objEmp.photo_image_ext != "application/pdf") { EmployeeMasterdetail.photoimage = objEmp.photoimage; EmployeeMasterdetail.photo_image_ext = objEmp.photo_ image_ext; } else { EmployeeMasterdetail.photoimage = null;

EmployeeMasterdetail.photo_image_ext = null; } } } else { if (SessionMapper.CurrentUser != null) EmployeeMasterdetail.LoginId = SessionMapper.CurrentUser .ToString(); else Response.Redirect("UnauthorizedLogin.aspx"); } } else if (EmployeeMasterdetail.photoimage == null) { EmployeeMasterdetail.photoimage = null; EmployeeMasterdetail.photo_image_ext = null; } //Upload Signature Image string strfilesignatureimage = Path.GetFileName(filesignatureimage.F ileName); if (strfilesignatureimage != string.Empty) { string FileSignatureUploadLocation = Server.MapPath("~/") + "Upl oadImages//" + strfilesignatureimage; filesignatureimage.SaveAs(FileSignatureUploadLocation); using (FileStream fs = new FileStream(FileSignatureUploadLocatio n, FileMode.Open, FileAccess.Read)) { byte[] signatureimage = new Byte[fs.Length]; fs.Read(signatureimage, 0, System.Convert.ToInt32(fs.Length) ); fs.Close(); EmployeeMasterdetail.signatureimage = signatureimage; EmployeeMasterdetail.signature_image_ext = filesignatureimag e.PostedFile.ContentType; } FileInfo TheFile = new FileInfo(FileSignatureUploadLocation); if (TheFile.Exists) { File.Delete(FileSignatureUploadLocation); } } else if (Request.QueryString["emplrecordid"] != null) { if (Session["EmployeeMaster"] != null) { objEmp = (EmployeeMaster)Session["EmployeeMaster"]; if (objEmp.signatureimage != null) { if (objEmp.signature_image_ext != "application/pdf") { EmployeeMasterdetail.signatureimage = objEmp.signatu

reimage; EmployeeMasterdetail.signature_image_ext = objEmp.si gnature_image_ext; } else { EmployeeMasterdetail.signatureimage = null; EmployeeMasterdetail.signature_image_ext = null; } } } else { if (SessionMapper.CurrentUser != null) EmployeeMasterdetail.LoginId = SessionMapper.CurrentUser .ToString(); else Response.Redirect("UnauthorizedLogin.aspx"); } } else if (EmployeeMasterdetail.signatureimage == null) { EmployeeMasterdetail.signatureimage = null; EmployeeMasterdetail.signature_image_ext = null; } EmployeeMasterdetail.companylucode1 = ddlCompany.SelectedValue.Trim( ); EmployeeMasterdetail.employeeid = txtemployeeid.Text.Trim().ToUpper( ); EmployeeMasterdetail.employeename = txtemployeename.Text.Trim().ToUp per(); EmployeeMasterdetail.designationlucode1 = ddlDesignation.SelectedVal ue.Trim(); EmployeeMasterdetail.Department = ddlDepartment.SelectedValue.Trim() ; EmployeeMasterdetail.emailid = txtemailid.Text.Trim().ToUpper(); EmployeeMasterdetail.mobileno = txtmobileno.Text.Trim().ToUpper(); EmployeeMasterdetail.contactno = txtcontactno.Text.Trim().ToUpper(); EmployeeMasterdetail.loblucode1 = txtlob.Text.Trim().ToUpper(); EmployeeMasterdetail.loclucode1 = txtloc.Text.Trim().ToUpper(); EmployeeMasterdetail.cclucode1 = txtcc.Text.Trim().ToUpper(); if (txtresigndate.Text == string.Empty) { EmployeeMasterdetail.resigndate = null; } else { EmployeeMasterdetail.resigndate = Convert.ToDateTime(txtresignda te.Text); } EmployeeMasterdetail.crnno = txtcrnno.Text.Trim().ToUpper(); EmployeeMasterdetail.remarks = txtremarks.Text.Trim().ToUpper(); return true; } catch (Exception ex) { Message.ClearMessage();

Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); return false; } } //Fetch IFSCMasterDetail From DB private void GetEmployeeDetail(ref EmployeeMaster employeedetails) { try { EmployeeMaster objEmpMaster = new EmployeeMaster(); List<EmployeeMaster> lstEmpMaster = new List<EmployeeMaster>(); Int32? emplrecordid = 0; if (Request.QueryString["emplrecordid"] != null) emplrecordid = Convert.ToInt32(Request.QueryString["emplrecordid "]); objEmpMaster.emplrecordid = emplrecordid; objEmpMaster.DbActionMode = Enum.GetName(typeof(DomainBase.DBACTIONM ODE), DomainBase.DBACTIONMODE.INSERT); lstEmpMaster = EmployeeMasterMapper.searchEmployeeMasterData(objEmpM aster); foreach (EmployeeMaster employeedetailslist in lstEmpMaster) { employeedetails = (EmployeeMaster)employeedetailslist; } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } //Fill controls private void BindControls() { try { EmployeeMaster EmployeeMasterdetail = new EmployeeMaster(); GetEmployeeDetail(ref EmployeeMasterdetail); if (EmployeeMasterdetail != null) { Session["EmployeeMaster"] = (EmployeeMaster)EmployeeMasterdetail ; } if (EmployeeMasterdetail.companylucode1 != string.Empty) { ddlCompany.SelectedValue = Convert.ToString(EmployeeMasterdetail .companylucode1);

} txtemployeeid.Text = EmployeeMasterdetail.employeeid; txtemployeename.Text = EmployeeMasterdetail.employeename; if (EmployeeMasterdetail.designationlucode1 != string.Empty) { ddlDesignation.SelectedValue = Convert.ToString(EmployeeMasterde tail.designationlucode1); } if (EmployeeMasterdetail.Department != string.Empty) { ddlDepartment.SelectedValue = Convert.ToString(EmployeeMasterdet ail.Department); } txtemailid.Text = EmployeeMasterdetail.emailid; txtmobileno.Text = EmployeeMasterdetail.mobileno; if (EmployeeMasterdetail.contactno != null) txtcontactno.Text = EmployeeMasterdetail.contactno; else txtcontactno.Text = string.Empty; txtlob.Text = EmployeeMasterdetail.loblucode1; txtloc.Text = EmployeeMasterdetail.loclucode1; txtcc.Text = EmployeeMasterdetail.cclucode1; txtresigndate.Text = Convert.ToString(EmployeeMasterdetail.resigndat e); txtcrnno.Text = EmployeeMasterdetail.crnno; txtremarks.Text = EmployeeMasterdetail.remarks; //Get Photo Image if (EmployeeMasterdetail.photo_image_ext == null || EmployeeMasterde tail.photo_image_ext.Equals(string.Empty)) { trImagePhoto.Visible = false; trimageSign.Visible = false; imageSign.Visible = false; ImagePhoto.Visible = false; } else if (EmployeeMasterdetail.photo_image_ext == "application/pdf") { trImagePhoto.Visible = false; trimageSign.Visible = false; imageSign.Visible = false; ImagePhoto.Visible = false; } else { // ImagePhoto.ImageUrl = GetPhotoImage(EmployeeMasterdetail.phot oimage, EmployeeMasterdetail.photo_image_ext); ImagePhoto.ImageUrl = "ImageHandler.ashx?Photoid=" + EmployeeMas terdetail.Photo_Image_id; trImagePhoto.Visible = true; trimageSign.Visible = true; imageSign.Visible = true; ImagePhoto.Visible = true; } //Get Sign Image if (EmployeeMasterdetail.signature_image_ext == null || EmployeeMast erdetail.signature_image_ext.Equals(string.Empty))

{ trImagePhoto.Visible = false; trimageSign.Visible = false; imageSign.Visible = false; ImagePhoto.Visible = false; } else if (EmployeeMasterdetail.signature_image_ext == "application/pd f") { trImagePhoto.Visible = false; trimageSign.Visible = false; imageSign.Visible = false; ImagePhoto.Visible = false; } else { // imageSign.ImageUrl = GetSignImage(EmployeeMasterdetail.signat ureimage, EmployeeMasterdetail.signature_image_ext); imageSign.ImageUrl = "ImageHandler.ashx?Signid=" + EmployeeMaste rdetail.Sign_Image_id; trImagePhoto.Visible = true; trimageSign.Visible = true; imageSign.Visible = true; ImagePhoto.Visible = true; } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } public string GetPhotoImage(byte[] Logo, object photo_image_ext) { // DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDir ectory + "Masters"); MemoryStream stream = new MemoryStream(Logo); string strPath = string.Empty; System.Drawing.Image img = System.Drawing.Image.FromStream(stream); string newFileName = Guid.NewGuid().ToString(); if (photo_image_ext.Equals("image/x-png")) { strPath = Server.MapPath("~/") + "UploadImages//" + newFileName + ". png"; Server.MapPath(newFileName + ".png"); } else if (photo_image_ext.Equals("image/bmp")) { strPath = Server.MapPath("~/") + "UploadImages//" + newFileName + ". bmp"; Server.MapPath(newFileName + ".bmp"); } else { strPath = Server.MapPath("~/") + "UploadImages//" + newFileName + ". jpg"; Server.MapPath(newFileName + ".jpg");

} Session["PhotoImage"] = strPath; FileInfo TheFile = new FileInfo(strPath); if (TheFile.Exists) { File.Delete(strPath); } img.Save(strPath); return strPath; } public string GetSignImage(byte[] Logo, object signature_image_ext) { // DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDir ectory + "Masters"); MemoryStream stream = new MemoryStream(Logo); string strPath = string.Empty; System.Drawing.Image img = System.Drawing.Image.FromStream(stream); string newFileName = Guid.NewGuid().ToString(); if (signature_image_ext.Equals("image/x-png")) { strPath = Server.MapPath("~/") + "UploadImages//" + newFileName + ". png"; Server.MapPath(newFileName + ".png"); } else if (signature_image_ext.Equals("image/bmp")) { strPath = Server.MapPath("~/") + "UploadImages//" + newFileName + ". bmp"; Server.MapPath(newFileName + ".bmp"); } else { strPath = Server.MapPath(newFileName + ".jpg"); Server.MapPath(newFileName + ".jpg"); } Session["SignatureImage"] = strPath; FileInfo TheFile = new FileInfo(strPath); if (TheFile.Exists) { File.Delete(strPath); } img.Save(strPath); return strPath; } //clear controls

private void ClearControls() { try { txtemployeeid.Text = ""; txtemployeename.Text = ""; txtemailid.Text = ""; txtmobileno.Text = ""; txtcontactno.Text = ""; txtlob.Text = ""; txtloc.Text = ""; txtcc.Text = ""; txtresigndate.Text = ""; txtcrnno.Text = ""; txtremarks.Text = ""; ddlCompany.ClearSelection(); ddlDesignation.ClearSelection(); ddlDepartment.ClearSelection(); imageSign.Visible = false; ImagePhoto.Visible = false; trImagePhoto.Visible = false; trimageSign.Visible = false;

} catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } private UserControl LoadControl(string UserControlPath, params object[] cons tructorParameters) { List<Type> constParamTypes = new List<Type>(); foreach (object constParam in constructorParameters) { constParamTypes.Add(constParam.GetType()); } UserControl ctl = Page.LoadControl(UserControlPath) as UserControl; // Find the relevant constructor ConstructorInfo constructor = ctl.GetType().BaseType.GetConstructor(cons tParamTypes.ToArray()); //And then call the relevant constructor if (constructor == null) { throw new MemberAccessException("The requested constructor was not f ound on : " + ctl.GetType().BaseType.ToString()); } else { constructor.Invoke(ctl, constructorParameters); }

// Finally return the fully initialized UC return ctl; } private void FetchCompanyCode() { try { string companyCode = ddlCompany.Text.Trim() == string.Empty ? "NULL" : ddlCompany.Text.Trim(); Kotak.Data.Domains.ListItem item = LOVService.GetListOfValues("AUTH_ SIG_COMPANY_LOV"); string query = item.ReturnValue1.ToString(); List<Kotak.Data.Domains.ListItem> dt = ListItemService.GetData(query ); if (dt.Count != 0) { ddlCompany.DataSource = dt; ddlCompany.DataValueField = "ReturnID"; ddlCompany.DataTextField = "ReturnValue1"; ddlCompany.DataBind(); } else { DataTable dtsource = new DataTable(); ddlCompany.DataSource = dtsource; ddlCompany.DataBind(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } private void FetchDesgination() { try { string branchStatus = ddlDesignation.Text.Trim() == string.Empty ? " NULL" : ddlDesignation.Text.Trim(); Kotak.Data.Domains.ListItem item = LOVService.GetListOfValues("AUTH_ SIG_DESIGNATION_LOV"); string query = item.ReturnValue1.ToString(); List<Kotak.Data.Domains.ListItem> dt = ListItemService.GetData(query ); if (dt.Count != 0) { ddlDesignation.DataSource = dt; ddlDesignation.DataValueField = "ReturnID"; ddlDesignation.DataTextField = "ReturnValue1"; ddlDesignation.DataBind(); }

else { DataTable dtsource = new DataTable(); ddlDesignation.DataSource = dtsource; ddlDesignation.DataBind(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } private void FetchDepartment() { try { string department = ddlDepartment.Text.Trim() == string.Empty ? "NUL L" : ddlDepartment.Text.Trim(); Kotak.Data.Domains.ListItem item = LOVService.GetListOfValues("AUTH_ SIG_DEPARTMENT_LOV"); string query = item.ReturnValue1.ToString(); List<Kotak.Data.Domains.ListItem> dt = ListItemService.GetData(query ); if (dt.Count != 0) { ddlDepartment.DataSource = dt; ddlDepartment.DataValueField = "ReturnID"; ddlDepartment.DataTextField = "ReturnValue1"; ddlDepartment.DataBind(); } else { DataTable dtsource = new DataTable(); ddlDepartment.DataSource = dtsource; ddlDepartment.DataBind(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void imgbtnPickLobCode_Click(object sender, ImageClickEventArgs e) { try { Session["ListSource"] = String.Empty; Session["searchkey"] = String.Empty; Session["searchkeyTemp"] = String.Empty; String CurrentLOV_Desc = String.Empty;

String LobCode = Enum.GetName(typeof(DomainBase.SYS_LOV_DESC), Domai nBase.SYS_LOV_DESC.AUTH_SIG_LOB_LOV); Kotak.Data.Domains.ListItem list = LOVService.GetListOfValues(LobCod e); CurrentLOV_Desc = list.ReturnValue1; String CurrentLookupID = DBNull.Value.ToString(); String FillControlID = txtlob.ID; String FillIDControlID = lblpopupvisibilityHidden.ID; lblpopupvisibilityHidden.Text = LobCode; Control toAdd = LoadControl("~/UserControls/LookupList.ascx", Curren tLOV_Desc, CurrentLookupID, FillIDControlID, FillControlID, lblpopupvisibilityHi dden.ID, true); divLookup.Controls.Add(toAdd); } catch (Exception ex) { log.Error("Error on pick alert button click of Branch Code Search Li st", ex); Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void imgbtnPickLocCode_Click(object sender, ImageClickEventArgs e) { try { Session["ListSource"] = String.Empty; Session["searchkey"] = String.Empty; Session["searchkeyTemp"] = String.Empty; String CurrentLOV_Desc = String.Empty; String LocCode = Enum.GetName(typeof(DomainBase.SYS_LOV_DESC), Domai nBase.SYS_LOV_DESC.AUTH_SIG_LOC_LOV); Kotak.Data.Domains.ListItem list = LOVService.GetListOfValues(LocCod e); CurrentLOV_Desc = list.ReturnValue1; String CurrentLookupID = DBNull.Value.ToString(); String FillControlID = txtloc.ID; String FillIDControlID = lblpopupvisibilityHidden.ID; lblpopupvisibilityHidden.Text = LocCode; Control toAdd = LoadControl("~/UserControls/LookupList.ascx", Curren tLOV_Desc, CurrentLookupID, FillIDControlID, FillControlID, lblpopupvisibilityHi dden.ID, true); divLookup.Controls.Add(toAdd); } catch (Exception ex) { log.Error("Error on pick alert button click of Branch Code Search Li st", ex); Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } }

protected void imgbtnPickCcCode_Click(object sender, ImageClickEventArgs e) { try { Session["ListSource"] = String.Empty; Session["searchkey"] = String.Empty; Session["searchkeyTemp"] = String.Empty; String CurrentLOV_Desc = String.Empty; String CcCode = Enum.GetName(typeof(DomainBase.SYS_LOV_DESC), Domain Base.SYS_LOV_DESC.AUTH_SIG_CC_LOV); Kotak.Data.Domains.ListItem list = LOVService.GetListOfValues(CcCode ); CurrentLOV_Desc = list.ReturnValue1; String CurrentLookupID = DBNull.Value.ToString(); String FillControlID = txtcc.ID; String FillIDControlID = lblpopupvisibilityHidden.ID; lblpopupvisibilityHidden.Text = CcCode; Control toAdd = LoadControl("~/UserControls/LookupList.ascx", Curren tLOV_Desc, CurrentLookupID, FillIDControlID, FillControlID, lblpopupvisibilityHi dden.ID, true); divLookup.Controls.Add(toAdd); } catch (Exception ex) { log.Error("Error on pick alert button click of Branch Code Search Li st", ex); Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #endregion }