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; } }
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 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; } }
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) { 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; } }