示例#1
0
        public void LoadUsers()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.UserMaster
            {
                Type        = "fetch",
                CreatedDate = DateTime.Now
            };

            var userResult = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                               <BKIC.SellingPoint.DTO.RequestResponseWrappers.UserMasterDetailsResponse>,
                                               BKIC.SellingPoint.DTO.RequestResponseWrappers.UserMaster>
                                 (BKIC.SellingPoint.DTO.Constants.AdminURI.UserOperation, details);

            if (userResult.Result.IsTransactionDone && userResult.StatusCode == 200)
            {
                ddlUsers.DataValueField = "ID";
                ddlUsers.DataTextField  = "UserName";
                ddlUsers.DataSource     = userResult.Result.UserMaster.AsEnumerable()
                                          .Where(row => row.Agency == userInfo.Agency);

                ddlUsers.DataBind();
                ddlUsers.Items.Insert(0, new ListItem("--Please Select--", ""));
            }
        }
        protected void gv_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            //bindgridview will get the data source and bind it again
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            gvDomesticInsurance.PageIndex = e.NewPageIndex;
            LoadData(userInfo, service);
        }
        public void SetDefaultAgency()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();

            if (userInfo != null)
            {
                ddlAgency.SelectedIndex = ddlAgency.Items.IndexOf(ddlAgency.Items.FindByText(userInfo.Agency));
                ddlAgency.Enabled       = false;
            }
        }
        public void BindDocuments(string insuredCode, string policyNo, string linkId)
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var docrequest = new FetchDocumentsRequest
            {
                InsuredCode = insuredCode,
                DocumentNo  = policyNo,
                LinkID      = linkId
            };
            var response = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                             <BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchDocumentsResponse>,
                                             BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchDocumentsRequest>
                               (BKIC.SellingPoint.DTO.Constants.InsurancePortalURI.FetchDocuments, docrequest);

            if (response.StatusCode == 200 && response.Result.IsTransactionDone)
            {
                DataTable docdt = new DataTable();
                docdt.Columns.Add("FileName");
                docdt.Columns.Add("FileURL");
                docdt.Columns.Add("CreatedDate");

                foreach (var list in response.Result.FilesDocuments)
                {
                    docdt.Rows.Add(list.FileName, ClientUtility.WebApiUri + list.FileURL, list.CreatedDate.ToString("MMM-dd-yyyy hh:mm:ss tt"));
                }

                rptHIRDocuments.DataSource = docdt;
                rptHIRDocuments.DataBind();
            }
        }
示例#5
0
        protected void btndelconf_Click(object sender, EventArgs e)
        {
            master.IsSessionAvailable();
            var service = CommonMethods.GetLogedInService();

            string type = "DomesticInsurance";
            string HIR  = "0";
            string url  = BKIC.SellingPoint.DTO.Constants.InsurancePortalURI.FetchDetails.Replace("{HIR}", type);

            url = url.Replace("HIR", HIR);

            var result = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                          <BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchPolicyDetailsResponse> >(url);

            if (result.StatusCode == 200 && result.Result.IsTransactionDone)
            {
                lbler.Text = "Travel Insurance Period has been Deleted";
            }
            else
            {
                lbler.Text = result.ErrorMessage;
            }

            loadd();

            lbler.ForeColor = System.Drawing.Color.Maroon;
            lbler.Text      = "Travel Insurance Period has been deleted";
        }
示例#6
0
        public void loaddgridevent(object sender)
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var fetchdetailsrequest = new FetchPolicyDetailsRequest
            {
                CPR           = "",
                DocumentNo    = "",
                FilterType    = "",
                InsuranceType = Constants.Travel,
                IsHIR         = true,
                Source        = "",
                InsuredCode   = "",
                PolicyType    = "HIR"
            };

            var result = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                           <BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchPolicyDetailsResponse>,
                                           BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchPolicyDetailsRequest>
                             (BKIC.SellingPoint.DTO.Constants.InsurancePortalURI.FetchDetails, fetchdetailsrequest);

            DataTable dt = new DataTable();

            if (result.StatusCode == 200 && result.Result.IsTransactionDone)
            {
                gvTravelInsurance.DataSource = result.Result.PolicyDetailList;
                gvTravelInsurance.DataBind();
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string opertaion = string.Empty;

                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorCoverMaster();

                details.CoversDescription = txtCoverDescription.Text.ToString();
                details.CoversCode        = txtCoverCode.Text.ToString();

                opertaion = (sender as Button).Text;

                if (opertaion == "Update")
                {
                    details.Type = "edit";
                }
                else
                {
                    details.Type = "insert";
                }

                var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorCoverMasterResponse>,
                                                BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorCoverMaster>
                                  (BKIC.SellingPoint.DTO.Constants.AdminURI.MotorCoverMasterOperation, details);

                if (results.StatusCode == 200 && results.Result.IsTransactionDone)
                {
                    LoadMotorMasterData();
                    ClearControl();
                    btnSubmit.Text = "Save";
                }
            }
        }
 //  CommonMethods methods = new CommonMethods();
 protected void Page_Load(object sender, EventArgs e)
 {
     master = Master as General;
     if (!IsPostBack)
     {
         master.IsSessionAvailable();
         var userInfo = CommonMethods.GetUserDetails();
         var service  = CommonMethods.GetLogedInService();
         BindAgency(userInfo, service);
         BindDropDowns(userInfo, service);
         LoadData(userInfo, service);
     }
 }
