コード例 #1
0
ファイル: FastRepaymentForm.cs プロジェクト: aelhadi/opencbs
 public FastRepaymentForm(Village pVillage)
 {
     InitializeComponent();
     _village = pVillage;
     LoadContracts();
     
 }
コード例 #2
0
 public NonSolidaryGroupForm()
 {
     InitializeComponent();
     _village = new Village {CreationDate = TimeProvider.Now};
     InitializeControls();
     InitializeCustomizableFields(null);
     InitializeTitle();
 }
コード例 #3
0
 public NonSolidaryGroupForm()
 {
     MefContainer.Current.Bind(this);
     InitializeComponent();
     _village = new Village { CreationDate = TimeProvider.Now };
     InitializeControls();
     InitializeTitle();
 }
コード例 #4
0
 public VillageDisburseLoanForm(Village village)
 {
     _village = village;
     _accumulatedAmount = 0;
     _notEnoughMoney = false;
     _fLServices = new FundingLineServices(User.CurrentUser);
     InitializeComponent();
     InitializeControls();
 }
コード例 #5
0
 public VillageAddLoanForm(Village village, LoanProduct product, NonSolidaryGroupForm nsgForm)
 {
     _village = village;
     _product = product;
     _nsgForm = nsgForm;
     _product.EntryFees = ServicesProvider.GetInstance().GetProductServices().GetProductEntryFees(_product, village);
     _fLServices = new FundingLineServices(User.CurrentUser);
     _accumulatedAmount = 0;
     InitializeComponent();
     InitializeControls();
 }
コード例 #6
0
        public NonSolidaryGroupForm(IExtensionActivator extensionActivator)
        {
            _extensionActivator = extensionActivator;
            if (_extensionActivator != null) _extensionActivator.Execute(this);

            InitializeComponent();
            _village = new Village {CreationDate = TimeProvider.Now};
            InitializeControls();
            InitializeCustomizableFields(null);
            InitializeTitle();
        }
コード例 #7
0
 public NonSolidaryGroupForm(IApplicationController applicationController)
 {
     _applicationController = applicationController;
     MefContainer.Current.Bind(this);
     InitializeComponent();
     _village = new Village {CreationDate = TimeProvider.Now, CreatedBy = User.CurrentUser};
     InitializeControls();
     InitializeTitle();
     this.dtDate.Format = DateTimePickerFormat.Custom;
     this.dtDate.CustomFormat = ApplicationSettings.GetInstance("").SHORT_DATE_FORMAT;
 }
コード例 #8
0
ファイル: ShowPictureForm.cs プロジェクト: aelhadi/opencbs
 public ShowPictureForm(Village village, NonSolidaryGroupForm villageForm, int photoSubId)
 {
     InitializeComponent();
     CaptionText = MultiLanguageStrings.GetString(Ressource.ClientForm, "NonSolidaryGroup") + ": " + village.Name;
     this.villageForm = villageForm;
     this.village = village;
     this.photoSubId = photoSubId;
     addPhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionAdd.Text");
     changePhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionChange.Text");
     ShowPicture();
     InitializeButtons();
 }
コード例 #9
0
        public NonSolidaryGroupForm(Village village)
        {
            _village = village;

            foreach (VillageMember member in _village.Members)
            {
                member.IsSaved = true;
                member.ActiveLoans = ServicesProvider.GetInstance().GetContractServices().FindActiveContracts(member.Tiers.Id);
            }

            InitializeComponent();
            InitializeControls();
            LoadMeetingDates();
            InitializeCustomizableFields(_village.Id);
            InitializeTitle();
        }
コード例 #10
0
        public NonSolidaryGroupForm(Village village, IApplicationController applicationController)
        {
            _applicationController = applicationController;
            MefContainer.Current.Bind(this);

            _village = village;

            foreach (VillageMember member in _village.Members)
            {
                member.IsSaved = true;
                member.ActiveLoans = ServicesProvider.GetInstance().GetContractServices().FindActiveContracts(member.Tiers.Id);
            }

            InitializeComponent();
            InitializeControls();
            LoadMeetingDates();
            InitializeTitle();
        }
コード例 #11
0
        public NonSolidaryGroupForm(Village village, IExtensionActivator extensionActivator)
        {
            _extensionActivator = extensionActivator;
            if (_extensionActivator != null) _extensionActivator.Execute(this);

            _village = village;

            foreach (VillageMember member in _village.Members)
            {
                member.IsSaved = true;
                member.ActiveLoans = ServicesProvider.GetInstance().GetContractServices().FindActiveContracts(member.Tiers.Id);
            }

            InitializeComponent();
            InitializeControls();
            LoadMeetingDates();
            InitializeCustomizableFields(_village.Id);
            InitializeTitle();
        }
