コード例 #1
0
        /// <summary>
        /// Added By : Himanshu Pandya
        /// Date : 30-12-2012
        /// Desc : Save New Fix Deposite Details
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSaveFixDepoisite_Click(object sender, EventArgs e)
        {
            objFixDeposite = new clsFixDeposite();
            objNominee = new clsNominees();
            try
            {
                if (Page.IsValid)
                {
                    if (!string.IsNullOrEmpty(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString())))
                    {
                        objFixDeposite.FixDepositeId = !string.IsNullOrEmpty(hdnFixDepositeId.Value) ? Convert.ToInt32(hdnFixDepositeId.Value.ToString()) : 0;
                        objFixDeposite.CustomerId = !string.IsNullOrEmpty(hdnCustomerId.Value) ? Convert.ToInt32(hdnCustomerId.Value.ToString()) : 0;
                        objFixDeposite.FixDepositeDate = !string.IsNullOrEmpty(txtFixDepositeDate.Text) ? txtFixDepositeDate.Text : string.Empty;
                        objFixDeposite.FixDepositeTypeId = !string.IsNullOrEmpty(ddlFDPeriodYears.SelectedValue) ? Convert.ToInt32(ddlFDPeriodYears.SelectedValue.ToString()) : 0;
                        objFixDeposite.FixDepositeAmount = !string.IsNullOrEmpty(txtFixDepositeAmount.Text) ? Convert.ToDecimal(txtFixDepositeAmount.Text) : 0;
                        objFixDeposite.MaturityDate = !string.IsNullOrEmpty(txtFDMaturityDate.Text) ? txtFDMaturityDate.Text : string.Empty;
                        objFixDeposite.MaturityAmount = !string.IsNullOrEmpty(txtFDMaturityAmt.Text) ? Convert.ToDecimal(txtFDMaturityAmt.Text) : 0;
                        objFixDeposite.IsClosed = false;
                        objFixDeposite.ClosedDate = string.Empty;
                        objFixDeposite.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                        objFixDeposite.CreatedDate = Convert.ToDateTime(txtFixDepositeDate.Text);
                        objFixDeposite.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                        objFixDeposite.UpdatedDate = Convert.ToDateTime(txtFixDepositeDate.Text);
                        objFixDeposite.IsActive = true;

                        if (objFixDeposite.Insert())
                        {
                            //Customer Nominee Details
                            objNominee.NomineeId = !string.IsNullOrEmpty(hdnNomineeId.Value) ? Convert.ToInt32(hdnNomineeId.Value.ToString()) : 0;
                            objNominee.NomineeReferenceId = objFixDeposite.FixDepositeId > 0 ? objFixDeposite.FixDepositeId : 0;
                            objNominee.NomineeTypeId = Convert.ToInt32(clsEnum.NomineeType.FixDeposite.GetHashCode().ToString());
                            objNominee.NamePrefix = !string.IsNullOrEmpty(ddlFDNomineePrefix.SelectedValue) ? ddlFDNomineePrefix.SelectedValue.ToString() : string.Empty;
                            objNominee.FirstName = !string.IsNullOrEmpty(txtFDNomineeFirstname.Text) ? txtFDNomineeFirstname.Text.ToString() : string.Empty;
                            objNominee.MiddleName = !string.IsNullOrEmpty(txtFDNomineeMiddlename.Text) ? txtFDNomineeMiddlename.Text.ToString() : string.Empty;
                            objNominee.LastName = !string.IsNullOrEmpty(txtFDNomineeLastname.Text) ? txtFDNomineeLastname.Text.ToString() : string.Empty;
                            objNominee.Address = !string.IsNullOrEmpty(txtFDNomineeAddress.Text) ? txtFDNomineeAddress.Text.ToString() : string.Empty;
                            objNominee.VillageId = !string.IsNullOrEmpty(ddlFDNomineeVillage.Text) ? ddlFDNomineeVillage.Text.ToString() : string.Empty;
                            objNominee.TahsilId = !string.IsNullOrEmpty(ddlFDNomineeTaluka.SelectedValue) ? Convert.ToInt32(ddlFDNomineeTaluka.SelectedValue.ToString()) : 0;
                            objNominee.DistrictId = !string.IsNullOrEmpty(ddlFDNomineeDistrict.SelectedValue) ? Convert.ToInt32(ddlFDNomineeDistrict.SelectedValue.ToString()) : 0;
                            objNominee.PinCode = !string.IsNullOrEmpty(txtFDNomineePinCode.Text) ? txtFDNomineePinCode.Text.ToString() : string.Empty;
                            objNominee.PhoneNumber = !string.IsNullOrEmpty(txtFDNomineePhonenumber.Text) ? txtFDNomineePhonenumber.Text.ToString() : string.Empty;
                            objNominee.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            objNominee.CreatedDate = Convert.ToDateTime(txtFixDepositeDate.Text);
                            objNominee.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            objNominee.UpdatedDate = Convert.ToDateTime(txtFixDepositeDate.Text);
                            objNominee.IsActive = true;
                            objNominee.Insert();

                            lblFixDepositeMessage.CssClass = "SuccessfulMessage";
                            lblFixDepositeMessage.Text = (String)GetGlobalResourceObject("SharedResource", "RecordSavedSuccessfully");
                        }
                        else
                        {
                            lblFixDepositeMessage.CssClass = "FailureMessage";
                            lblFixDepositeMessage.Text = (String)GetGlobalResourceObject("SharedResource", "LoginSessionExpire");
                        }
                    }
                }
                ClearFDControls();
                BindFixDepositesGrid();
                ShowHideFixDepositeGrid(true);
            }
            catch
            {
            }
            finally
            {
                objFixDeposite = null;
                objNominee = null;
            }
        }
コード例 #2
0
        /// <summary>
        /// Added By : Himanshu Pandya 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSaveCustomer_Click(object sender, EventArgs e)
        {
            ObjCustomer = new clsCustomer();
            ObjNominee = new clsNominees();
            ObjAccounts = new clsAccounts();
            try
            {
                if (!string.IsNullOrEmpty(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString())))
                {
                    //Customer Detials
                    ObjCustomer.CustomerId = !string.IsNullOrEmpty(hdnCusotmerId.Value) ? Convert.ToInt32(hdnCusotmerId.Value.ToString()) : 0;
                    //ObjCustomer.CustomerCode = (!string.IsNullOrEmpty(ddlCustomerCodePrefix.SelectedValue) ? ddlCustomerCodePrefix.SelectedValue.ToString() : string.Empty) + "-" + (!string.IsNullOrEmpty(txtCustomerNo.Text) ? txtCustomerNo.Text : string.Empty);
                    ObjCustomer.CustomerCode = !string.IsNullOrEmpty(txtCustomerNo.Text) ? txtCustomerNo.Text : string.Empty;
                    ObjCustomer.CustomerTypeId = !string.IsNullOrEmpty(ddlCustomerType.SelectedValue) ? Convert.ToInt32(ddlCustomerType.SelectedValue.ToString()) : 0;
                    ObjCustomer.BankBranchId = !string.IsNullOrEmpty(ddlBankBranches.SelectedValue) ? Convert.ToInt32(ddlBankBranches.SelectedValue.ToString()) : 0;
                    ObjCustomer.NamePrifix = !string.IsNullOrEmpty(ddlCustomernamePrefix.SelectedValue) ? ddlCustomernamePrefix.SelectedValue.ToString() : string.Empty;
                    ObjCustomer.FirstName = !string.IsNullOrEmpty(txtCusotmerFirstname.Text) ? txtCusotmerFirstname.Text : string.Empty;
                    ObjCustomer.MiddleName = !string.IsNullOrEmpty(txtCustomerMiddlename.Text) ? txtCustomerMiddlename.Text : string.Empty;
                    ObjCustomer.LastName = !string.IsNullOrEmpty(txtCustomerLastname.Text) ? txtCustomerLastname.Text : string.Empty;
                    ObjCustomer.Address1 = !string.IsNullOrEmpty(txtCusotomerAddress.Text) ? txtCusotomerAddress.Text : string.Empty;
                    ObjCustomer.VillageId = !string.IsNullOrEmpty(ddlCustomerVillage.Text) ? ddlCustomerVillage.Text : string.Empty;

                    //ObjCustomer.VillageId = !string.IsNullOrEmpty(ddlCustomerVillage.SelectedValue) ? Convert.ToInt32(ddlCustomerVillage.SelectedValue.ToString()) : 0;
                    ObjCustomer.TahsilId = !string.IsNullOrEmpty(ddlCustomerTaluka.SelectedValue) ? Convert.ToInt32(ddlCustomerTaluka.SelectedValue.ToString()) : 0;
                    ObjCustomer.DistrictId = !string.IsNullOrEmpty(ddlCustomerDistrict.SelectedValue) ? Convert.ToInt32(ddlCustomerDistrict.SelectedValue.ToString()) : 0;
                    ObjCustomer.Pincode = !string.IsNullOrEmpty(txtCustomerPinCode.Text) ? txtCustomerPinCode.Text.ToString() : string.Empty;
                    ObjCustomer.PhoneNumber = !string.IsNullOrEmpty(txtCustomerPhoneNumber.Text) ? txtCustomerPhoneNumber.Text.ToString() : "";
                    ObjCustomer.DateOfBirth = !string.IsNullOrEmpty(txtCustomerDOB.Text) ? txtCustomerDOB.Text.ToString() : string.Empty;
                    ObjCustomer.Email = !string.IsNullOrEmpty(txtCustomerEmail.Text) ? txtCustomerEmail.Text.ToString() : string.Empty;
                    ObjCustomer.SchoolName = !string.IsNullOrEmpty(txtCustomerSchoolname.Text) ? txtCustomerSchoolname.Text.ToString() : string.Empty;
                    ObjCustomer.SchoolTahsilId = !string.IsNullOrEmpty(ddlCustomerSchoolTaluka.SelectedValue) ? Convert.ToInt32(ddlCustomerSchoolTaluka.SelectedValue.ToString()) : 0;
                    ObjCustomer.SchoolDistrictId = !string.IsNullOrEmpty(ddlCusotmerSchoolDistrict.SelectedValue) ? Convert.ToInt32(ddlCusotmerSchoolDistrict.SelectedValue.ToString()) : 0;
                    ObjCustomer.SchoolPinCode = !string.IsNullOrEmpty(txtCustomerSchoolPinCode.Text) ? txtCustomerSchoolPinCode.Text.ToString() : string.Empty;

                    ObjCustomer.CustomerPanCard = !string.IsNullOrEmpty(txtCustomerPanCard.Text) ? txtCustomerPanCard.Text.ToString() : string.Empty;
                    //ObjCustomer.TotalYearOfService = !string.IsNullOrEmpty(txtCustTotalYearOfService.Text) ? txtCustTotalYearOfService.Text.ToString() : string.Empty;
                    ObjCustomer.EmploymentYear = !string.IsNullOrEmpty(txtCustEmploymentYear.Text) ? txtCustEmploymentYear.Text.ToString() : string.Empty;
                    //ObjCustomer.CustomerYear = !string.IsNullOrEmpty(txtCustomerYear.Text) ? txtCustomerYear.Text.ToString() : string.Empty;
                    ObjCustomer.Salary = !string.IsNullOrEmpty(txtCustomerSalary.Text) ? Convert.ToDecimal(txtCustomerSalary.Text.ToString()) : 0;
                    ObjCustomer.RetirementYear = !string.IsNullOrEmpty(txtCustRetirementDate.Text) ? txtCustRetirementDate.Text.ToString() : string.Empty;

                    ObjCustomer.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                    ObjCustomer.CreatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                    ObjCustomer.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                    ObjCustomer.UpdatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                    ObjCustomer.IsActive = true;

                    if (ObjCustomer.Insert())
                    {
                        //Customer Nominee Details
                        ObjNominee.NomineeId = !string.IsNullOrEmpty(hdnNomineeId.Value) ? Convert.ToInt32(hdnNomineeId.Value.ToString()) : 0;
                        ObjNominee.NomineeReferenceId = ObjCustomer.CustomerId > 0 ? ObjCustomer.CustomerId : 0;
                        ObjNominee.NomineeTypeId = Convert.ToInt32(clsEnum.NomineeType.Customer.GetHashCode().ToString());
                        ObjNominee.NamePrefix = !string.IsNullOrEmpty(ddlCustNomineePrefix.SelectedValue) ? ddlCustNomineePrefix.SelectedValue.ToString() : string.Empty;
                        ObjNominee.FirstName = !string.IsNullOrEmpty(txtCustnomineeFirstname.Text) ? txtCustnomineeFirstname.Text.ToString() : string.Empty;
                        ObjNominee.MiddleName = !string.IsNullOrEmpty(txtCustnomineeMiddlename.Text) ? txtCustnomineeMiddlename.Text.ToString() : string.Empty;
                        ObjNominee.LastName = !string.IsNullOrEmpty(txtCustnomineeLastname.Text) ? txtCustnomineeLastname.Text.ToString() : string.Empty;
                        ObjNominee.Address = !string.IsNullOrEmpty(txtCustNomineeAddress.Text) ? txtCustNomineeAddress.Text.ToString() : string.Empty;
                        ObjNominee.RelationWith = !string.IsNullOrEmpty(txtCustRelationWithNominee.Text) ? txtCustRelationWithNominee.Text.ToString() : string.Empty;
                        ObjNominee.VillageId = !string.IsNullOrEmpty(ddlCustNomineeVillage.Text) ? ddlCustNomineeVillage.Text.ToString() : string.Empty;
                        ObjNominee.TahsilId = !string.IsNullOrEmpty(ddlCustNomineeTaluka.SelectedValue) ? Convert.ToInt32(ddlCustNomineeTaluka.SelectedValue.ToString()) : 0;
                        ObjNominee.DistrictId = !string.IsNullOrEmpty(ddlCustNomineeDistrict.SelectedValue) ? Convert.ToInt32(ddlCustNomineeDistrict.SelectedValue.ToString()) : 0;
                        ObjNominee.PinCode = !string.IsNullOrEmpty(txtCustNomineePinCode.Text) ? txtCustNomineePinCode.Text.ToString() : string.Empty;
                        ObjNominee.PhoneNumber = !string.IsNullOrEmpty(txtCustNomineePhonenumber.Text) ? txtCustNomineePhonenumber.Text.ToString() : string.Empty;
                        ObjNominee.Occupation = !string.IsNullOrEmpty(txtCustNomineeOccupation.Text) ? txtCustNomineeOccupation.Text.ToString() : string.Empty;
                        ObjNominee.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                        ObjNominee.CreatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                        ObjNominee.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                        ObjNominee.UpdatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                        ObjNominee.IsActive = true;
                        ObjNominee.Insert();

                        if (!ddlCustomerType.SelectedValue.ToString().Equals(clsEnum.CustomerType.NaamMatra.GetHashCode().ToString()))
                        {
                            //Account Details
                            ObjAccounts.AccountId = !string.IsNullOrEmpty(hdnAccountId.Value) ? Convert.ToInt32(hdnAccountId.Value.ToString()) : 0;
                            ObjAccounts.AccountNumber = !string.IsNullOrEmpty(txtCustomerAccNumber.Text) ? txtCustomerAccNumber.Text.ToString() : string.Empty;
                            ObjAccounts.CustomerId = ObjCustomer.CustomerId > 0 ? ObjCustomer.CustomerId : 0;
                            ObjAccounts.OpeningDate = !string.IsNullOrEmpty(txtCustomerAccOpenDate.Text) ? txtCustomerAccOpenDate.Text.ToString() : string.Empty;
                            //ObjAccounts.AccountTypeId = !string.IsNullOrEmpty(ddlCustomerAccType.SelectedValue) ? Convert.ToInt32(ddlCustomerAccType.SelectedValue.ToString()) : 0;
                            ObjAccounts.AccountTypeId = Convert.ToInt32(clsEnum.AccountTypes.SavingAccount.GetHashCode().ToString());
                            ObjAccounts.OpeningBalance = !string.IsNullOrEmpty(txtCustomerOpeningBalance.Text) ? Convert.ToDecimal(txtCustomerOpeningBalance.Text.ToString()) : 0;
                            ObjAccounts.ShareBalance = !string.IsNullOrEmpty(txtCustomerShareAmt.Text) ? Convert.ToDecimal(txtCustomerShareAmt.Text.ToString()) : 0;
                            //ObjAccounts.KayamNidhiBalance = !string.IsNullOrEmpty(txtCustomerKayamnidhiBal.Text) ? Convert.ToDecimal(txtCustomerKayamnidhiBal.Text.ToString()) : 0;
                            //ObjAccounts.AccountBalance = !string.IsNullOrEmpty(txtCustomerAccountBal.Text) ? Convert.ToDecimal(txtCustomerAccountBal.Text.ToString()) : 0;
                            ObjAccounts.KayamNidhiBalance = 0;
                            ObjAccounts.AccountBalance = !string.IsNullOrEmpty(txtCustomerOpeningBalance.Text) ? Convert.ToDecimal(txtCustomerOpeningBalance.Text.ToString()) : 0;
                            ObjAccounts.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            ObjAccounts.CreatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                            ObjAccounts.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            ObjAccounts.UpdatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                            ObjAccounts.IsActive = true;
                            ObjAccounts.Insert();
                        }
                        else
                        {
                            //Account Details
                            ObjAccounts.AccountId = !string.IsNullOrEmpty(hdnAccountId.Value) ? Convert.ToInt32(hdnAccountId.Value.ToString()) : 0;
                            ObjAccounts.AccountNumber = string.Empty;
                            ObjAccounts.CustomerId = ObjCustomer.CustomerId > 0 ? ObjCustomer.CustomerId : 0;
                            ObjAccounts.OpeningDate = txtCustomerAccOpenDate.Text;
                            ObjAccounts.AccountTypeId = Convert.ToInt32(clsEnum.AccountTypes.SavingAccount.GetHashCode().ToString());
                            ObjAccounts.OpeningBalance = 0;
                            ObjAccounts.ShareBalance = 0;
                            ObjAccounts.KayamNidhiBalance = 0;
                            ObjAccounts.AccountBalance = 0;
                            ObjAccounts.CreatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            ObjAccounts.CreatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                            ObjAccounts.UpdatedBy = Convert.ToInt32(AppSessions.GetSession(AppSessions.UDFSessionName._user_id.ToString()));
                            ObjAccounts.UpdatedDate = Convert.ToDateTime(txtCustomerAccOpenDate.Text);
                            ObjAccounts.IsActive = true;
                            ObjAccounts.Insert();
                        }

                        lblMessage.CssClass = "SuccessfulMessage";
                        lblMessage.Text = (String)GetGlobalResourceObject("SharedResource", "RecordSavedSuccessfully");
                    }
                }
                else
                {
                    lblMessage.CssClass = "FailureMessage";
                    lblMessage.Text = (String)GetGlobalResourceObject("SharedResource", "LoginSessionExpire");
                }
                BindCustomerGrid();
            }
            catch
            {
                lblMessage.CssClass = "FailureMessage";
                lblMessage.Text = (String)GetGlobalResourceObject("SharedResource", "RecordSavingFailure");
            }
            finally
            {
                ObjCustomer = null;
                ObjNominee = null;
                ObjAccounts = null;
            }
        }