You are on page 1of 15

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.Domains; using Kotak.Data.Services; using System.Data.OleDb; using System.Collections.Generic; using System.Data.OracleClient; using System.Reflection; using log4net; public partial class EmployeeMaster1 : System.Web.UI.Page { private static readonly ILog log = LogManager.GetLogger(typeof(EmployeeMaster1).Name); #region PAGE EVENTS #region PAGE LOAD EVENTS /// <summary> /// On loading the page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { InitializePage(); //For binding dropdowns FetchCompanyCode(); FetchDesgination(); if (Request.QueryString["Mode"] == "S") { Message.ClearMessage(); Message.ShowMessage("Record Successfully Completed", AppMess ages.MessageType.Info); repopulateControls(); BindGridView(); } else if (Request.QueryString["Mode"] == "C") { if (Session["employeedetails"] != null || Session["employeed etails"] != "") { repopulateControls();

List<EmployeeMaster> lstEmpMaster = new List<EmployeeMas ter>(); lstEmpMaster = GetEmployeeMasterDetails(); if (lstEmpMaster != null) { Session["employeedetails"] = lstEmpMaster; gvEmployeeMaster.DataSource = lstEmpMaster; gvEmployeeMaster.DataSourceID = ""; gvEmployeeMaster.DataBind(); } } } else { InitializePage(); } } 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 = txtLocation.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 GRID EVENTS protected void gvEmployeeMaster_RowDataBound(object sender, GridViewRowEvent Args e) { try { if (e.Row.RowType == DataControlRowType.Pager) { Label lblTotalNumberOfPages = (Label)e.Row.FindControl("lblTotal NumberOfPages"); lblTotalNumberOfPages.Text = gvEmployeeMaster.PageCount.ToString (); TextBox txtGoToPage = (TextBox)e.Row.FindControl("txtGoToPage"); txtGoToPage.Text = (gvEmployeeMaster.PageIndex + 1).ToString(); DropDownList ddlPageSize = (DropDownList)e.Row.FindControl("ddlP ageSize"); ddlPageSize.SelectedValue = gvEmployeeMaster.PageSize.ToString() ; } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void gvEmployeeMaster_PageIndexChanging(object sender, GridViewPag eEventArgs e) { try { gvEmployeeMaster.PageIndex = e.NewPageIndex < 0 ? 0 : e.NewPageIndex ; List<EmployeeMaster> rtgsifsc = (List<EmployeeMaster>)Session["emplo yeedetails"]; gvEmployeeMaster.DataSource = rtgsifsc; gvEmployeeMaster.DataBind();

} catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void gvEmployeeMaster_Sorting(object sender, GridViewSortEventArgs e) { try { ViewState["sortexpression"] = e.SortExpression; ViewState["sortdirection"] = (SortDirection)ViewState["sortdirection "] == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascendi ng; SortDirection direction = (SortDirection)ViewState["sortdirection"]; List<EmployeeMaster> rtgsifsc = Session["employeedetails"] == null ? new List<EmployeeMaster>() : (List<EmployeeMaster>)Session["employeedetails"]; rtgsifsc.Sort(new GenericComparer<EmployeeMaster>(e.SortExpression, direction)); Session["employeedetails"] = rtgsifsc; gvEmployeeMaster.DataSource = rtgsifsc; gvEmployeeMaster.DataSourceID = ""; gvEmployeeMaster.DataBind(); } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void gvEmployeeMaster_PreRender(object sender, EventArgs e) { try { //force to view the pager evenif the grid has 1 page GridView grid = (GridView)sender; if (grid != null) { GridViewRow pagerRow = (GridViewRow)grid.BottomPagerRow; if (pagerRow != null) { Label lblPage = (Label)pagerRow.FindControl("lblPage"); TextBox txtGoToPage = (TextBox)pagerRow.FindControl("txtGoTo Page"); Label lblOf = (Label)pagerRow.FindControl("lblOf"); Label lblTotalNumberOfPages = (Label)pagerRow.FindControl("l blTotalNumberOfPages"); Button buttonPrevious = (Button)pagerRow.FindControl("button Previous"); Button buttonNext = (Button)pagerRow.FindControl("buttonNext "); //hide No.of pages section if there is only 1 page if (Convert.ToInt32(lblTotalNumberOfPages.Text) > 1) {

lblPage.Visible = true; txtGoToPage.Visible = true; lblOf.Visible = true; lblTotalNumberOfPages.Visible = true; buttonPrevious.Visible = true; buttonNext.Visible = true; } else { lblPage.Visible = false; txtGoToPage.Visible = false; lblOf.Visible = false; lblTotalNumberOfPages.Visible = false; buttonPrevious.Visible = false; buttonNext.Visible = false; } pagerRow.Visible = true; } } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void gvEmployeeMaster_RowCommand(object sender, GridViewCommandEve ntArgs e) { try { if (e.CommandName == "UpdateMaster") { if (e.CommandName == "UpdateMaster") { LinkButton lnkEmpRecordId = (LinkButton)(e.CommandSource); Response.Redirect(string.Format("AddEmployeeMaster.aspx?empl recordid=" + lnkEmpRecordId.Text)); } } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void gvEmployeeMaster_RowEditing(object sender, GridViewEditEventA rgs e) { } #endregion #region BUTTON CLICK EVENTS

protected void btnSearch_Click(object sender, ImageClickEventArgs e) { try { if (Page.IsValid) { if (Request.QueryString["Mode"] != "S") { Session["Company"] = ddlCompany.Text; Session["EmpId"] = txtEmpId.Text; Session["Designation"] = ddlDesignation.SelectedValue; Session["Mobile"] = txtMobile.Text; Session["Email"] = txtEmail.Text; Session["LOB"] = txtLOB.Text; Session["SignatoryLocation"] = txtLocation.Text; Session["Fromdate"] = txtFromdate.Text; Session["Todate"] = txtTodate.Text; Session["CC"] = txtCC.Text; Session["CRN"] = txtCRN.Text; Session["EmpName"] = txtEmpName.Text; } BindGridView(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } /// <summary> /// repopulate Controls on the page /// </summary> private void repopulateControls() { try { ddlCompany.SelectedValue = Session["Company"] != null ? Session["Com pany"].ToString() : string.Empty; txtEmpId.Text = Session["EmpId"] != null ? Session["EmpId"].ToString () : string.Empty; ddlDesignation.SelectedValue = Session["Designation"] != null ? Sess ion["Designation"].ToString() : string.Empty; txtMobile.Text = Session["Mobile"] != null ? Session["Mobile"].ToStr ing() : string.Empty; txtEmail.Text = Session["Email"] != null ? Session["Email"].ToString () : string.Empty; txtLOB.Text = Session["LOB"] != null ? Session["LOB"].ToString() : s tring.Empty; txtLocation.Text = Session["SignatoryLocation"] != null ? Session["S ignatoryLocation"].ToString() : string.Empty; txtCC.Text = Session["CC"] != null ? Session["CC"].ToString() : stri ng.Empty; txtCRN.Text = Session["CRN"] != null ? Session["CRN"].ToString() : s tring.Empty;

txtFromdate.Text = Session["Fromdate"] != null ? Session["Fromdate"] .ToString() : string.Empty; txtTodate.Text = Session["Todate"] != null ? Session["Todate"].ToStr ing() : string.Empty; txtEmpName.Text = Session["EmpName"] != null ? Session["EmpName"].To String() : string.Empty; } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void BindGridView() { List<EmployeeMaster> lstEmpMaster = new List<EmployeeMaster>(); try { lstEmpMaster = GetEmployeeMasterDetails(); if (lstEmpMaster != null) { Session["employeedetails"] = lstEmpMaster; gvEmployeeMaster.DataSource = lstEmpMaster; gvEmployeeMaster.DataSourceID = ""; gvEmployeeMaster.DataBind(); gvEmployeeMaster.Visible = true; } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void CustomValidator1_ServerValidate(object source, ServerValidate EventArgs args) { try { if ((!string.IsNullOrEmpty(this.txtFromdate.Text)) && (!string.IsNul lOrEmpty(this.txtTodate.Text))) { if (Convert.ToDateTime(this.txtTodate.Text) < Convert.ToDateTime (this.txtFromdate.Text)) { args.IsValid = false; Message.ClearMessage(); Message.MessageId = "1"; Message.ShowMessage(); gvEmployeeMaster.Visible = false; }

} //if //{ // // // // // //} //if //{ // // // // //

(string.IsNullOrEmpty(this.txtFromdate.Text)) args.IsValid = false; Message.ClearMessage(); Message.MessageId = "2"; Message.ShowMessage(); gvEmployeeMaster.Visible = false; (string.IsNullOrEmpty(this.txtTodate.Text)) args.IsValid = false; Message.ClearMessage(); Message.MessageId = "3"; Message.ShowMessage(); gvEmployeeMaster.Visible = false;

//} //if ((string.IsNullOrEmpty(this.txtTodate.Text)) && (string.IsNullO rEmpty(this.txtFromdate.Text))) //{ // args.IsValid = false; // Message.ClearMessage(); // Message.MessageId = "4"; // Message.ShowMessage(); // gvEmployeeMaster.Visible = false; //} } catch (FormatException e) { args.IsValid = false; CustomValidator1.ErrorMessage = "Invalid Date." + e.Message; } } private void BindControl() { try { if (Session["employeedetails"] != null) { gvEmployeeMaster.DataSource = (List<EmployeeMaster>)Session["emp loyeedetails"]; gvEmployeeMaster.DataBind(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void btnAdd_Click(object sender, ImageClickEventArgs e) { try {

Response.Redirect("AddEmployeeMaster.aspx", false); } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #endregion #region USER DEFINED METHODS #region PAGING EVENTS #region PROTECTED METHODS protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList dropDown = (DropDownList)sender; this.gvEmployeeMaster.PageSize = int.Parse(dropDown.SelectedValue); List<EmployeeMaster> empmaster = (List<EmployeeMaster>)Session["empl oyeedetails"]; gvEmployeeMaster.DataSource = empmaster; gvEmployeeMaster.DataBind(); } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } protected void txtGoToPage_TextChanged(object sender, EventArgs e) { try { TextBox txtGoToPage = (TextBox)sender; int pageNumber; if (int.TryParse(txtGoToPage.Text.Trim(), out pageNumber) && pageNum ber > 0 && pageNumber <= this.gvEmployeeMaster.PageCount) { this.gvEmployeeMaster.PageIndex = pageNumber - 1; } else { this.gvEmployeeMaster.PageIndex = 0; } List<EmployeeMaster> rtgsifsc = (List<EmployeeMaster>)Session["emplo yeedetails"]; gvEmployeeMaster.DataSource = rtgsifsc; gvEmployeeMaster.DataBind();

} catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #endregion #region PRIVATE METHODS protected string GeneratePhotoDetailLink(object Photo_Image_id, object photo _image_ext) { if (photo_image_ext == null) { return "No File Available"; } else { return string.Format(@"<a target=""_blank"" href=ImageHandler.ashx?P hotoid=" + Photo_Image_id.ToString() + ">" + "View" + "</a>"); } } protected string GenerateSignatureDetailLink(object Sign_Image_id, object si gnature_image_ext) { if (signature_image_ext == null) { return "No File Available"; } else { return string.Format(@"<a target=""_blank"" href=ImageHandler.ashx?S ignid=" + Sign_Image_id.ToString() + ">" + "View" + "</a>"); } } private void InitializePage() { try { //txtFromdate.Text = DateTime.Now.ToShortDateString(); //txtTodate.Text = DateTime.Now.ToShortDateString(); Page.Form.DefaultButton = btnSearch.UniqueID; Session["employeedetails"] = null; ViewState["sortdirection"] = SortDirection.Ascending; } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E

rror); } } private List<EmployeeMaster> GetEmployeeMasterDetails() { EmployeeMaster objEmpMaster = new EmployeeMaster(); List<EmployeeMaster> lstEmpMaster = new List<EmployeeMaster>(); try { objEmpMaster.DbActionMode = Enum.GetName(typeof(DomainBase.DBACTIONM ODE), DomainBase.DBACTIONMODE.SELECT); objEmpMaster.companylucode1 = string.IsNullOrEmpty(ddlCompany.Select edValue) ? null : ddlCompany.SelectedValue; if (txtEmpId.Text != string.Empty) { objEmpMaster.employeeid = txtEmpId.Text; } objEmpMaster.designationlucode1 = string.IsNullOrEmpty(ddlDesignatio n.SelectedValue) ? null : ddlDesignation.SelectedValue; objEmpMaster.mobileno = string.IsNullOrEmpty(txtMobile.Text) ? null : txtMobile.Text; objEmpMaster.emailid = string.IsNullOrEmpty(txtEmail.Text) ? null : txtEmail.Text; objEmpMaster.loblucode1 = string.IsNullOrEmpty(txtLOB.Text) ? null : txtLOB.Text; objEmpMaster.loclucode1 = string.IsNullOrEmpty(txtLocation.Text) ? n ull : txtLocation.Text; objEmpMaster.cclucode1 = string.IsNullOrEmpty(txtCC.Text) ? null : t xtCC.Text; objEmpMaster.crnno = string.IsNullOrEmpty(txtCRN.Text) ? null : txtC RN.Text; objEmpMaster.employeename = string.IsNullOrEmpty(txtEmpName.Text) ? null : txtEmpName.Text; if (txtFromdate.Text != string.Empty) { objEmpMaster.FromDate = Convert.ToDateTime(txtFromdate.Text); } if (txtTodate.Text != string.Empty) { objEmpMaster.ToDate = Convert.ToDateTime(txtTodate.Text); } lstEmpMaster = EmployeeMasterMapper.searchEmployeeMasterData(objEmpM aster); } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } return lstEmpMaster; } 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; } protected void imgPickLob_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 imgPickLocation_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 = txtLocation.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 imgPickCC_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); } } private void FetchCompanyCode() { try { string companyCode = ddlCompany.SelectedValue.Trim() == string.Empty ? "NULL" : ddlCompany.SelectedValue.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(); ddlCompany.Items.Insert(0, ""); } 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.SelectedValue.Trim() == string. Empty ? "NULL" : ddlDesignation.SelectedValue.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(); ddlDesignation.Items.Insert(0, ""); } else { DataTable dtsource = new DataTable(); ddlDesignation.DataSource = dtsource; ddlDesignation.DataBind(); } } catch (Exception ex) { Message.ClearMessage(); Message.ShowMessage(ex.Message.ToString(), AppMessages.MessageType.E rror); } } #endregion #endregion }