コード例 #12
0
 public int SaveNonSolidarityGroup(Village village)
 {
     return SaveNonSolidarityGroup(village, null);
 }
コード例 #13
0
 public VillageAddSavingsForm(Village village, ISavingProduct product, NonSolidaryGroupForm nsgForm)
 {
     _village = village;
     _product = product;
     _nsgForm = nsgForm;
     InitializeComponent();
     InitializeControls();
 }
コード例 #14
0
        private int AddVillage(Village village, Action<SqlTransaction, int> action)
        {
            using (SqlConnection connection = _clientManagement.GetConnection())
            using (SqlTransaction sqlTransac = connection.BeginTransaction())
            {
                try
                {
                    int retval = _clientManagement.AddVillage(village, sqlTransac);
                    if (action != null) action(sqlTransac, retval);

                    sqlTransac.Commit();
                    return retval;
                }
                catch (Exception)
                {
                    sqlTransac.Rollback();
                    throw;
                }
            }
        }
コード例 #15
0
 public void InitializeVillageForm(Village village)
 {
     NonSolidaryGroupForm frm = new NonSolidaryGroupForm(village) { MdiParent = this };
     frm.Show();
 }
コード例 #16
0
        public void TestCreatingContractForNonSolidaryGroupWithLoanCycles()
        {
            LoanProductManager productManager = new LoanProductManager(DataUtil.TESTDB);
            ProductServices productServices = new ProductServices(productManager);

            ClientManager clientManager = new ClientManager(DataUtil.TESTDB);
            ClientServices clientServices = new ClientServices(clientManager);

            Village village = new Village();
            Person person = clientServices.FindPersonById(2);
            person.LoanCycle = 0;

            VillageMember villageMember = new VillageMember();
            villageMember.Tiers = person;
            village.Members.Add(villageMember);

            person = clientServices.FindPersonById(4);
            person.LoanCycle = 1;

            villageMember = new VillageMember();
            villageMember.Tiers = person;
            village.Members.Add(villageMember);

            person = clientServices.FindPersonById(6);
            person.LoanCycle = 2;
            villageMember = new VillageMember();
            villageMember.Tiers = person;
            village.Members.Add(villageMember);

            var loanAmountCycle = GetLoanAmountCycles();
            var maturityCycles = GetMaturityCycles();
            var rateCycles = GetRateCycles();
            var entryFees = new List<EntryFee>();

            Currency currency = new Currency();
            currency.Id = 1;
            var nrp = new NonRepaymentPenaltiesNullableValues(100, 200, 10, 0.2);
            LoanProduct product = CreatePackage(
                                                "NewPackage68", //package name
                                                null, //anticipatedTotalRepaymentPenalties
                                                3, //anticipatedTotalRepaymentPenaltiesMin
                                                6, //anticipatedTotalRepaymentPenaltiesMax
                                                4, //grace period
                                                null, //gracePeriodMin
                                                null, //gracePeriodMax
                                                0.2m, //interestRate
                                                null, //interesrRateMin
                                                null, //interestRateMax
                                                10, //NmbOfInstallments
                                                null, //NmbOfInstallmentsMin
                                                null, //NmbOfInstallmentsMax
                                                entryFees, //List<EntryFee>
                                                nrp, //NonRepaymentPenalties
                                                null, //NonRepaymentPenaltiesMin
                                                null, //NonRepaymentPenaltiesMax
                                                _monthly, //InstallmentType
                                                2000, //amount
                                                null, //amountMin
                                                null, //AmountMax
                                                null, //ExoticInstallmentsTable
                                                2, //cycleId
                                                loanAmountCycle, //List<LoanAmountCycle>
                                                rateCycles, //List<RateCycle>
                                                maturityCycles, //List<MaturityCycle>
                                                "CODE1", //ProductCode
                                                null, //List<ProductClientType>
                                                null, //amountUnderLoc
                                                null, //amountUnderLocMin
                                                null, //amountUnderLocMax
                                                1, //anticipatedPartialRRepaymentPenalties
                                                null, //anticipatedPartialRRepaymentPenaltiesMin
                                                null, //anticipatedPartialRRepaymentPenaltiesMax
                                                null, //compulsoryAmount
                                                null, //compulsoryAmountMin
                                                null, //compulsoryAmountMax
                                                currency
                );
            product.ClientType = '-';
            product.ProductClientTypes = new List<ProductClientType>();
            product.AddedEntryFees = entryFees;
            product.Id=productServices.AddPackage(product);
            productServices.SaveAllCycleParams(loanAmountCycle, rateCycles, maturityCycles);

            foreach (VillageMember member in village.Members)
            {
                productServices.SetVillageMemberCycleParams(member, product.Id, ((Person)member.Tiers).LoanCycle);
            }

            for (int i = 0; i < village.Members.Count; i++)
            {
                int j = i;
                //to avoid index out of range exception (it occurs in product.LoanAmountCycleParams)
                if (i == product.LoanAmountCycleParams.Count) j = product.LoanAmountCycleParams.Count - 1;
                Assert.AreEqual(village.Members[i].Product.AmountMin, product.LoanAmountCycleParams[j].Min);
                Assert.AreEqual(village.Members[i].Product.AmountMax, product.LoanAmountCycleParams[j].Max);
                Assert.AreEqual(village.Members[i].Product.InterestRateMin, product.RateCycleParams[j].Min.Value);
                Assert.AreEqual(village.Members[i].Product.InterestRateMax, product.RateCycleParams[j].Max.Value);
                Assert.AreEqual(village.Members[i].Product.NbOfInstallmentsMin, (int) product.MaturityCycleParams[j].Min.Value);
                Assert.AreEqual(village.Members[i].Product.NbOfInstallmentsMax, (int) product.MaturityCycleParams[j].Max.Value);
            }

            foreach (VillageMember member in village.Members)
            {
                Loan loan = new Loan();
                loan.LoanPurpose = "Unit tests";
                loan.Product = member.Product;

                loan.Amount = member.Product.AmountMin;
                loan.AmountMin = member.Product.AmountMin;
                loan.AmountMax = member.Product.AmountMax;
                loan.InterestRate = member.Product.InterestRateMin.Value;
                loan.InterestRateMin = member.Product.InterestRateMin.Value;
                loan.InterestRateMax = member.Product.InterestRateMax.Value;
                loan.NbOfInstallments = member.Product.NbOfInstallmentsMin.Value;
                loan.NmbOfInstallmentsMin = member.Product.NbOfInstallmentsMin.Value;
                loan.NmbOfInstallmentsMax = member.Product.NbOfInstallmentsMax;
                loan.StartDate = TimeProvider.Now;
                loan.FirstInstallmentDate = loan.FirstInstallmentDate = DateTime.Now + new TimeSpan(30, 0, 0, 0);
                loan.CloseDate = TimeProvider.Now + new TimeSpan(365, 0, 0, 0);
                loan.EconomicActivityId = 1;

                loan.NonRepaymentPenalties = new NonRepaymentPenalties
                {
                    InitialAmount = member.Product.NonRepaymentPenalties.InitialAmount ?? 0,
                    OLB = member.Product.NonRepaymentPenalties.OLB ?? 0,
                    OverDuePrincipal = member.Product.NonRepaymentPenalties.OverDuePrincipal ?? 0,
                    OverDueInterest = member.Product.NonRepaymentPenalties.OverDueInterest ?? 0
                };
                loan.LoanEntryFeesList = new List<LoanEntryFee>();
                loan.InstallmentType = member.Product.InstallmentType;
                loan.AnticipatedTotalRepaymentPenalties = 0;
                loan.FundingLine = new FundingLine("New_Founding_line", false);
                loan.FundingLine.Currency = loan.Product.Currency;
                loan.FundingLine.Id = 1;
                loan.LoanOfficer = User.CurrentUser;
                loan.LoanOfficer.LastName = "Unit";
                loan.LoanOfficer.FirstName = "Test";
                loan.Synchronize = false;
                loan.ContractStatus = OContractStatus.Validated;
                loan.CreditCommitteeCode = "OK";
                loan.GracePeriod = 0;
                loan.GracePeriodOfLateFees = member.Product.GracePeriodOfLateFees;
                loan.AnticipatedPartialRepaymentPenalties = 2;
                loan.AnticipatedTotalRepaymentPenalties = 3;
                loan.LoanCycle = ((Person)member.Tiers).LoanCycle;
                loan.InstallmentList = new List<Installment>();
                loan.InstallmentList.Add(new Installment());
                loan.InstallmentList[0].ExpectedDate = TimeProvider.Now + new TimeSpan(60, 0, 0, 0);
                loan.InstallmentList[0].InterestsRepayment = 10;
                loan.InstallmentList[0].Number = 1;
                loan.InstallmentList[0].CapitalRepayment = 10;
                loan.InstallmentList[0].PaidInterests = 10;
                loan.InstallmentList[0].PaidCapital = 10;
                loan.InstallmentList[0].PaidDate = TimeProvider.Now;
                loan.InstallmentList[0].FeesUnpaid = 10;
                loan.InstallmentList[0].PaidFees = 10;
                loan.InstallmentList[0].Comment = "Unit test";
                loan.InstallmentList[0].IsPending = false;
                loan.InstallmentList[0].StartDate = TimeProvider.Now;
                loan.InstallmentList[0].OLB = 20;

                loan.InstallmentList.Add(new Installment());
                loan.InstallmentList[1].ExpectedDate = TimeProvider.Now + new TimeSpan(120, 0, 0, 0);
                loan.InstallmentList[1].InterestsRepayment = 10;
                loan.InstallmentList[1].Number = 2;
                loan.InstallmentList[1].CapitalRepayment = 10;
                loan.InstallmentList[1].PaidInterests = 10;
                loan.InstallmentList[1].PaidCapital = 10;
                loan.InstallmentList[1].PaidDate = TimeProvider.Now + new TimeSpan(120, 0, 0, 0);
                loan.InstallmentList[1].FeesUnpaid = 10;
                loan.InstallmentList[1].PaidFees = 10;
                loan.InstallmentList[1].Comment = "Unit test2";
                loan.InstallmentList[1].IsPending = false;
                loan.InstallmentList[1].StartDate = TimeProvider.Now.AddDays(60);
                loan.InstallmentList[1].OLB = 10;
                loan.Events = new EventStock();
                loan.AlignDisbursementDate = TimeProvider.Now;
                loan.CreditCommiteeDate = TimeProvider.Now;
                loan.Guarantors = new List<Guarantor>();
                loan.Collaterals = new List<ContractCollateral>();

                Project project;
                IClient client = member.Tiers;
                if (0 == client.Projects.Count)
                {
                    project = new Project("Village");
                    project.Name = "Village";
                    project.Code = "Village";
                    project.Aim = "Village";
                    project.BeginDate = TimeProvider.Now;
                    project.Id = ServicesProvider.GetInstance().GetProjectServices().SaveProject(project, client);
                    member.Tiers.AddProject(project);
                }
                project = client.Projects[0];
                client.District = new District(1, "Unit Test");
                client.Name = "Unit Test";

                ApplicationSettings appSettings = ApplicationSettings.GetInstance(User.CurrentUser.Md5);
                appSettings.UpdateParameter("ALLOWS_MULTIPLE_LOANS", 1);
                appSettings.UpdateParameter("CONTRACT_CODE_TEMPLATE", "Contract");

                ServicesProvider.GetInstance().GetContractServices().SaveLoan(ref loan, project.Id, ref client);
            }

            foreach (VillageMember member in village.Members)
            {
                member.ActiveLoans = ServicesProvider.GetInstance().GetContractServices().FindActiveContracts(member.Tiers.Id);
            }

            for (int i = 0; i < village.Members.Count; i++)
            {
                int j = i;
                //to avoid index out of range exception (it occurs in product.LoanAmountCycleParams)
                if (i == product.LoanAmountCycleParams.Count) j = product.LoanAmountCycleParams.Count - 1;
                for (int k = 0; k < village.Members[i].ActiveLoans.Count; k++)
                {
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].AmountMin, loanAmountCycle[j].Min);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].AmountMax, loanAmountCycle[j].Max);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].Amount, loanAmountCycle[j].Min);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].InterestRateMin, (double?) rateCycles[j].Min.Value);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].InterestRateMax, (double?) rateCycles[j].Max.Value);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].InterestRate, (double?) rateCycles[j].Min.Value);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].NmbOfInstallmentsMin,
                                    (int) maturityCycles[j].Min.Value);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].NmbOfInstallmentsMax,
                                    (int) maturityCycles[j].Max.Value);
                    Assert.AreEqual(village.Members[i].ActiveLoans[k].NbOfInstallments, (int) maturityCycles[j].Min.Value);
                }
            }
        }