示例#9
0
        private void BindAgencyBranch()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var result = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                          <BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchDropDownsResponse> >
                             (BKIC.SellingPont.DTO.Constants.DropdownURI.GetPageDropDowns.Replace("{type}",
                                                                                                  BKIC.SellingPoint.DTO.RequestResponseWrappers.PageType.Reports));

            if (result.StatusCode == 200 && result.Result.IsTransactionDone)
            {
                DataSet dropdownds = JsonConvert.DeserializeObject <DataSet>(result.Result.dropdownresult);

                DataTable Agency   = dropdownds.Tables["AgentCodeDD"];
                DataTable branches = dropdownds.Tables["AgentBranchDD"];

                if (Agency != null && Agency.Rows.Count > 0)
                {
                    ddlAgency.DataValueField = "AgentCode";
                    ddlAgency.DataTextField  = "Agency";
                    ddlAgency.DataSource     = Agency;
                    ddlAgency.DataBind();
                    ddlAgency.Items.Insert(0, new ListItem("--Please Select--", ""));
                    SetDefaultAgency();
                }
                if (branches != null && branches.Rows.Count > 0)
                {
                    ddlBranch.DataValueField = "AGENTBRANCH";
                    ddlBranch.DataTextField  = "BranchName";
                    ddlBranch.DataSource     = branches.AsEnumerable()
                                               .Where(row => row.Field <string>("Agency") == userInfo.Agency)
                                               .CopyToDataTable();
                    ddlBranch.DataBind();
                    ddlBranch.Items.Insert(0, new ListItem("--Please Select--", ""));
                }
            }
        }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            master = Master as General;
            if (!Page.IsPostBack)
            {
                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                btnSubmit.Text = "Save";
                LoadMotorProductData(userInfo, service);
                ClearControl();
            }
        }
示例#11
0
        private void BindAgency()
        {
            master.IsSessionAvailable();
            var service = CommonMethods.GetLogedInService();

            var dropDownResult = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                  <BKIC.SellingPoint.DTO.RequestResponseWrappers.FetchDropDownsResponse> >
                                     (BKIC.SellingPont.DTO.Constants.DropdownURI.GetPageDropDowns.Replace("{type}",
                                                                                                          BKIC.SellingPoint.DTO.RequestResponseWrappers.PageType.Reports));

            if (dropDownResult.StatusCode == 200 && dropDownResult.Result.IsTransactionDone)
            {
                DataSet   dropdownds = JsonConvert.DeserializeObject <DataSet>(dropDownResult.Result.dropdownresult);
                DataTable AgencyDt   = dropdownds.Tables["AgentCodeDD"];

                ddlAgency.DataValueField = "AgentCode";
                ddlAgency.DataTextField  = "Agency";
                ddlAgency.DataSource     = AgencyDt;
                ddlAgency.DataBind();
                ddlAgency.Items.Insert(0, new ListItem("--Please Select--", ""));
                SetDefaultAgency();
            }
        }
示例#12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            master = Master as General;

            if (!Page.IsPostBack)
            {
                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                btnSubmit.Text       = "Save";
                userdetails.Visible  = false;
                admindetails.Visible = true;
                ClearControl();
                LoadUserData(userInfo, service);
                BindDropdown(userInfo, service);
                BindUserRole(userInfo, service);
            }
        }
