예제 #1
0
        public virtual void UpdateCVCreatedByClientUser()
        {
            this.CVCreatedByCA = CityVillageService.GetById(601);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = CVCreatedByCA.CityVillageId,
                Name                  = "Updated city by client",
                CityOrVillage         = CityVillageType.Village,
                STDCode               = "0213",
                CAId                  = 1,
                CreatedBy             = 1,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 1
                }
            };

            this.CVCreatedByCA = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);
            Assert.IsFalse(this.CVCreatedByCA.CityVillageId == 0, "New cv updated by client user");
        }
예제 #2
0
        public virtual void CAUserUpdatesCVCreatedBySuperAdmin()
        {
            this.CVInstance = CityVillageService.GetById(1);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = CVInstance.CityVillageId,
                Name                  = "Nellore By CA",
                CityOrVillage         = CityVillageType.City,
                CAId                  = 1, // default CAId=null selected CityVillageId
                CreatedBy             = 1,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 1
                }
            };

            // we are calling update but it should create a new
            this.NewCreatedCVByCAFromExisting = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);
            Assert.IsTrue(this.CVInstance.CityVillageId != NewCreatedCVByCAFromExisting.CityVillageId, "New CityVillage created for CA");
            Assert.IsTrue(NewCreatedCVByCAFromExisting.BaseCityVillageId != null, "BaseCityVillageID Updated");
        }
예제 #3
0
        public virtual void UpdateCVBySuperAdmin()
        {
            this.CVInstance = CityVillageService.GetById(600);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = this.CVInstance.CityVillageId,
                Name                  = "Updated CVCreatedBySuperAdmin",
                CityOrVillage         = CityVillageType.Village,
                STDCode               = "022",
                CAId                  = null,
                CreatedBy             = 1,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 1
                }
            };
            CityVillageDto updatedCV = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);

            Assert.IsTrue(this.CVInstance.Name == updatedCV.Name, "Cityvillage updated");
            Assert.IsTrue(updatedCV.STDCode != CVInstance.STDCode, "cityvillage std code updated");
        }
예제 #4
0
        public ActionResult AddNewCity()
        {
            CityVillageServiceReference.ICityVillageService client  = new CityVillageServiceClient();
            DistrictServiceReference.IDistrictService       dclient = new DistrictServiceClient();

            UserDto        currentUserDto = (UserDto)Session[Constants.SKCURRENTUSER];
            CityVillageDto cityVillageDto = new CityVillageDto();

            cityVillageDto.Name    = Request.Params["ppPlace"].ToString();
            cityVillageDto.STDCode = Request.Params["ppSTDCode"].ToString();
            if (string.Equals(Request.Params["ppCityVillage"].ToString(), "City"))
            {
                cityVillageDto.CityOrVillage = CityVillageType.City;
            }
            else
            {
                cityVillageDto.CityOrVillage = CityVillageType.Village;
            }
            int DistrictId = Convert.ToInt32(Request.Params["ppdistrictId"]);

            cityVillageDto.DistrictOfCityVillage = dclient.GetById(DistrictId);

            cityVillageDto = client.Create(cityVillageDto, currentUserDto.UserName);
            if (cityVillageDto.Response.HasWarning)
            {
                ViewData["Error"] = ErrorAndValidationMessages.BRCityVillageNameValidation;
            }
            else
            {
                TempData["StateSaved"] = "City / Village Saved";
            }
            string controlPrefix = Request.Params["CommonControlPrefix"];

            Cams.Web.MVCRazor.Models.Shared.StateDistrictCityControlNamesModel model = new Cams.Web.MVCRazor.Models.Shared.StateDistrictCityControlNamesModel(controlPrefix);
            model.HiddenFieldForCityVillageValue = cityVillageDto.CityVillageId;
            model.HiddenFieldForDistrictValue    = cityVillageDto.DistrictOfCityVillage.DistrictId;

            return(PartialView("CallBackPopupAddCity", model));
        }
예제 #5
0
        public virtual void CAUserUpdatesCVCreatedByHimselfButWithNameSameExistingCityVillage()
        {
            this.NewCreatedCVByCAFromExisting = CityVillageService.GetById(603);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = this.NewCreatedCVByCAFromExisting.CityVillageId,
                Name                  = "Nellore",
                CAId                  = 1, // default CAId=null selected CityVillageId
                BaseCityVillageId     = NewCreatedCVByCAFromExisting.BaseCityVillageId,
                CreatedBy             = 1,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 2
                }
            };
            // Now cityvillage with the same name exist it has CAid NULL and CityVillageId is same as base CityVillageId
            // it should update // in this case ispresent should return false
            CityVillageDto cityvillageDto = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);

            Assert.IsTrue(cvdto.Name == cityvillageDto.Name, "CityVillage Updated as it exists but existing CityVillageId = BaseCityVillageId");
            Assert.IsTrue(NewCreatedCVByCAFromExisting.BaseCityVillageId == cityvillageDto.BaseCityVillageId, "Base Bank ID remains same");
        }
예제 #6
0
        public virtual void CAUserUpdates1()
        {
            this.NewCreatedCVByCAFromExisting = CityVillageService.GetById(603);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = this.NewCreatedCVByCAFromExisting.CityVillageId,
                Name                  = "Chittor",
                CityOrVillage         = CityVillageType.City,
                CAId                  = 1, // default CAId=null selected bankid
                BaseCityVillageId     = NewCreatedCVByCAFromExisting.BaseCityVillageId,
                CreatedBy             = 1,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 9
                }
            };
            // Now cityvillage with the same name exist it has CAid NULL and CityVillageId is not same as base CityVillageId
            // it should not update // in this case ispresent should return true
            CityVillageDto cityvillageDto = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);

            Assert.IsTrue(cityvillageDto.Response.HasWarning, "Place Already Exist");
            Assert.IsTrue(NewCreatedCVByCAFromExisting.BaseCityVillageId == cityvillageDto.BaseCityVillageId, "BaseCityVillageId remains same");
        }
예제 #7
0
        public virtual void CAUserUpdatesCVCreatedByHimself()
        {
            this.NewCreatedCVByCAFromExisting = CityVillageService.GetById(603);
            var cvdto = new CityVillageDto
            {
                CityVillageId         = this.NewCreatedCVByCAFromExisting.CityVillageId,
                Name                  = "Nellore By CA",
                CityOrVillage         = CityVillageType.City,
                STDCode               = "0124",
                CAId                  = 1, // default CAId=null selected CityVillageId
                CreatedBy             = 1,
                BaseCityVillageId     = NewCreatedCVByCAFromExisting.BaseCityVillageId,
                ModifiedBy            = 1,
                DistrictOfCityVillage = new DistrictDto
                {
                    DistrictId = 2
                }
            };

            CityVillageDto cityvillageDto = this.CityVillageService.Update(cvdto, CurrentUserInstance.UserName);

            Assert.IsTrue(cityvillageDto.CityVillageId == NewCreatedCVByCAFromExisting.CityVillageId, "CA updates cityvillage created by himsef");
            Assert.IsTrue(NewCreatedCVByCAFromExisting.BaseCityVillageId != null, "BaseCityVillageId Updated");
        }
예제 #8
0
 public CityVillageDto Create(CityVillageDto cityvillageDto, string userName)
 {
     return(ExecuteCommand(proxy => proxy.Create(cityvillageDto, userName)));
 }
예제 #9
0
 public CityVillageDto Create(CityVillageDto cityvillageDto, string userName)
 {
     return(ExecuteCommand(() => Service.Create(cityvillageDto, userName)));
 }
예제 #10
0
        public ActionResult AddClientPartnerToSession([ModelBinder(typeof(DevExpressEditorsBinder))] ClientPartnersModel CPmodel)
        {
            ViewData["Error"]   = null;
            TempData["Success"] = null;
            if (Request.QueryString["cpmode"] != null)
            {
                cpmode = Request.QueryString["cpmode"].ToString();
            }
            if (Request.QueryString["partnerid"] != null)
            {
                partnerid = Request.QueryString["partnerid"].ToString();
            }
            string mode = string.Empty;

            if (Request.QueryString["mode"] != null)
            {
                mode = Request.QueryString["mode"].ToString();
            }
            ClientPartnerDetailsDto NewPartnerDto = new ClientPartnerDetailsDto();

            DesignationServiceReference.DesignationServiceClient DesignationClient = null;
            CityVillageServiceReference.CityVillageServiceClient CityClient        = null;

            try
            {
                if (CPmodel.StateDistrictPlacesControlNames != null)
                {
                    for (int i = 0; i < CPmodel.StateDistrictPlacesControlNames.Count; i++)
                    {
                        CPmodel.StateDistrictPlacesControlNames[i].HiddenFieldForCityVillageValue =
                            !String.IsNullOrEmpty(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].PlacesComboName + "_VI"]) ?
                            Convert.ToInt32(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].PlacesComboName + "_VI"]) : 0;
                        CPmodel.StateDistrictPlacesControlNames[i].HiddenFieldForDistrictValue =
                            !String.IsNullOrEmpty(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].DistrictComboName + "_VI"]) ?
                            Convert.ToInt32(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].DistrictComboName + "_VI"]) : 0;
                        CPmodel.StateDistrictPlacesControlNames[i].HiddenFieldForStateValue =
                            !String.IsNullOrEmpty(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].StateComboName + "_VI"]) ?
                            Convert.ToInt32(Request.Params[CPmodel.StateDistrictPlacesControlNames[i].StateComboName + "_VI"]) : 0;
                    }
                }

                if (EditorExtension.GetValue <object>(CPmodel.dOBnAgeModellist[0].txtDOBnAgeName) != null)
                {
                    CPmodel.dOBnAgeModellist[0].BindDate = EditorExtension.GetValue <DateTime>(CPmodel.dOBnAgeModellist[0].txtDOBnAgeName);
                }
                if (ComboBoxExtension.GetValue <object>(CPmodel.designationModel[0].DDLDesignations) != null)
                {
                    CPmodel.designationModel[0].SelectedId = ComboBoxExtension.GetValue <int>(CPmodel.designationModel[0].DDLDesignations);
                }
                if (EditorExtension.GetValue <object>("txtJoiningDate") != null)
                {
                    CPmodel.JoiningDate = EditorExtension.GetValue <DateTime>("txtJoiningDate");
                }
                if (EditorExtension.GetValue <object>("txtRelievingDate") != null)
                {
                    CPmodel.RelievingDate = EditorExtension.GetValue <DateTime>("txtRelievingDate");
                }
                if (EditorExtension.GetValue <object>(CPmodel.dOBnAgeModellist[1].txtDOBnAgeName) != null)
                {
                    CPmodel.dOBnAgeModellist[1].BindDate = EditorExtension.GetValue <DateTime>(CPmodel.dOBnAgeModellist[1].txtDOBnAgeName);
                }

                CheckForAOValidation(CPmodel, mode);

                UserDto CurrentUser = (UserDto)Session[Constants.SKCURRENTUSER];

                if (ModelState.IsValid)
                {
                    #region Client Partner Details

                    NewPartnerDto.PartnerName  = CPmodel.PartnerName;
                    NewPartnerDto.Gender       = CPmodel.Gender;
                    NewPartnerDto.PAN          = CPmodel.PAN;
                    NewPartnerDto.UID          = CPmodel.UID;
                    NewPartnerDto.IsActive     = CPmodel.IsActive;
                    NewPartnerDto.Email1       = CPmodel.Email1;
                    NewPartnerDto.Email2       = CPmodel.Email2;
                    NewPartnerDto.ModifiedBy   = CurrentUser.UserId;
                    NewPartnerDto.ModifiedDate = DateTime.Now;

                    #region Partner Designation
                    DesignationDto designationDto = null;
                    if (CPmodel.designationModel[0].SelectedId > 0)
                    {
                        DesignationClient = new DesignationServiceClient();
                        designationDto    = DesignationClient.GetById(CPmodel.designationModel[0].SelectedId);
                    }
                    if (designationDto != null)
                    {
                        NewPartnerDto.ClientPartnerDesignation = designationDto;
                    }
                    #endregion

                    #region Date fields
                    if (CPmodel.dOBnAgeModellist[0].BindDate != DateTime.MinValue)
                    {
                        NewPartnerDto.DateOfBirth = CPmodel.dOBnAgeModellist[0].BindDate;
                    }
                    if (CPmodel.JoiningDate != DateTime.MinValue)
                    {
                        NewPartnerDto.JoiningDate = CPmodel.JoiningDate;
                    }
                    if (CPmodel.RelievingDate != DateTime.MinValue && CPmodel.RelievingDate != Helper.SetDefaultDate())
                    {
                        NewPartnerDto.RelievingDate = CPmodel.RelievingDate;
                    }

                    #endregion

                    #region Partner Address,City/Village
                    int cityVillageID = 0;
                    if (CPmodel.ClientPartnerAddress != null)
                    {
                        NewPartnerDto.ClientPartnerAddress = CPmodel.ClientPartnerAddress;
                        if (CPmodel.StateDistrictPlacesControlNames[0].HiddenFieldForStateValue > 0)
                        {
                            cityVillageID = ComboBoxExtension.GetValue <int>(CPmodel.StateDistrictPlacesControlNames[0].PlacesComboName);
                            CityClient    = new CityVillageServiceClient();
                            CityVillageDto cityVillageDto = CityClient.GetById(cityVillageID);
                            if (cityVillageDto != null)
                            {
                                NewPartnerDto.ClientPartnerAddress.CityVillage = cityVillageDto;
                            }
                            CityClient.Close();
                        }
                    }
                    #endregion

                    #region Partner Contact Details
                    NewPartnerDto.ClientPartnerContacts = CPmodel.ClientPartnerContacts;
                    if (NewPartnerDto.ClientPartnerContacts != null && NewPartnerDto.ClientPartnerContacts.Count == 1)
                    {
                        if (NewPartnerDto.ClientPartnerContacts[0].ContactNo == null)
                        {
                            NewPartnerDto.ClientPartnerContacts.RemoveAt(0);
                        }
                    }
                    #endregion

                    #endregion

                    #region Gardian Details
                    bool isMinor = false;
                    if (CPmodel.dOBnAgeModellist[0].BindDate != DateTime.MinValue)
                    {
                        isMinor = IsMinor(CPmodel.dOBnAgeModellist[0].BindDate);
                    }
                    if (CPmodel.ClientPartnerGuardian != null && isMinor)
                    {
                        NewPartnerDto.ClientPartnerGuardian = CPmodel.ClientPartnerGuardian;

                        if (CPmodel.dOBnAgeModellist[1].BindDate != DateTime.MinValue)
                        {
                            NewPartnerDto.ClientPartnerGuardian.DateOfBirth = CPmodel.dOBnAgeModellist[1].BindDate;
                        }

                        if (CPmodel.ClientPartnerGuardian.ClientPartnerGuardianAddress != null)
                        {
                            //NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianAddress = CPmodel.ClientPartnerGuardian.ClientPartnerGuardianAddress;
                            if (CPmodel.StateDistrictPlacesControlNames[1].HiddenFieldForStateValue > 0)
                            {
                                cityVillageID = ComboBoxExtension.GetValue <int>(CPmodel.StateDistrictPlacesControlNames[1].PlacesComboName);
                                CityClient    = new CityVillageServiceClient();
                                CityVillageDto cityVillageDto = CityClient.GetById(cityVillageID);
                                if (cityVillageDto != null)
                                {
                                    NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianAddress.CityVillage = cityVillageDto;
                                }
                                CityClient.Close();
                            }
                        }

                        //NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianContacts = CPmodel.ClientPartnerGuardian.ClientPartnerGuardianContacts;
                        if (NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianContacts != null && NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianContacts.Count == 1)
                        {
                            if (NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianContacts[0].ContactNo == null)
                            {
                                NewPartnerDto.ClientPartnerGuardian.ClientPartnerGuardianContacts.RemoveAt(0);
                            }
                        }
                    }
                    #endregion

                    #region Session Part
                    if (Session["AOUploadedImageFileName"] != null)
                    {
                        NewPartnerDto.Image = Session["AOUploadedImageFileName"].ToString();
                    }
                    if (Session["AOGuardianCallbacksImageUpload"] != null)
                    {
                        NewPartnerDto.ClientPartnerGuardian.Image = Session["AOGuardianCallbacksImageUpload"].ToString();
                    }

                    if (Session["ClientPartners"] == null)
                    {
                        Session["ClientPartners"] = new List <ClientPartnerDetailsDto>();
                    }



                    int index = 0;
                    if (!String.IsNullOrEmpty(cpmode) && !String.IsNullOrEmpty(partnerid))
                    {
                        index = ((List <ClientPartnerDetailsDto>)Session["ClientPartners"]).FindIndex(x => x.PartnerId == Convert.ToInt32(partnerid));
                        ((List <ClientPartnerDetailsDto>)Session["ClientPartners"]).RemoveAt(index);
                        ((List <ClientPartnerDetailsDto>)Session["ClientPartners"]).Insert(index, NewPartnerDto);
                    }
                    else
                    {
                        NewPartnerDto.CreatedBy   = CurrentUser.UserId;
                        NewPartnerDto.CreatedDate = DateTime.Now;
                        NewPartnerDto.PartnerId   = (((List <ClientPartnerDetailsDto>)Session["ClientPartners"]).Count) + 1;
                        ((List <ClientPartnerDetailsDto>)Session["ClientPartners"]).Add(NewPartnerDto);
                    }
                    #endregion
                    return(RedirectToAction("ClientRegistrationIndex", "ClientAccount", new { mode = mode }));
                }
                else
                {
                    ViewData["Error"] = "error";
                }
            }
            catch (Exception ex)
            {
                return(View("ErrorPage"));
            }
            return(View("ClientPartnersAdd", CPmodel));
        }
예제 #11
0
        public override BankBranch EntityDtoToEntity(BankBranchDto entityDto)
        {
            BankBranch bankbranch = Mapper.Map <BankBranchDto, BankBranch>(entityDto);

            if (entityDto != null)
            {
                #region Branch
                if (entityDto.BranchId != 0)
                {
                    BankBranchService branchservice = new BankBranchService();
                    BankBranchDto     branchdto     = branchservice.GetById(entityDto.BranchId);
                    bool isDirty = BankBranch.IsDirty(entityDto, branchdto);
                    if (isDirty)
                    {
                        if (entityDto.CAId != null && (entityDto.CAId != branchdto.CAId))
                        {
                            entityDto.BranchId                      = 0;
                            entityDto.BaseBranchId                  = branchdto.BranchId;
                            entityDto.BranchAddress.AddressId       = 0;
                            entityDto.WeeklyOffDay.WeeklyOffDayId   = 0;
                            entityDto.WeeklyHalfDay.WeeklyHalfDayId = 0;
                            if (entityDto.BranchContactNos != null)
                            {
                                foreach (ContactDetailsDto cddto in entityDto.BranchContactNos)
                                {
                                    ContactDetails branchcontactdetails = new Entities.ContactDetails();
                                    branchcontactdetails = Mapper.Map <ContactDetailsDto, ContactDetails>(cddto);
                                    bankbranch.BranchContactNos.Add(branchcontactdetails);
                                }
                            }
                            bankbranch = Mapper.Map <BankBranchDto, BankBranch>(entityDto);
                        }
                        else if (entityDto.CAId == branchdto.CAId)
                        {
                            bankbranch = Mapper.Map <BankBranchDto, BankBranch>(entityDto);
                        }
                        else
                        {
                            bankbranch = Mapper.Map <BankBranchDto, BankBranch>(branchdto);
                        }
                    }
                }
                #endregion

                #region Bank
                if (entityDto.BranchOfBank != null && entityDto.BranchOfBank.BankId != 0)
                {
                    BankService bankService = new BankService();
                    BankDto     bankDto     = bankService.GetById(entityDto.BranchOfBank.BankId);
                    bankbranch.BranchOfBank = Mapper.Map <BankDto, Bank>(bankDto);
                }
                else
                {
                    bankbranch.BranchOfBank = Mapper.Map <BankDto, Bank>(entityDto.BranchOfBank);
                }
                #endregion

                #region Branch Address
                if (entityDto.BranchAddress != null)
                {
                    bankbranch.BranchAddress = Mapper.Map <AddressDto, Address>(entityDto.BranchAddress);
                    if (entityDto.BranchAddress.CityVillage != null)
                    {
                        if (entityDto.BranchAddress.CityVillage.CityVillageId != 0)
                        {
                            CityVillageService cityvillageService = new CityVillageService();
                            CityVillageDto     cityvillageDto     = cityvillageService.GetById(entityDto.BranchAddress.CityVillage.CityVillageId);
                            bankbranch.BranchAddress.CityVillage = Mapper.Map <CityVillageDto, CityVillage>(cityvillageDto);
                            bankbranch.BranchAddress.CityVillage.DistrictOfCityVillage = Mapper.Map <DistrictDto, District>(cityvillageDto.DistrictOfCityVillage);
                            bankbranch.BranchAddress.CityVillage.DistrictOfCityVillage.StateOfDistrict = Mapper.Map <StateDto, State>(cityvillageDto.DistrictOfCityVillage.StateOfDistrict);
                        }
                        else
                        {
                            bankbranch.BranchAddress.CityVillage = Mapper.Map <CityVillageDto, CityVillage>(entityDto.BranchAddress.CityVillage);
                        }
                    }
                }
                #endregion

                #region Branch Contacts
                bankbranch.BranchContactNos.Clear();
                if (entityDto.BranchContactNos != null)
                {
                    foreach (ContactDetailsDto contactdetailsdto in entityDto.BranchContactNos)
                    {
                        ContactDetails bankbranchcontactdetails = new Entities.ContactDetails();
                        bankbranchcontactdetails = Mapper.Map <ContactDetailsDto, ContactDetails>(contactdetailsdto);
                        bankbranch.BranchContactNos.Add(bankbranchcontactdetails);
                    }
                }
                #endregion

                #region Weekly HalfDay
                bankbranch.WeeklyHalfDay = Mapper.Map <WeeklyHalfDayDto, WeeklyHalfDay>(entityDto.WeeklyHalfDay);
                #endregion

                #region Weekly Offday
                bankbranch.WeeklyOffDay = Mapper.Map <WeeklyOffDaysDto, WeeklyOffDays>(entityDto.WeeklyOffDay);
                #endregion

                #region BranchOfClientSubscriptionPayment
                bankbranch.BranchOfClientSubscriptionPayment.Clear();
                if (entityDto.BranchOfClientSubscriptionPayment != null)
                {
                    foreach (ClientSubscriptionPaymentDetailsDto clientsubscriptionpaymentDto in entityDto.BranchOfClientSubscriptionPayment)
                    {
                        ClientSubscriptionPaymentDetails clientsubscriptionpayment = Mapper.Map <ClientSubscriptionPaymentDetailsDto, ClientSubscriptionPaymentDetails>(clientsubscriptionpaymentDto);
                        bankbranch.BranchOfClientSubscriptionPayment.Add(clientsubscriptionpayment);
                    }
                }
                #endregion

                #region BranchOfClientPartner
                bankbranch.BranchOfClientSubscriptionPayment.Clear();
                if (entityDto.BranchOfClientPartner != null)
                {
                    foreach (ClientPartnerBankDetailsDto clientpartnerbankDto in entityDto.BranchOfClientPartner)
                    {
                        ClientPartnerBankDetails clientpartnerbank = Mapper.Map <ClientPartnerBankDetailsDto, ClientPartnerBankDetails>(clientpartnerbankDto);
                        bankbranch.BranchOfClientPartner.Add(clientpartnerbank);
                    }
                }
                #endregion
            }
            return(bankbranch);
        }
        public void SavePrimaryContactDetails(ClientRegistrationModel clientRegistrationModel)
        {
            ClientRegistrationModel companyProfile = GetClientModelFromSession();

            Session["ClientRegistrationActiveTab"] = GetValueFromRequestParams("currentIndex");
            ClientPrimaryContactPersonDto cPCPDetails = new ClientPrimaryContactPersonDto();

            if (Request.IsAjaxRequest())
            {
                cPCPDetails.Title             = GetValueFromRequestParams("Title");
                cPCPDetails.Gender            = GetValueFromRequestParams("Gender");
                cPCPDetails.MothersMaidenName = GetValueFromRequestParams("MothersMaidenName");
                cPCPDetails.DateOfBirth       = ConvertStringToDate(GetValueFromRequestParams("DateOfBirth"));
                cPCPDetails.PAN = GetValueFromRequestParams("PAN");
                cPCPDetails.UID = GetValueFromRequestParams("UID");
                cPCPDetails.CAPrimaryConatactPersonName = GetValueFromRequestParams("CLRPCPName");
                cPCPDetails.IsSameAsCompanyAddress      = GetBoolValueFromRequestParams("IsSameAsCompanyAddress");
                cPCPDetails.IsSameAsCompanyContact      = GetBoolValueFromRequestParams("IsSameAsCompanyContact");

                cPCPDetails.ClientPrimaryContactPersonDesignation = new DesignationDto
                {
                    DesignationId = GetIntValueFromRequestParams("DesignationId")
                };
                cPCPDetails.ClientPrimaryContactPersonAddress = new Common.Dto.Address.AddressDto
                {
                    AddressLine1 = GetValueFromRequestParams("AddressLine1")
                };
                int cityVillageId = (Request.Params["CityVillageId"]) != null?Convert.ToInt32(Request.Params["CityVillageId"]) : 0;

                if (cityVillageId != 0)
                {
                    CityVillageServiceReference.CityVillageServiceClient cityVillageServiceClient = new CityVillageServiceClient();
                    CityVillageDto cityVillageDto = cityVillageServiceClient.GetById(cityVillageId);
                    cPCPDetails.ClientPrimaryContactPersonAddress.CityVillage = cityVillageDto;
                }
                cPCPDetails.ClientPrimaryContactPersonAddress.PIN = GetValueFromRequestParams("PIN");
                cPCPDetails.Email1 = GetValueFromRequestParams("Email1");
                cPCPDetails.Email2 = GetValueFromRequestParams("Email2");
                cPCPDetails.ClientPrimaryContacts = GetContactsFromString(Request.Params["contactDetails"]);
            }
            else
            {
                cPCPDetails.Title             = clientRegistrationModel.ClientPrimaryContactPerson.Title;
                cPCPDetails.Gender            = clientRegistrationModel.ClientPrimaryContactPerson.Gender;
                cPCPDetails.MothersMaidenName = clientRegistrationModel.ClientPrimaryContactPerson.MothersMaidenName;
                cPCPDetails.DateOfBirth       = clientRegistrationModel.ClientPrimaryContactPerson.DateOfBirth;
                cPCPDetails.PAN = clientRegistrationModel.ClientPrimaryContactPerson.PAN;
                cPCPDetails.UID = clientRegistrationModel.ClientPrimaryContactPerson.UID;
                cPCPDetails.CAPrimaryConatactPersonName = clientRegistrationModel.ClientPrimaryContactPerson.CAPrimaryConatactPersonName;
                cPCPDetails.IsSameAsCompanyAddress      = clientRegistrationModel.ClientPrimaryContactPerson.IsSameAsCompanyAddress;
                cPCPDetails.IsSameAsCompanyContact      = clientRegistrationModel.ClientPrimaryContactPerson.IsSameAsCompanyContact;

                if (ComboBoxExtension.GetValue <object>(clientRegistrationModel.designationModel[0].DDLDesignations) != null)
                {
                    cPCPDetails.ClientPrimaryContactPersonDesignation = new DesignationDto
                    {
                        DesignationId = ComboBoxExtension.GetValue <int>(clientRegistrationModel.designationModel[0].DDLDesignations)
                    };
                }

                cPCPDetails.ClientPrimaryContactPersonAddress = new Common.Dto.Address.AddressDto
                {
                    AddressLine1 = clientRegistrationModel.ClientPrimaryContactPerson.ClientPrimaryContactPersonAddress.AddressLine1
                };
                int cityVillageId = clientRegistrationModel.StateDistrictPlacesControlNames[1].HiddenFieldForCityVillageValue;
                if (cityVillageId != 0)
                {
                    CityVillageServiceReference.CityVillageServiceClient cityVillageServiceClient = new CityVillageServiceClient();
                    CityVillageDto cityVillageDto = cityVillageServiceClient.GetById(cityVillageId);
                    cPCPDetails.ClientPrimaryContactPersonAddress.CityVillage = cityVillageDto;
                }
                cPCPDetails.ClientPrimaryContactPersonAddress.PIN = clientRegistrationModel.ClientPrimaryContactPerson.ClientPrimaryContactPersonAddress.PIN;
                cPCPDetails.Email1 = clientRegistrationModel.ClientPrimaryContactPerson.Email1;
                cPCPDetails.Email2 = clientRegistrationModel.ClientPrimaryContactPerson.Email2;
                cPCPDetails.ClientPrimaryContacts = clientRegistrationModel.ClientPrimaryContactPerson.ClientPrimaryContacts;
            }
            companyProfile.ClientPrimaryContactPerson = cPCPDetails;
            if (Session["PrimaryContactPersonUploadedImageFileName"] != null)
            {
                companyProfile.ClientPrimaryContactPerson.Image = Session["PrimaryContactPersonUploadedImageFileName"].ToString();
            }
            Session["CompanyProfile"] = companyProfile;
        }