コード例 #17
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
        private void AddMemberToVillage(VillageMember pMember, Village pVillage, bool leader, SqlTransaction pSqlTransac)
        {
            const string q = @"INSERT INTO VillagesPersons
                                (
                                    village_id,
                                    person_id,
                                    joined_date,
                                    left_date,
                                    is_leader,
                                    currently_in
                                )
                            VALUES
                                (
                                    @village_id,
                                    @person_id,
                                    @joined_date,
                                    @left_date,
                                    @isLeader,
                                    @currentlyIn
                                )";

            using (OpenCbsCommand c = new OpenCbsCommand(q, pSqlTransac.Connection, pSqlTransac))
            {
                c.AddParam("@village_id", pVillage.Id);
                c.AddParam("@person_id", pMember.Tiers.Id);
                c.AddParam("@joined_date", TimeProvider.Now);
                c.AddParam("@left_date", null);
                c.AddParam("@isLeader", leader);
                c.AddParam("@currentlyIn", true);
                c.ExecuteNonQuery();
            }
        }
コード例 #18
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
        public void UpdateVillage(Village pVillage, SqlTransaction pSqlTransac)
        {
            UpdateTiers(pVillage, pSqlTransac);

            const string q = @"UPDATE [Villages]
                                     SET [name]=@name,
                                         [establishment_date] = @establishmentDate,
                                         [loan_officer] = @loan_officer,
                                         [meeting_day] = @meeting_day
                                     WHERE id = @id";

            using (OpenCbsCommand c = new OpenCbsCommand(q, pSqlTransac.Connection, pSqlTransac))
            {
                SetNonSolidaryGroup(pVillage, c);
                c.ExecuteNonQuery();
            }

            List<VillageMember> members = SelectVillageMembersByVillageId(pVillage.Id, pSqlTransac, null);

            foreach (VillageMember member in members)
            {
                DeleteVillageMember(pVillage.Id, member.Tiers.Id, pSqlTransac);
            }

            foreach (VillageMember member in pVillage.Members)
            {
                bool isNew = true;
                foreach (VillageMember member2 in members)
                {
                    if (member.Tiers.Id == member2.Tiers.Id)
                    {
                        isNew = false;
                        break;
                    }
                }

                if (isNew)
                    AddMemberToVillage(member, pVillage, (member.Tiers.Id == pVillage.Leader.Tiers.Id), pSqlTransac);
                else
                    UpdateMemberInVillage(member, pVillage, (member.Tiers.Id == pVillage.Leader.Tiers.Id), pSqlTransac);
            }
        }