示例#13
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();

                    string opertaion = string.Empty;

                    var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.UserMaster
                    {
                        Agency      = ddlAgency.SelectedItem.Text.ToString(),
                        AgentCode   = ddlAgentCode.SelectedItem.Text.ToString(),
                        AgentBranch = ddlAgentBranch.SelectedItem.Value.ToString(),
                        UserID      = txtUserId.Text.ToString(),
                        UserName    = txtUserName.Text.ToString(),
                        CreatedDate = DateTime.Now,
                        Password    = txtPassword.Text.ToString(),
                        Mobile      = txtMobile.Text.ToString(),
                        IsActive    = true,
                        Email       = txtEmail.Text.ToString(),
                        StaffNo     = Convert.ToInt32(txtStaffNo.Text),
                        CreatedBy   = "",
                        Role        = ddlRole.SelectedItem.Value
                    };
                    opertaion = (sender as Button).Text;
                    if (opertaion == "Update")
                    {
                        details.Id   = Convert.ToInt32(ViewState["UserId"].ToString());
                        details.Type = "edit";
                    }
                    else
                    {
                        details.Type = "insert";
                    }

                    var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.PostUserDetailsResult>,
                                                    BKIC.SellingPoint.DTO.RequestResponseWrappers.UserMaster>
                                      (BKIC.SellingPoint.DTO.Constants.UserURI.PostUserMaster, details);

                    if (results.StatusCode == 200 && results.Result.IsTransactionDone)
                    {
                        LoadUserData(userInfo, service);
                        ClearControl();
                        btnSubmit.Text = "Save";
                        if (details.Type == "insert")
                        {
                            master.ShowErrorPopup("User saved sucessfully", "User");
                        }
                        if (details.Type == "edit")
                        {
                            master.ShowErrorPopup("User updated sucessfully", "User");
                        }
                    }
                    else
                    {
                        if (results.Result.IsUserAlreadyExists)
                        {
                            master.ShowErrorPopup("UserName already exists !", "User");
                            return;
                        }
                        if (results.Result.PasswordStrength)
                        {
                            master.ShowErrorPopup("Password required atleast 7 character !", "User");
                            return;
                        }
                        else
                        {
                            master.ShowErrorPopup(results.Result.TransactionErrorMessage, "User");
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
示例#14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    string opertaion = string.Empty;

                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();

                    var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorProductCover
                    {
                        CoverCode        = txtCoverCode.Text.Trim(),
                        CoverDescription = txtCoverDescription.Text.Trim(),
                        CoverAmount      = string.IsNullOrEmpty(txtCoverAmount.Text) ? decimal.Zero :
                                           Convert.ToDecimal(txtCoverAmount.Text),
                        Agency          = userInfo.Agency,
                        AgencyCode      = userInfo.AgentCode,
                        Mainclass       = MainClass,
                        SubClass        = ddlCover.SelectedItem.Value.Trim(),
                        IsOptionalCover = chkIsOptionalCover.Checked,
                        CoverType       = "Cover"
                    };

                    opertaion = (sender as Button).Text;
                    if (opertaion == "Update")
                    {
                        details.CoverId   = Convert.ToInt32(ViewState["CoverId"].ToString());
                        details.Type      = "edit";
                        details.UpdatedBy = "Admin";
                    }
                    else
                    {
                        details.Type      = "insert";
                        details.UpdatedBy = "";
                    }

                    var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorProductCoverResponse>,
                                                    BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorProductCover>
                                      (BKIC.SellingPoint.DTO.Constants.AdminURI.MotorProductCoverOperation, details);

                    if (results.StatusCode == 200 && results.Result.IsTransactionDone)
                    {
                        LoadProductCover();
                        ClearControl();
                        btnSubmit.Text = "Save";
                        if (details.Type == "insert")
                        {
                            master.ShowErrorPopup("Motor cover added successfully", "Motor Cover");
                        }
                        if (details.Type == "edit")
                        {
                            master.ShowErrorPopup("Motor cover updated successfully", "Motor Cover");
                        }
                    }
                    else
                    {
                        master.ShowErrorPopup(results.ErrorMessage, "Request Failed!");
                    }
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
示例#15
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    string opertaion = string.Empty;

                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();

                    var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.CategoryMaster();

                    details.Agency    = txtAgency.Text.Trim();
                    details.AgentCode = txtAgentCode.Text.Trim();
                    details.Category  = txtCategory.Text.Trim();
                    details.Code      = txtCode.Text.Trim();
                    details.MainClass = txtMainclass.Text.Trim();
                    details.SubClass  = txtSubClass.Text.Trim();
                    details.ValueType = txtValueType.Text.Trim();
                    details.Value     = Convert.ToDecimal(txtValue.Text);
                    details.Status    = true;

                    opertaion = (sender as Button).Text;

                    if (opertaion == "Update")
                    {
                        details.id   = Convert.ToInt32(ViewState["CategoryId"].ToString());
                        details.Type = "edit";
                    }
                    else
                    {
                        details.Type = "insert";
                    }

                    var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.CategoryMasterResponse>,
                                                    BKIC.SellingPoint.DTO.RequestResponseWrappers.CategoryMaster>
                                      (BKIC.SellingPoint.DTO.Constants.AdminURI.CategoryMasterOperation, details);

                    if (results.StatusCode == 200 && results.Result.IsTransactionDone)
                    {
                        LoadCategoryData(userInfo, service);
                        ClearControl();
                        if (details.Type == "insert")
                        {
                            master.ShowErrorPopup("Commission details saved sucessfully", "Commission");
                        }
                        else
                        {
                            master.ShowErrorPopup("Commission details updated sucessfully", "Commission");
                        }

                        btnSubmit.Text = "Save";
                    }
                }
            }
            catch (Exception ex)
            {
                ////throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                Page.Validate();
                if (Page.IsValid)
                {
                    string opertaion = string.Empty;

                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();

                    var branchdetails = new BKIC.SellingPoint.DTO.RequestResponseWrappers.BranchMaster();

                    branchdetails.Agency      = ddlAgency.SelectedItem.Text.Trim();
                    branchdetails.AgentCode   = ddlAgency.SelectedItem.Value.ToString();
                    branchdetails.AgentBranch = txtAgentBranch.Text.Trim();
                    branchdetails.BranchName  = txtBranchName.Text.Trim();
                    //branchdetails.BranchAddress = txtBranchAddress.Text.ToString();
                    branchdetails.Phone     = txtPhone.Text.Trim();
                    branchdetails.Email     = txtEmail.Text.Trim();
                    branchdetails.Incharge  = txtIncharge.Text.Trim();
                    branchdetails.CreatedBy = "";

                    opertaion = (sender as Button).Text;

                    if (opertaion == "Update")
                    {
                        branchdetails.Id   = Convert.ToInt32(ViewState["BrnachId"].ToString());
                        branchdetails.Type = "edit";
                    }
                    else
                    {
                        branchdetails.Type = "insert";
                    }

                    var branchResult = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                         <BKIC.SellingPoint.DTO.RequestResponseWrappers.BranchMasterResponse>,
                                                         BKIC.SellingPoint.DTO.RequestResponseWrappers.BranchMaster>
                                           (BKIC.SellingPoint.DTO.Constants.AdminURI.BranchDetailsOperation, branchdetails);

                    if (branchResult.StatusCode == 200 && branchResult.Result.IsTransactionDone)
                    {
                        LoadBranchData(userInfo, service);
                        ClearControl();
                        ddlAgency.SelectedIndex = ddlAgency.Items.IndexOf(ddlAgency.Items.FindByText(userInfo.Agency));

                        if (branchdetails.Type == "insert")
                        {
                            master.ShowErrorPopup("Branch details saved sucessfully", "Branch");
                        }
                        else
                        {
                            master.ShowErrorPopup("Branch details updated sucessfully", "Branch");
                        }
                        //btnSubmit.Text = (branchdetails.Type == "edit") ? "Save" : "Update";
                        btnSubmit.Text = "Save";
                    }
                }
            }
            catch (Exception ex)
            {
                ////throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    string opertaion = string.Empty;

                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();

                    var details = new DTO.RequestResponseWrappers.AgentMaster();
                    details.Agency       = txtAgency.Text.Trim();
                    details.AgentCode    = txtAgentCode.Text.Trim();
                    details.CustomerCode = txtCustomerCode.Text.Trim();

                    // details.AgentBranch = txtAgentBranch.Text.ToString();

                    opertaion = (sender as Button).Text;

                    if (opertaion == "Update")
                    {
                        details.Id   = Convert.ToInt32(ViewState["AgentId"].ToString());
                        details.Type = "edit";
                    }
                    else
                    {
                        details.Type = "insert";
                    }

                    var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgentMasterResponse>,
                                                    BKIC.SellingPoint.DTO.RequestResponseWrappers.AgentMaster>
                                      (BKIC.SellingPoint.DTO.Constants.AdminURI.AgentOperation, details);
                    if (results.StatusCode == 200)
                    {
                        LoadAgentData(userInfo, service);
                        ClearControl();

                        if (details.Type == "insert")
                        {
                            master.ShowErrorPopup("Agent details saved sucessfully", "Agent");
                        }
                        else
                        {
                            master.ShowErrorPopup("Agent details updated sucessfully", "Agent");
                        }

                        btnSubmit.Text = "Save";
                    }
                    else
                    {
                        Response.Write("<script>alert('Unauthorized')</script>");
                        //ExtensionMethod.MsgBox("Unauthorized!", , this);
                    }
                }
            }
            catch (Exception ex)
            {
                ////throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    string opertaion = string.Empty;

                    master.IsSessionAvailable();
                    var userInfo = CommonMethods.GetUserDetails();
                    var service  = CommonMethods.GetLogedInService();
                    var details  = new BKIC.SellingPoint.DTO.RequestResponseWrappers.InsuredMasterDetails
                    {
                        CPR         = HttpUtility.HtmlDecode(txtCPR.Text),
                        FirstName   = HttpUtility.HtmlDecode(txtFirstName.Text),
                        MiddleName  = HttpUtility.HtmlDecode(txtMiddleName.Text),
                        LastName    = HttpUtility.HtmlDecode(txtLastName.Text),
                        Gender      = HttpUtility.HtmlDecode(ddlGender.SelectedValue),
                        Flat        = HttpUtility.HtmlDecode(txtFlat.Text),
                        Building    = HttpUtility.HtmlDecode(txtBuilding.Text),
                        Road        = HttpUtility.HtmlDecode(txtRoad.Text),
                        Block       = HttpUtility.HtmlDecode(txtBlock.Text),
                        Area        = HttpUtility.HtmlDecode(ddlArea.SelectedValue),
                        Mobile      = HttpUtility.HtmlDecode(txtMobile.Text),
                        Email       = HttpUtility.HtmlDecode(txtEmail.Text),
                        Nationality = HttpUtility.HtmlDecode(ddlNationality.SelectedValue),
                        Occupation  = HttpUtility.HtmlDecode(txtOccupation.Text),
                        DateOfBirth = txtDateOfBirth.Text.CovertToCustomDateTime(),
                        PassportNo  = HttpUtility.HtmlDecode(txtPassport.Text),

                        IsActive = true
                    };

                    opertaion = HttpUtility.HtmlDecode((sender as Button).Text);

                    if (opertaion == "Update")
                    {
                        details.InsuredId = _InsuredID;
                        details.Type      = "edit";
                    }
                    else
                    {
                        if (ValidateCPR(details.CPR, userInfo, service))
                        {
                            return;
                        }
                        details.Type = "insert";
                    }
                    details.Agency    = userInfo.Agency;
                    details.AgentCode = userInfo.AgentCode;

                    var results = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.InsuredMasterDetailsResponse>,
                                                    BKIC.SellingPoint.DTO.RequestResponseWrappers.InsuredMasterDetails>
                                      (BKIC.SellingPoint.DTO.Constants.AdminURI.InsuredMasterOperation, details);

                    if (results.StatusCode == 200 && results.Result.IsTransactionDone)
                    {
                        master.ShowLoading = false;
                        if (details.Type == "insert")
                        {
                            if (PageType == 1)
                            {
                                Response.Redirect("DomesticHelp.aspx?CPR=" + details.CPR + "&InsuredCode=" + results.Result.InsuredCode + "&InsuredName=" + results.Result.InsuredName);
                            }
                            else if (PageType == 2)
                            {
                                Response.Redirect("Travelnsurance.aspx?CPR=" + details.CPR + "&InsuredCode=" + results.Result.InsuredCode + "&InsuredName=" + results.Result.InsuredName + "&DOB=" + details.DateOfBirth.ConvertToLocalFormat());
                            }
                            else if (PageType == 3)
                            {
                                Response.Redirect("HomeInsurancePage.aspx?CPR=" + details.CPR + "&InsuredCode=" + results.Result.InsuredCode + "&InsuredName=" + results.Result.InsuredName);
                            }
                            else if (PageType == 4)
                            {
                                Response.Redirect("MotorInsurance.aspx?CPR=" + details.CPR + "&InsuredCode=" + results.Result.InsuredCode + "&InsuredName=" + results.Result.InsuredName + "&DOB=" + details.DateOfBirth.ConvertToLocalFormat());
                            }
                            else if (PageType == 5)
                            {
                                Response.Redirect("MotorTransferEndorsement.aspx?CPR=" + details.CPR + "&InsuredCode=" + results.Result.InsuredCode + "&InsuredName=" + results.Result.InsuredName + "&DOB=" + details.DateOfBirth.ConvertToLocalFormat());
                            }
                            else
                            {
                                master.ShowErrorPopup("Insured Details Saved Successfully", "Insured");
                            }
                        }
                        else if (details.Type == "edit")
                        {
                            master.ShowErrorPopup("Insured Details Updated Successfully", "Insured");
                        }
                        ClearControl();
                        btnSubmit.Text = "Save";
                    }
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }