示例#1
0
        public static bool Delete(String UniqueId)
        {
            using (DB context = new DB())
            {
                BusinessRecord obj = context.BusinessRecords.Include(x => x.Barangay)
                                     .Include(x => x.BusinessDetail.BusinessLine.BusinessNature)
                                     .Include(x => x.BusinessType)
                                     .Include(x => x.City)
                                     .Include(x => x.District)
                                     .Include(x => x.BusinessOwner)
                                     .Include(x => x.Province)
                                     .Include(x => x.Requirements)
                                     .Include(x => x.Street).Where(o => o.UniqueId == new Guid(UniqueId)).SingleOrDefault();
                //get offical receipt
                context.BusinessRecords.Remove(obj);
                try
                {
                    context.SaveChanges();
                }
                catch
                {
                    return(false);
                }

                return(true);
            }
        }
示例#2
0
        public ActionResult Business(CollectionViewModel model)
        {
            DB              db     = new DB();
            BusinessRecord  record = db.BusinessRecords.Find(model.Id);
            OfficialReceipt or     = new OfficialReceipt();

            or.BusinessRecord = record;
            or.ORDate         = model.orDate;
            or.ORNumber       = model.orNumber;
            or.changeAmount   = model.changeAmount;
            or.totalAmount    = model.payableAmount;
            or.tenderedAmount = model.tenderedAmount;
            List <Fee> fees = new List <Fee>();

            if (model.isNew)
            {
                fees = db.Fees.Include(x => x.Status).Where(x => x.StatusId != 2).ToList();
            }
            else
            {
                fees = db.Fees.Include(x => x.Status).Where(x => x.StatusId != 1).ToList();
            }
            or.FeesPaid = fees;
            db.OfficialReceipts.Add(or);
            DateTime paidDate = DateTime.Now;

            record.BusinessDetail.lastPayDate = paidDate;
            record.isCollected = model.quarter;
            if (record.isCollected >= 4)
            {
                record.BusinessDetail.isNew = false;
            }
            db.SaveChanges();
            return(Redirect("/Issuance/Business/" + record.UniqueId));
        }
示例#3
0
        internal RiskData(BusinessRecord parent)
        {
            this._necessary                = BusinessItemFactory.Create("Necessary", 0m, PermissionFeature.Sound, parent);
            this._netNecessary             = BusinessItemFactory.Create("NetNecessary", 0m, PermissionFeature.Dumb, parent);
            this._hedgeNecessary           = BusinessItemFactory.Create("HedgeNecessary", 0m, PermissionFeature.Dumb, parent);
            this._minEquityAvoidRiskLevel1 = BusinessItemFactory.Create("MinEquityAvoidRiskLevel1", 0m, PermissionFeature.Dumb, parent);
            this._minEquityAvoidRiskLevel2 = BusinessItemFactory.Create("MinEquityAvoidRiskLevel2", 0m, PermissionFeature.Dumb, parent);
            this._minEquityAvoidRiskLevel3 = BusinessItemFactory.Create("MinEquityAvoidRiskLevel3", 0m, PermissionFeature.Dumb, parent);

            this._necessaryFillingOpenOrder  = BusinessItemFactory.Create("NecessaryFillingOpenOrder", 0m, PermissionFeature.Dumb, parent);
            this._necessaryFillingCloseOrder = BusinessItemFactory.Create("NecessaryFillingCloseOrder", 0m, PermissionFeature.Dumb, parent);

            this._tradePLFloat    = BusinessItemFactory.Create("TradePLFloat", 0m, PermissionFeature.Dumb, parent);
            this._interestPLFloat = BusinessItemFactory.Create("InterestPLFloat", 0m, PermissionFeature.Dumb, parent);
            this._storagePLFloat  = BusinessItemFactory.Create("StoragePLFloat", 0m, PermissionFeature.Dumb, parent);
            this._valueAsMargin   = BusinessItemFactory.Create("ValueAsMargin", 0m, PermissionFeature.Dumb, parent);

            this._tradePLNotValued    = BusinessItemFactory.Create("TradePLNotValued", 0m, PermissionFeature.Dumb, parent);
            this._interestPLNotValued = BusinessItemFactory.Create("InterestPLNotValued", 0m, PermissionFeature.Dumb, parent);
            this._storagePLNotValued  = BusinessItemFactory.Create("StoragePLNotValued", 0m, PermissionFeature.Dumb, parent);

            this._lockOrderTradePLFloat      = BusinessItemFactory.Create("LockOrderTradePLFloat", 0m, PermissionFeature.Dumb, parent);
            this._feeForCutting              = BusinessItemFactory.Create("FeeForCutting", 0m, PermissionFeature.Dumb, parent);
            this._riskCredit                 = BusinessItemFactory.Create("RiskCredit", 0m, PermissionFeature.Dumb, parent);
            _partialPaymentPhysicalNecessary = BusinessItemFactory.Create("PartialPaymentPhysicalNecessary", 0m, PermissionFeature.Dumb, parent);
            _totalPaidAmount                 = BusinessItemFactory.Create("TotalPaidAmount", 0m, PermissionFeature.Dumb, parent);
            _credit      = BusinessItemFactory.Create("Credit", 0m, PermissionFeature.Dumb, parent);
            _shortMargin = BusinessItemFactory.Create("ShortMargin", 0m, PermissionFeature.Dumb, parent);
        }
示例#4
0
        public async Task CanGetInventionTitle(BusinessRecord searchTerm, Address expectedAddress)
        {
            var dataFromSut = await sut.SearchByBusinessRecord(searchTerm);

            var likeness = expectedAddress.AsSource().OfLikeness <Address>();

            Assert.True(dataFromSut.Any(x => likeness.Equals(x)));
        }
示例#5
0
 internal FundContent(BusinessRecord parent, decimal?balance, decimal?frozenFund, Account account)
 {
     _totalDeposit     = BusinessItemFactory.Create("TotalDeposit", 0m, PermissionFeature.Sound, parent);
     _balance          = BusinessItemFactory.Create(FundBusinessItemNames.Balance, balance, PermissionFeature.Sound, parent);
     _frozenFund       = BusinessItemFactory.Create(FundBusinessItemNames.FrozenFund, frozenFund, PermissionFeature.Sound, parent);
     this._riskRawData = new RiskData(parent);
     _account          = account;
 }
        public void EqualsObjectCastTest()
        {
            string         transactionRecordID = "test-transactionRecordID";
            BusinessRecord businessRecord      = new BusinessRecord(transactionRecordID: transactionRecordID);
            object         obj = new BusinessRecord(transactionRecordID: transactionRecordID);

            Assert.True(businessRecord.Equals(obj));
        }
示例#7
0
        public async Task CanGetInventionTitle(string searchTerm, BusinessRecord expectedRecord)
        {
            var dataFromSut = await sut.SearchByName(searchTerm);

            var likeness = expectedRecord.AsSource().OfLikeness <BusinessRecord>();

            Assert.True(dataFromSut.Any(x => likeness.Equals(x)));
        }
        public void EqualsTest()
        {
            string         transactionRecordID  = "test-transaction-record-id";
            BusinessRecord transactionRecordID1 = new BusinessRecord(transactionRecordID: transactionRecordID);

            Assert.Equal(transactionRecordID1, transactionRecordID1);
            Assert.Equal(transactionRecordID1, new BusinessRecord(transactionRecordID: transactionRecordID));
            Assert.False(transactionRecordID1.Equals(null));
        }
        public void RecordTest()
        {
            BusinessRecord record = new BusinessRecord(transactionRecordID: "test-transactionRecordID");

            businessSearchResponse.Record = record;

            Assert.Equal(record, businessSearchResponse.Record);
            Assert.Equal(record, (new BusinessSearchResponse(record: record)).Record);
        }
        public ActionResult Delete(BusinessRecord model)
        {
            bool result = BusinessRecordData.Delete(model.UniqueId.ToString());

            if (result)
            {
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
示例#11
0
        public void GetHashcodeTest()
        {
            BusinessRecord businessRecord1 = new BusinessRecord();

            businessRecord1.TransactionRecordID = "test-transactionRecordID";
            businessRecord1.RecordStatus        = "test-recordStatus";

            BusinessRecord businessRecord2 = new BusinessRecord();

            businessRecord2.TransactionRecordID = "test-transactionRecordID";
            businessRecord2.RecordStatus        = "test-recordStatus";

            Assert.Equal(businessRecord1.GetHashCode(), businessRecord2.GetHashCode());
        }
        // GET: Delete Business Record
        public ActionResult Delete(string id)
        {
            ViewBag.businessowners  = BusinessOwnerData.ListAll();
            ViewBag.businessdetails = BusinessDetailData.ListAll();
            ViewBag.provinces       = ProvincesData.ListAll();
            ViewBag.cities          = CitiesData.ListAll();
            ViewBag.districts       = DistrictData.ListAll();
            ViewBag.barangays       = BarangayData.ListAll();
            ViewBag.streets         = StreetData.ListAll();
            ViewBag.businesstype    = BusinessTypeData.ListAll();
            BusinessRecord model = BusinessRecordData.GetById(id);

            return(View(model));
        }
示例#13
0
        public ActionResult Business(string id)
        {
            DB             db     = new DB();
            var            model  = new CollectionViewModel();
            BusinessRecord record = BusinessRecordData.GetById(id);

            model.Id           = record.Id;
            model.BusinessName = record.BusinessName;
            model.OwnerName    = record.BusinessOwner.FirstName + " " + record.BusinessOwner.LastName;
            model.quarter      = record.isAssessed;
            model.isNew        = record.BusinessDetail.isNew;
            model.lastDatePaid = record.BusinessDetail.lastPayDate;
            //DateTime cutOffFirst = DateTime.ParseExact("2017-03-31", "yyyy-MM-dd",
            //                           System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffSecond = DateTime.ParseExact("2017-06-30", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffThird = DateTime.ParseExact("2017-09-30", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffFourth = DateTime.ParseExact("2017-12-31", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            if (/*model.lastDatePaid <= cutOffFirst */ record.isCollected <= 0) //disabled check because this is always true until March 31, 2017. lastpaiddate will always be before 03/31 because it is updated by DateTime.NOW
            {
                model.lastQuarterPaid = 0;
            }
            else if (/*(model.lastDatePaid > cutOffFirst && model.lastDatePaid <= cutOffSecond)*/ record.isCollected == 1)
            {
                model.lastQuarterPaid = 1;
            }
            else if (/*(model.lastDatePaid > cutOffSecond && model.lastDatePaid <= cutOffThird)*/ record.isCollected == 2)
            {
                model.lastQuarterPaid = 2;
            }
            else if (/*(model.lastDatePaid > cutOffThird && model.lastDatePaid <= cutOffFourth)*/ record.isCollected == 3)
            {
                model.lastQuarterPaid = 3;
            }
            else if (/*model.lastDatePaid > cutOffFourth &&*/ record.isCollected == 4)
            {
                model.lastQuarterPaid = 4;
            }

            int orNumber = db.OfficialReceipts.Select(i => i.ORNumber).ToList().LastOrDefault();

            model.orNumber = orNumber + 1;
            model.orDate   = DateTime.Now;
            //ViewBag.Banks = db.
            return(View(model));
        }
        /// <summary>
        /// 保存过磅信息
        /// </summary>
        /// <param name="carinoutid">车辆通行总记录ID</param>
        /// <param name="content">送货车辆EBELN(PO号)、成品车辆WTD_ID(委托单)、三废车辆VBELN(交货单号)</param>
        /// <param name="type">业务类型(进门地磅、出门地磅、装货第一次过磅、卸货第一次过磅、装货第二次过磅、卸货第二次过磅)</param>
        /// <param name="wie">过磅重量</param>
        private void save(string carinoutid, string content, string type, string wie)
        {
            BusinessRecord busin = new BusinessRecord();

            busin.BusinessRecord_CarInOutRecord_ID = Convert.ToInt32(carinoutid);
            busin.BusinessRecord_Content           = content;
            busin.BusinessRecord_State             = "启动";
            busin.BusinessRecord_Type         = type;
            busin.BusinessRecord_Weight       = Convert.ToDouble(wie);
            busin.BusinessRecord_WeightTime   = CommonalityEntity.GetServersTime();
            busin.BusinessRecord_WeightPerson = CommonalityEntity.USERNAME;
            if (LinQBaseDao.InsertOne <BusinessRecord>(new DCCarManagementDataContext(), busin))
            {
                CommonalityEntity.WriteLogData("新增", "记录IC卡(小票)号为:" + txtSerialnumber.Text.Trim() + "的" + type + "信息", CommonalityEntity.USERNAME);//添加操作日志
            }
        }
示例#15
0
 public static BusinessRecord GetById(string uniqueId)
 {
     using (DB context = new DB())
     {
         BusinessRecord obj = context.BusinessRecords.Include(x => x.Barangay)
                              .Include(x => x.BusinessDetail.BusinessLine.BusinessNature)
                              .Include(x => x.BusinessType)
                              .Include(x => x.City)
                              .Include(x => x.District)
                              .Include(x => x.BusinessOwner)
                              .Include(x => x.Province)
                              .Include(x => x.Requirements)
                              .Include(x => x.Street).Where(o => o.UniqueId == new Guid(uniqueId)).SingleOrDefault();
         return(obj);
     }
 }
示例#16
0
        public static bool Add(BusinessRecord obj)
        {
            DB context = new DB();

            obj.UniqueId = Guid.NewGuid();
            context.BusinessRecords.Add(obj);
            try
            {
                context.SaveChanges();
            }
            catch
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// 新增一条记录
        /// </summary>
        /// <param name="qcRecord">质检实体</param>
        /// <returns></returns>
        public static bool InsertOneQCRecord(BusinessRecord qcRecord)
        {
            bool rbool = true;

            using (DCCarManagementDataContext db = new DCCarManagementDataContext())
            {
                try
                {
                    rbool = LinQBaseDao.InsertOne(db, qcRecord);
                }
                catch
                {
                    rbool = false;
                }
                finally { db.Connection.Close(); }
            }
            return(rbool);
        }
        public ActionResult Add(BusinessRecord model, string[] selectedReqs)
        {
            DB context = new DB();
            List <Requirement> newReqs = context.Requirements.Include(x => x.Status).Where(x => x.StatusId != 2).ToList();

            if (selectedReqs == null)
            {
                model.Requirements = new List <Requirement>();
            }
            var selectedReqsHS = new HashSet <string>(selectedReqs);

            //var businessRecords = new HashSet<int>(BusinessRecordData.GetAllReqId(model.UniqueId));
            foreach (var reqs in newReqs)
            {
                if (selectedReqsHS.Contains(reqs.Id.ToString()))
                {
                    //if (!businessRecords.Contains(reqs.Id))
                    //{
                    //    model.Requirements.Add(reqs);
                    //}
                    model.Requirements.Add(reqs);
                }
                //else
                //{
                //    if (businessRecords.Contains(reqs.Id))
                //    {
                //        model.Requirements.Remove(reqs);
                //    }
                //}
            }
            model.UniqueId = Guid.NewGuid();
            context.BusinessRecords.Add(model);
            try
            {
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        // GET: Edit Business Record
        public ActionResult Edit(string id)
        {
            ViewBag.businessowners  = BusinessOwnerData.ListAll();
            ViewBag.businessdetails = BusinessDetailData.ListAll();
            ViewBag.provinces       = ProvincesData.ListAll();
            ViewBag.cities          = CitiesData.ListAll();
            ViewBag.districts       = DistrictData.ListAll();
            ViewBag.barangays       = BarangayData.ListAll();
            ViewBag.streets         = StreetData.ListAll();
            ViewBag.businesstype    = BusinessTypeData.ListAll();
            BusinessRecord model = BusinessRecordData.GetById(id);

            ViewBag.businessRecords = new HashSet <int>(model.Requirements.Select(i => i.Id));
            if (model.BusinessDetail.isNew)
            {
                ViewBag.Requirements = RequirementData.GetNew();
            }
            else
            {
                ViewBag.Requirements = RequirementData.GetRenew();
            }
            return(View(model));
        }
示例#20
0
        public static bool Edit(BusinessRecord obj)
        {
            using (DB context = new DB())
            {
                BusinessRecord _obj = context.BusinessRecords.Where(o => o.UniqueId == obj.UniqueId).SingleOrDefault();
                _obj.BusinessName     = obj.BusinessName;
                _obj.BusinessDetailId = obj.BusinessDetailId;
                _obj.OwnerId          = obj.OwnerId;
                _obj.StartDate        = obj.StartDate.Date;
                _obj.ContactNo        = obj.ContactNo;
                _obj.FaxNo            = obj.FaxNo;
                _obj.ProvinceId       = obj.ProvinceId;
                _obj.CityId           = obj.CityId;
                _obj.DistrictId       = obj.DistrictId;
                _obj.BarangayId       = obj.BarangayId;
                _obj.StreetId         = obj.StreetId;
                _obj.StreetNo         = obj.StreetNo;
                _obj.BlockNo          = obj.BlockNo;
                _obj.Address          = obj.Address;
                _obj.BuildingName     = obj.BuildingName;
                _obj.FloorNo          = obj.FloorNo;
                _obj.isActive         = obj.isActive;
                _obj.BusinessTypeId   = obj.BusinessTypeId;
                _obj.isRetired        = obj.isRetired;
                try
                {
                    context.SaveChanges();
                }
                catch
                {
                    return(false);
                }

                return(true);
            }
        }
示例#21
0
        public ActionResult Business(AssessmentViewModel model)
        {
            DB             db     = new DB();
            BusinessRecord record = db.BusinessRecords.Find(model.Id);

            if (model.quarter == "first")
            {
                record.isAssessed = 1;
            }
            else if (model.quarter == "second")
            {
                record.isAssessed = 2;
            }
            else if (model.quarter == "third")
            {
                record.isAssessed = 3;
            }
            else if (model.quarter == "fourth")
            {
                record.isAssessed = 4;
            }
            db.SaveChanges();
            return(Redirect("/Collection/Business/" + record.UniqueId));
        }
        public ActionResult Edit(BusinessRecord model, string[] selectedReqs, string isNew)
        {
            DB context = new DB(); List <Requirement> nrReqs;

            if (isNew == "true")
            {
                nrReqs = context.Requirements.Include(x => x.Status).Where(x => x.StatusId != 2).ToList();
            }
            else
            {
                nrReqs = context.Requirements.Include(x => x.Status).Where(x => x.StatusId != 1).ToList();
            }
            if (selectedReqs == null)
            {
                model.Requirements = new List <Requirement>();
            }
            var            selectedReqsHS  = new HashSet <string>(selectedReqs);
            BusinessRecord _obj            = context.BusinessRecords.Include(x => x.Requirements).Where(o => o.UniqueId == model.UniqueId).SingleOrDefault();
            var            businessRecords = new HashSet <int>(_obj.Requirements.Select(i => i.Id));

            foreach (var reqs in nrReqs)
            {
                if (selectedReqsHS.Contains(reqs.Id.ToString()))
                {
                    if (!businessRecords.Contains(reqs.Id))
                    {
                        model.Requirements.Add(reqs);
                    }
                    model.Requirements.Add(reqs);
                }
                else
                {
                    if (businessRecords.Contains(reqs.Id))
                    {
                        model.Requirements.Remove(reqs);
                    }
                }
            }
            _obj.BusinessName     = model.BusinessName;
            _obj.BusinessDetailId = model.BusinessDetailId;
            _obj.OwnerId          = model.OwnerId;
            _obj.StartDate        = model.StartDate.Date;
            _obj.ContactNo        = model.ContactNo;
            _obj.FaxNo            = model.FaxNo;
            _obj.ProvinceId       = model.ProvinceId;
            _obj.CityId           = model.CityId;
            _obj.DistrictId       = model.DistrictId;
            _obj.BarangayId       = model.BarangayId;
            _obj.StreetId         = model.StreetId;
            _obj.StreetNo         = model.StreetNo;
            _obj.BlockNo          = model.BlockNo;
            _obj.Address          = model.Address;
            _obj.BuildingName     = model.BuildingName;
            _obj.FloorNo          = model.FloorNo;
            _obj.isActive         = model.isActive;
            _obj.BusinessTypeId   = model.BusinessTypeId;
            _obj.isRetired        = model.isRetired;
            _obj.Requirements     = model.Requirements;
            try
            {
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
示例#23
0
 /// <question>
 /// Our method takes in a BusinessRecord. What are the implications of this?
 /// Could the signature be simplified and if so, what benefits could there be?
 /// </question>
 public Task <IEnumerable <Address> > SearchByBusinessRecord(BusinessRecord record)
 {
     throw new NotImplementedException();
 }
示例#24
0
 internal BusinessItem <T> CreateSoundItem <T>(string name, BusinessRecord parent)
 {
     return(BusinessItemFactory.Create <T>(name, default(T), PermissionFeature.Sound, parent));
 }
示例#25
0
        protected override void Seed(G4.BizPermit.Dal.DB context)
        {
            //BUSINESS NATURE -- START
            BusinessNature bn1 = new BusinessNature();

            bn1.BusinessNatureName = "Food Services";
            bn1.Code        = 1;
            bn1.Description = "Restaurants, etc.";
            bn1.UniqueId    = Guid.NewGuid();
            bn1.IsActive    = true;

            BusinessNature bn2 = new BusinessNature();

            bn2.BusinessNatureName = "Retail";
            bn2.Code        = 2;
            bn2.Description = "Supermarket, stores, etc.";
            bn2.UniqueId    = Guid.NewGuid();
            bn2.IsActive    = true;

            BusinessNature bn3 = new BusinessNature();

            bn3.BusinessNatureName = "Wholesale";
            bn3.Code        = 3;
            bn3.Description = "sales many";
            bn3.UniqueId    = Guid.NewGuid();
            bn3.IsActive    = true;

            BusinessNature bn4 = new BusinessNature();

            bn4.BusinessNatureName = "Manufacturing";
            bn4.Code        = 4;
            bn4.Description = "manufactures goods";
            bn4.UniqueId    = Guid.NewGuid();
            bn4.IsActive    = true;

            BusinessNature bn5 = new BusinessNature();

            bn5.BusinessNatureName = "Services";
            bn5.Code        = 5;
            bn5.Description = "provides service";
            bn5.UniqueId    = Guid.NewGuid();
            bn5.IsActive    = true;
            //BUSINESS NATURE -- END

            //BUSINESS LINE -- START
            BusinessLine bl1 = new BusinessLine();

            bl1.Name           = "Spa";
            bl1.BusinessNature = bn5;
            bl1.Code           = 1;
            bl1.Description    = "parlor and massage";
            bl1.UniqueId       = Guid.NewGuid();
            bl1.isActive       = true;

            BusinessLine bl2 = new BusinessLine();

            bl2.Name           = "Barber";
            bl2.BusinessNature = bn5;
            bl2.Code           = 2;
            bl2.Description    = "kwentong barbero";
            bl2.UniqueId       = Guid.NewGuid();
            bl2.isActive       = true;

            BusinessLine bl3 = new BusinessLine();

            bl3.Name           = "Supermarket";
            bl3.BusinessNature = bn2;
            bl3.Code           = 3;
            bl3.Description    = "nagbebenta";
            bl3.UniqueId       = Guid.NewGuid();
            bl3.isActive       = true;

            BusinessLine bl4 = new BusinessLine();

            bl4.Name           = "Department Store";
            bl4.BusinessNature = bn2;
            bl4.Code           = 4;
            bl4.Description    = "tingi tingi lang";
            bl4.UniqueId       = Guid.NewGuid();
            bl4.isActive       = true;

            BusinessLine bl5 = new BusinessLine();

            bl5.Name           = "Restaurant";
            bl5.BusinessNature = bn1;
            bl5.Code           = 5;
            bl5.Description    = "kainan";
            bl5.UniqueId       = Guid.NewGuid();
            bl5.isActive       = true;
            //BUSINESS LINE -- END

            //BUSINESS DETAIL -- START
            BusinessDetail bd1 = new BusinessDetail();

            bd1.BirthDate    = DateTime.Now;
            bd1.Name         = "biz1";
            bd1.BusinessLine = bl1;
            bd1.Capital      = (decimal)100.12;
            bd1.Gross        = (decimal)234.23;
            bd1.isNew        = true;
            bd1.lastPayDate  = DateTime.ParseExact("2016-12-31", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);
            bd1.UniqueId = Guid.NewGuid();

            BusinessDetail bd2 = new BusinessDetail();

            bd2.BirthDate    = DateTime.Now;
            bd2.Name         = "biz2";
            bd2.BusinessLine = bl2;
            bd2.Capital      = (decimal)200.12;
            bd2.Gross        = (decimal)2134.23;
            bd2.isNew        = true;
            bd2.lastPayDate  = DateTime.ParseExact("2016-12-31", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);
            bd2.UniqueId = Guid.NewGuid();
            //BUSINESS DETAIL -- END

            //BUSINESS OWNER -- START
            BusinessOwner bo1 = new BusinessOwner();

            bo1.FirstName     = "Michael";
            bo1.MiddleName    = "T.";
            bo1.LastName      = "Pollente";
            bo1.MaritalStatus = "Single";
            bo1.UniqueId      = Guid.NewGuid();
            bo1.Gender        = "Male";
            bo1.CorporateName = "Jollibee";
            bo1.BirthDate     = DateTime.ParseExact("1996-06-13", "yyyy-MM-dd",
                                                    System.Globalization.CultureInfo.InvariantCulture);
            bo1.ContactNo   = "1234";
            bo1.Designation = "Mr.";
            bo1.isActive    = true;

            BusinessOwner bo2 = new BusinessOwner();

            bo2.FirstName     = "Jon";
            bo2.MiddleName    = "Lang";
            bo2.LastName      = "Jovi";
            bo2.MaritalStatus = "Single";
            bo2.UniqueId      = Guid.NewGuid();
            bo2.Gender        = "Female";
            bo2.CorporateName = "Mayaman Corp";
            bo2.BirthDate     = DateTime.ParseExact("2016-12-31", "yyyy-MM-dd",
                                                    System.Globalization.CultureInfo.InvariantCulture);
            bo2.ContactNo   = "1234";
            bo2.Designation = "Ms.";
            bo2.isActive    = true;
            //BUSINESS OWNER -- END

            //BUSINESS TYPE -- START
            BusinessType bt1 = new BusinessType();

            bt1.Name        = "Sole Proprietorship";
            bt1.Code        = 1;
            bt1.Description = "mag-isa ka lang";
            bt1.isActive    = true;
            bt1.UniqueId    = Guid.NewGuid();

            BusinessType bt2 = new BusinessType();

            bt2.Name        = "Partnership";
            bt2.Code        = 2;
            bt2.Description = "dalawa na kayo";
            bt2.isActive    = true;
            bt2.UniqueId    = Guid.NewGuid();

            BusinessType bt3 = new BusinessType();

            bt3.Name        = "Corporation";
            bt3.Code        = 3;
            bt3.Description = "woah dami";
            bt3.isActive    = true;
            bt3.UniqueId    = Guid.NewGuid();
            //BUSINESS TYPE -- END

            //BANK -- START
            Bank bank1 = new Bank();

            bank1.Name        = "BPI";
            bank1.CreatedBy   = 1;
            bank1.CreatedDate = DateTime.Now;
            bank1.IsActive    = true;
            bank1.UniqueId    = Guid.NewGuid();

            Bank bank2 = new Bank();

            bank2.Name        = "BDO";
            bank2.CreatedBy   = 1;
            bank2.CreatedDate = DateTime.Now;
            bank2.IsActive    = true;
            bank2.UniqueId    = Guid.NewGuid();
            //BANK -- END

            //PROVINCE -- ADD
            Province prov1 = new Province();

            prov1.UniqueId    = Guid.NewGuid();
            prov1.Name        = "NCR";
            prov1.Code        = 133900000;
            prov1.Description = "Capital";
            prov1.isActive    = true;

            Province prov2 = new Province();

            prov2.UniqueId    = Guid.NewGuid();
            prov2.Name        = "Rizal";
            prov2.Code        = 045800000;
            prov2.Description = "probinsya";
            prov2.isActive    = true;
            //PROVINCE -- END

            //CITY -- START
            City city1 = new City();

            city1.UniqueId    = Guid.NewGuid();
            city1.Name        = "Antipolo City";
            city1.Code        = 045802000;
            city1.Description = "first class";
            city1.isActive    = true;
            city1.Province    = prov2;

            City city2 = new City();

            city2.UniqueId    = Guid.NewGuid();
            city2.Name        = "Cainta";
            city2.Code        = 045805000;
            city2.Description = "municipality";
            city2.isActive    = true;
            city2.Province    = prov2;

            City city3 = new City();

            city3.UniqueId    = Guid.NewGuid();
            city3.Name        = "Manila";
            city3.Code        = 133900000;
            city3.Description = "capital";
            city3.isActive    = true;
            city3.Province    = prov1;

            City city4 = new City();

            city4.UniqueId    = Guid.NewGuid();
            city4.Name        = "Quezon City";
            city4.Code        = 137404000;
            city4.Description = "big";
            city4.isActive    = true;
            city4.Province    = prov1;
            //CITY -- END

            //DISTRICT -- START
            District dist1 = new District();

            dist1.City        = city1;
            dist1.Code        = 1001;
            dist1.Description = "1DAntipolo";
            dist1.Name        = "1st District, Antipolo";
            dist1.UniqueId    = Guid.NewGuid();
            dist1.isActive    = true;

            District dist2 = new District();

            dist2.City        = city1;
            dist2.Code        = 1002;
            dist2.Description = "2DAntipolo";
            dist2.Name        = "2nd District, Antipolo";
            dist2.UniqueId    = Guid.NewGuid();
            dist2.isActive    = true;

            District dist3 = new District();

            dist3.City        = city3;
            dist3.Code        = 2001;
            dist3.Description = "1DManila";
            dist3.Name        = "1st District, Manila";
            dist3.UniqueId    = Guid.NewGuid();
            dist3.isActive    = true;

            District dist4 = new District();

            dist4.City        = city3;
            dist4.Code        = 2002;
            dist4.Description = "2DManila";
            dist4.Name        = "2nd District, Manila";
            dist4.UniqueId    = Guid.NewGuid();
            dist4.isActive    = true;
            //DISTRICT -- END

            //BARANGAY -- START
            Barangay bar1 = new Barangay();

            bar1.Name        = "San Jose";
            bar1.District    = dist1;
            bar1.Code        = 1001;
            bar1.Description = "bar1";
            bar1.isActive    = true;
            bar1.UniqueId    = Guid.NewGuid();

            Barangay bar2 = new Barangay();

            bar2.Name        = "Bagong Nayon";
            bar2.District    = dist2;
            bar2.Code        = 1002;
            bar2.Description = "bar2";
            bar2.isActive    = true;
            bar2.UniqueId    = Guid.NewGuid();

            Barangay bar3 = new Barangay();

            bar3.Name        = "Quiapo";
            bar3.District    = dist4;
            bar3.Code        = 2001;
            bar3.Description = "bar3";
            bar3.isActive    = true;
            bar3.UniqueId    = Guid.NewGuid();

            Barangay bar4 = new Barangay();

            bar4.Name        = "Sampaloc";
            bar4.District    = dist3;
            bar4.Code        = 1001;
            bar4.Description = "bar4";
            bar4.isActive    = true;
            bar4.UniqueId    = Guid.NewGuid();
            //BARANGAY -- END

            //STREET -- START
            Street st1 = new Street();

            st1.Name        = "St1";
            st1.Description = "street";
            st1.Barangay    = bar1;
            st1.Code        = 1001;
            st1.isActive    = true;
            st1.UniqueId    = Guid.NewGuid();

            Street st2 = new Street();

            st2.Name        = "St2";
            st2.Description = "street";
            st2.Barangay    = bar2;
            st2.Code        = 2001;
            st2.isActive    = true;
            st2.UniqueId    = Guid.NewGuid();
            //STREET -- END

            //QUARTER -- START
            Quarter qrt1 = new Quarter();

            qrt1.Name        = "1st Quarter";
            qrt1.IsActive    = true;
            qrt1.CreatedBy   = 1;
            qrt1.CreatedDate = DateTime.Now;
            qrt1.firstQtr    = true;
            qrt1.secondQtr   = false;
            qrt1.thirdQtr    = false;
            qrt1.fourthQtr   = false;

            Quarter qrt2 = new Quarter();

            qrt2.Name        = "2nd Quarter";
            qrt2.IsActive    = true;
            qrt2.CreatedBy   = 1;
            qrt2.CreatedDate = DateTime.Now;
            qrt2.firstQtr    = false;
            qrt2.secondQtr   = true;
            qrt2.thirdQtr    = false;
            qrt2.fourthQtr   = false;

            Quarter qrt3 = new Quarter();

            qrt3.Name        = "3rd Quarter";
            qrt3.IsActive    = true;
            qrt3.CreatedBy   = 1;
            qrt3.CreatedDate = DateTime.Now;
            qrt3.firstQtr    = false;
            qrt3.secondQtr   = false;
            qrt3.thirdQtr    = true;
            qrt3.fourthQtr   = false;

            Quarter qrt4 = new Quarter();

            qrt4.Name        = "4th Quarter";
            qrt4.IsActive    = true;
            qrt4.CreatedBy   = 1;
            qrt4.CreatedDate = DateTime.Now;
            qrt4.firstQtr    = false;
            qrt4.secondQtr   = false;
            qrt4.thirdQtr    = false;
            qrt4.fourthQtr   = true;
            //QUARTER -- END

            //CUTOFF -- START
            Cutoff cut1 = new Cutoff();

            cut1.Name        = "1st";
            cut1.UniqueId    = Guid.NewGuid();
            cut1.IsActive    = true;
            cut1.CreatedDate = DateTime.Now;
            cut1.CreatedBy   = 1;
            cut1.CuttoffDate = DateTime.ParseExact("2017-03-31", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);

            Cutoff cut2 = new Cutoff();

            cut2.Name        = "2nd";
            cut2.UniqueId    = Guid.NewGuid();
            cut2.IsActive    = true;
            cut2.CreatedDate = DateTime.Now;
            cut2.CreatedBy   = 1;
            cut2.CuttoffDate = DateTime.ParseExact("2017-06-30", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);

            Cutoff cut3 = new Cutoff();

            cut3.Name        = "3rd";
            cut3.UniqueId    = Guid.NewGuid();
            cut3.IsActive    = true;
            cut3.CreatedDate = DateTime.Now;
            cut3.CreatedBy   = 1;
            cut3.CuttoffDate = DateTime.ParseExact("2017-09-30", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);

            Cutoff cut4 = new Cutoff();

            cut4.Name        = "4th";
            cut4.UniqueId    = Guid.NewGuid();
            cut4.IsActive    = true;
            cut4.CreatedDate = DateTime.Now;
            cut4.CreatedBy   = 1;
            cut4.CuttoffDate = DateTime.ParseExact("2017-12-31", "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);
            //CUTOFF -- END

            //STATUS -- START
            Status stat1 = new Status();

            stat1.Name        = "New";
            stat1.UniqueId    = Guid.NewGuid();
            stat1.CreatedDate = DateTime.Now;
            stat1.CreatedBy   = 1;

            Status stat2 = new Status();

            stat2.Name        = "Renew";
            stat2.UniqueId    = Guid.NewGuid();
            stat2.CreatedDate = DateTime.Now;
            stat2.CreatedBy   = 1;

            Status stat3 = new Status();

            stat3.Name        = "Both";
            stat3.UniqueId    = Guid.NewGuid();
            stat3.CreatedDate = DateTime.Now;
            stat3.CreatedBy   = 1;
            //STATUS -- END

            //FEES -- START
            Fee fee1 = new Fee();

            fee1.Name         = "Business Tax New";
            fee1.Rate         = 1500;
            fee1.isQuarterly  = true;
            fee1.isActive     = true;
            fee1.withInterest = false;
            fee1.UniqueId     = Guid.NewGuid();
            fee1.CreatedBy    = 1;
            fee1.CreatedDate  = DateTime.Now;
            fee1.Status       = stat1;

            Fee fee2 = new Fee();

            fee2.Name         = "Business Tax Renew";
            fee2.Rate         = 1000;
            fee2.isQuarterly  = true;
            fee2.isActive     = true;
            fee2.withInterest = false;
            fee2.UniqueId     = Guid.NewGuid();
            fee2.CreatedBy    = 1;
            fee2.CreatedDate  = DateTime.Now;
            fee2.Status       = stat2;

            Fee fee3 = new Fee();

            fee3.Name         = "Mayor's Fee";
            fee3.Rate         = 500;
            fee3.isQuarterly  = false;
            fee3.isActive     = true;
            fee3.withInterest = false;
            fee3.UniqueId     = Guid.NewGuid();
            fee3.CreatedBy    = 1;
            fee3.CreatedDate  = DateTime.Now;
            fee3.Status       = stat3;

            Fee fee4 = new Fee();

            fee4.Name         = "Garbage Fee";
            fee4.Rate         = 200;
            fee4.isQuarterly  = false;
            fee4.isActive     = true;
            fee4.withInterest = false;
            fee4.UniqueId     = Guid.NewGuid();
            fee4.CreatedBy    = 1;
            fee4.CreatedDate  = DateTime.Now;
            fee4.Status       = stat3;

            Fee fee5 = new Fee();

            fee5.Name         = "Mechanical Fee";
            fee5.Rate         = 250;
            fee5.isQuarterly  = false;
            fee5.isActive     = true;
            fee5.withInterest = false;
            fee5.UniqueId     = Guid.NewGuid();
            fee5.CreatedBy    = 1;
            fee5.CreatedDate  = DateTime.Now;
            fee5.Status       = stat3;

            Fee fee6 = new Fee();

            fee6.Name         = "Plumbing Fee";
            fee6.Rate         = 230;
            fee6.isQuarterly  = false;
            fee6.isActive     = true;
            fee6.withInterest = false;
            fee6.UniqueId     = Guid.NewGuid();
            fee6.CreatedBy    = 1;
            fee6.CreatedDate  = DateTime.Now;
            fee6.Status       = stat3;

            Fee fee7 = new Fee();

            fee7.Name         = "Electrical Fee";
            fee7.Rate         = 400;
            fee7.isQuarterly  = false;
            fee7.isActive     = true;
            fee7.withInterest = false;
            fee7.UniqueId     = Guid.NewGuid();
            fee7.CreatedBy    = 1;
            fee7.CreatedDate  = DateTime.Now;
            fee7.Status       = stat3;

            Fee fee8 = new Fee();

            fee8.Name         = "Sticker Fee";
            fee8.Rate         = 100;
            fee8.isQuarterly  = false;
            fee8.isActive     = true;
            fee8.withInterest = false;
            fee8.UniqueId     = Guid.NewGuid();
            fee8.CreatedBy    = 1;
            fee8.CreatedDate  = DateTime.Now;
            fee8.Status       = stat3;
            //FEE -- END

            //REQUIREMENTS -- START
            Requirement req1 = new Requirement();

            req1.Name        = "Barangay Clearance";
            req1.Status      = stat1;
            req1.UniqueId    = Guid.NewGuid();
            req1.IsActive    = true;
            req1.CreatedBy   = 1;
            req1.CreatedDate = DateTime.Now;

            Requirement req2 = new Requirement();

            req2.Name        = "Authorization Letter of Owner and ID";
            req2.Status      = stat3;
            req2.UniqueId    = Guid.NewGuid();
            req2.IsActive    = true;
            req2.CreatedBy   = 1;
            req2.CreatedDate = DateTime.Now;

            Requirement req3 = new Requirement();

            req3.Name        = "Lease Contract / Tax Declaration";
            req3.Status      = stat3;
            req3.UniqueId    = Guid.NewGuid();
            req3.IsActive    = true;
            req3.CreatedBy   = 1;
            req3.CreatedDate = DateTime.Now;

            Requirement req4 = new Requirement();

            req4.Name        = "SSS (Certification / Clearance)";
            req4.Status      = stat3;
            req4.UniqueId    = Guid.NewGuid();
            req4.IsActive    = true;
            req4.CreatedBy   = 1;
            req4.CreatedDate = DateTime.Now;

            Requirement req5 = new Requirement();

            req5.Name        = "CTC (Community Tax Certificate)";
            req5.Status      = stat3;
            req5.UniqueId    = Guid.NewGuid();
            req5.IsActive    = true;
            req5.CreatedBy   = 1;
            req5.CreatedDate = DateTime.Now;

            Requirement req6 = new Requirement();

            req6.Name        = "Public Liability Insurance";
            req6.Status      = stat2;
            req6.UniqueId    = Guid.NewGuid();
            req6.IsActive    = true;
            req6.CreatedBy   = 1;
            req6.CreatedDate = DateTime.Now;

            Requirement req7 = new Requirement();

            req7.Name        = "SEC Registration";
            req7.Status      = stat2;
            req7.UniqueId    = Guid.NewGuid();
            req7.IsActive    = true;
            req7.CreatedBy   = 1;
            req7.CreatedDate = DateTime.Now;

            Requirement req8 = new Requirement();

            req8.Name        = "DTI";
            req8.Status      = stat2;
            req8.UniqueId    = Guid.NewGuid();
            req8.IsActive    = true;
            req8.CreatedBy   = 1;
            req8.CreatedDate = DateTime.Now;
            //REQUIREMENTS -- END

            BusinessRecord br = new BusinessRecord();

            br.Barangay       = bar1;
            br.BlockNo        = 1;
            br.BuildingName   = "adwa";
            br.BusinessDetail = bd1;
            br.BusinessName   = "Mayaman Corp.";
            br.BusinessOwner  = bo2;
            br.BusinessType   = bt3;
            br.City           = city1;
            br.Province       = prov1;
            br.District       = dist1;
            br.StartDate      = DateTime.Now;
            br.Street         = st1;
            br.StreetNo       = 1;
            br.UniqueId       = Guid.NewGuid();
            br.isActive       = true;
            br.isAssessed     = 0;
            br.isCollected    = 0;
            br.isRetired      = false;
            br.Address        = "adwad";
            br.ContactNo      = "12313";
            br.FaxNo          = "2131";
            br.FloorNo        = 2;
            br.Requirements.Add(req1);
            br.Requirements.Add(req2);

            context.BusinessNatures.AddOrUpdate(bn1, bn2, bn3, bn4, bn5);
            context.BusinessLines.AddOrUpdate(bl1, bl2, bl3, bl4, bl5);
            context.BusinessDetails.AddOrUpdate(bd1, bd2);
            context.BusinessOwners.AddOrUpdate(bo1, bo2);
            context.BusinessTypes.AddOrUpdate(bt1, bt2, bt3);
            context.BankRecords.AddOrUpdate(bank1, bank2);
            context.Provinces.AddOrUpdate(prov1, prov2);
            context.Cities.AddOrUpdate(city1, city2, city3, city4);
            context.Districts.AddOrUpdate(dist1, dist2, dist3, dist4);
            context.Barangays.AddOrUpdate(bar1, bar2, bar3, bar4);
            context.Streets.AddOrUpdate(st1, st2);
            context.Quarters.AddOrUpdate(qrt1, qrt2, qrt3, qrt4);
            context.Cutoffs.AddOrUpdate(cut1, cut2, cut3, cut4);
            context.Statuses.AddOrUpdate(stat1, stat2, stat3);
            context.Fees.AddOrUpdate(fee1, fee2, fee3, fee4, fee5, fee6, fee7, fee8);
            context.Requirements.AddOrUpdate(req1, req2, req3, req4, req5, req6, req7, req8);
            context.BusinessRecords.AddOrUpdate(br);
        }
示例#26
0
        public ActionResult Business(string id)
        {
            DB             db     = new DB();
            var            model  = new AssessmentViewModel();
            BusinessRecord record = BusinessRecordData.GetById(id);

            model.Id = record.Id;
            int newReqs   = db.Requirements.Where(x => x.StatusId != 2).Count();
            int renewReqs = db.Requirements.Where(x => x.StatusId != 1).Count();

            model.BusinessName = record.BusinessName;
            model.Address      = record.Address;
            model.isNew        = record.BusinessDetail.isNew;
            model.lastDatePaid = record.BusinessDetail.lastPayDate;
            model.OwnerName    = record.BusinessOwner.FirstName + " " + record.BusinessOwner.LastName;
            if (model.isNew)
            {
                if (record.Requirements.Count == newReqs)
                {
                    model.completeRequirements = true;
                }
                else
                {
                    model.completeRequirements = false;
                }
            }
            else
            {
                if (record.Requirements.Count == renewReqs)
                {
                    model.completeRequirements = true;
                }
                else
                {
                    model.completeRequirements = false;
                }
            }
            //DateTime cutOffFirst = DateTime.ParseExact("2017-03-31", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffSecond = DateTime.ParseExact("2017-06-30", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffThird = DateTime.ParseExact("2017-09-30", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            //DateTime cutOffFourth = DateTime.ParseExact("2017-12-31", "yyyy-MM-dd",
            //                          System.Globalization.CultureInfo.InvariantCulture);
            model.isCollected = record.isCollected;
            if (/*model.lastDatePaid <= cutOffFirst */ model.isCollected <= 0) //disabled check because this is always true until March 31, 2017. lastpaiddate will always be before 03/31 because it is updated by DateTime.NOW
            {
                model.isFirst         = false;
                model.isSecond        = false;
                model.isThird         = false;
                model.isFourth        = false;
                model.lastQuarterPaid = "";
            }
            else if (/*(model.lastDatePaid > cutOffFirst && model.lastDatePaid <= cutOffSecond)*/ model.isCollected == 1)
            {
                model.isFirst         = true;
                model.isSecond        = false;
                model.isThird         = false;
                model.isFourth        = false;
                model.lastQuarterPaid = "First Quarter";
            }
            else if (/*(model.lastDatePaid > cutOffSecond && model.lastDatePaid <= cutOffThird)*/ model.isCollected == 2)
            {
                model.isFirst         = true;
                model.isSecond        = true;
                model.isThird         = false;
                model.isFourth        = false;
                model.lastQuarterPaid = "Second Quarter";
            }
            else if (/*(model.lastDatePaid > cutOffThird && model.lastDatePaid <= cutOffFourth)*/ model.isCollected == 3)
            {
                model.isFirst         = true;
                model.isSecond        = true;
                model.isThird         = true;
                model.isFourth        = false;
                model.lastQuarterPaid = "Third Quarter";
            }
            else if (/*model.lastDatePaid > cutOffFourth &&*/ model.isCollected == 4)
            {
                model.isFirst         = true;
                model.isSecond        = true;
                model.isThird         = true;
                model.isFourth        = true;
                model.lastQuarterPaid = "Fourth Quarter";
            }
            return(View(model));
        }
示例#27
0
 internal NotValuedDayInterestAndStorage(BusinessRecord parent, OrderConstructParams constructParams)
     : base(parent)
 {
 }
示例#28
0
 public BusinessRecordTests()
 {
     businessRecord = new BusinessRecord();
 }