コード例 #19
0
        public int SaveNonSolidarityGroup(Village village, Action<SqlTransaction, int> action)
        {
            ValidateVillage(village);

            if (0 == village.Id)
            {
                village.Id = AddVillage(village, action);
                UpdateVillage(village, action);
                SavePicture(village);
            }
            else
            {
                UpdateVillage(village, action);
                SavePicture(village);
            }

            return village.Id;
        }
コード例 #20
0
 public void Save(Village nonSolidarityGroup, SqlTransaction tx)
 {
 }
コード例 #21
0
 public TabPage[] GetTabPages(Village nonSolidarityGroup)
 {
     var tabPage = new TabPage("TEST NON SOLIDARITY GROUP");
     return new[] { tabPage };
 }
コード例 #22
0
ファイル: MainView.cs プロジェクト: fdrgnmx/opencbs
 public void InitializeVillageForm(Village village)
 {
     NonSolidaryGroupForm frm = new NonSolidaryGroupForm(village, _applicationController) { MdiParent = this };
     frm.Show();
 }
コード例 #23
0
ファイル: FastDepositForm.cs プロジェクト: aelhadi/opencbs
 public FastDepositForm(Village pVillage)
 {
     InitializeComponent();
     _village = pVillage;
     LoadSavings();
 }
コード例 #24
0
 public VillageCreditCommitteeForm(Village village)
 {
     _village = village;
     InitializeComponent();
     InitializeControls();
 }
コード例 #25
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
 private void SetNonSolidaryGroup(Village pVillage, OpenCbsCommand c)
 {
     c.AddParam("@id", pVillage.Id);
     c.AddParam("@name", pVillage.Name);
     c.AddParam("@establishmentDate", pVillage.EstablishmentDate);
     c.AddParam("@loan_officer", pVillage.LoanOfficer.Id);
     if (pVillage.MeetingDay.HasValue)
         c.AddParam("@meeting_day", (int)pVillage.MeetingDay);
     else
         c.AddParam("@meeting_day", null);
 }
コード例 #26
0
ファイル: LoanServices.cs プロジェクト: jay3126/opencbs
 public void UpdateVillageStatus(Village pVillage)
 {
     using (SqlConnection conn = _clientManager.GetConnection())
     using (SqlTransaction sqlTransaction = conn.BeginTransaction())
     {
         try
         {
             _clientManager.UpdateTiers(pVillage, sqlTransaction);
             if (sqlTransaction != null) sqlTransaction.Commit();
         }
         catch (Exception)
         {
             if (sqlTransaction != null) sqlTransaction.Rollback();
             throw;
         }
     }
 }
コード例 #27
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
        private void UpdateMemberInVillage(VillageMember pMember, Village pVillage, bool leader, SqlTransaction pSqlTransac)
        {
            const string q = @"UPDATE VillagesPersons SET left_date = NULL,
                                is_leader = @isLeader,
                                currently_in = @currentlyIn
                                WHERE village_id = @village_id
                                AND person_id = @person_id";

            using (OpenCbsCommand c = new OpenCbsCommand(q, pSqlTransac.Connection, pSqlTransac))
            {
                c.AddParam("@village_id", pVillage.Id);
                c.AddParam("@person_id", pMember.Tiers.Id);
                c.AddParam("@isLeader", leader);
                c.AddParam("@currentlyIn", true);
                c.ExecuteNonQuery();
            }
        }
コード例 #28
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
        public int AddVillage(Village pVillage, SqlTransaction pSqlTransac)
        {
            int id = AddTiers(pVillage, pSqlTransac);

            const string q = @"INSERT INTO [Villages]
                                    (
                                        [id],
                                        [name],
                                        [establishment_date],
                                        [loan_officer],
                                        [meeting_day]
                                    )
                                     VALUES
                                    (
                                         @id,
                                         @name,
                                         @establishmentDate,
                                         @loan_officer,
                                         @meeting_day
                                    )";

            using (OpenCbsCommand c = new OpenCbsCommand(q, pSqlTransac.Connection, pSqlTransac))
            {
                c.AddParam("@id", id);
                c.AddParam("@name", pVillage.Name);
                c.AddParam("@establishmentDate", pVillage.EstablishmentDate);
                c.AddParam("@loan_officer", pVillage.LoanOfficer.Id);
                if (pVillage.MeetingDay.HasValue)
                    c.AddParam("@meeting_day", (int)pVillage.MeetingDay);
                else
                    c.AddParam("@meeting_day", null);

                c.ExecuteNonQuery();
            }
            return id;
        }
コード例 #29
0
 /// <summary>
 /// The method sets favourite loan officer to a village (non solidary corporate)
 /// </summary>
 /// <param name="village">an instance of type Village</param>
 public void SetFavouriteLoanOfficerForVillage(Village village)
 {
     using (SqlConnection connection = _clientManagement.GetConnection())
     using (SqlTransaction transaction = connection.BeginTransaction())
         try
         {
             foreach (VillageMember member in village.Members)
                 _clientManagement.SetFavourLoanOfficerForPerson(member.Tiers.Id, village.LoanOfficer.Id, transaction);
             transaction.Commit();
         }
         catch
         {
             transaction.Rollback();
             throw;
         }
 }
コード例 #30
0
ファイル: Village.cs プロジェクト: ChrystlyWiafe/opencb
        public IClient Copy()
        {
            Village clonedVillage = (Village)MemberwiseClone();

            return(clonedVillage);
        }
コード例 #31
0
ファイル: ClientManager.cs プロジェクト: aelhadi/opencbs
        private Village GetVillageFromReader(OpenCbsReader r)
        {
            Village village;
            village = new Village
                          {
                              Id = r.GetInt("tiers_id"),

                              ZipCode = r.GetString("zipCode"),
                              Status =
                                  ((OClientStatus)r.GetSmallInt("status")),
                              Type = r.GetChar("client_type_code") == 'I'
                                         ? OClientTypes.Person
                                         : r.GetChar("client_type_code") == 'G'
                                               ? OClientTypes.Group
                                               : OClientTypes.Corporate,
                              Scoring = r.GetNullDouble("scoring"),
                              LoanCycle = r.GetInt("loan_cycle"),
                              Active = r.GetBool("active"),
                              BadClient = r.GetBool("bad_client")
                          };
            village.MeetingDay = (DayOfWeek?)r.GetNullInt("meeting_day");
            village.City = r.GetString("city");
            village.Address = r.GetString("address");
            village.Name = r.GetString("name");
            village.EstablishmentDate = r.GetNullDateTime("establishment_date");
            village.Branch = new Branch { Id = r.GetInt("branch_id") };
            return village;
        }