Exemple #1
0
        private void generatePayrollToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lv.SelectedItems.Count > 0)
            {
                string cutoff_id = lv.SelectedItems[0].SubItems[1].Text;
                Cutoff c, c1 = new Cutoff();
                c1.cutoff_id = cutoff_id;
                c            = c1.SELECT_BY_ID();


                //PAYROLL GENERATOR USER INTERFACE
                payroll_generator_ctrl pgctrl = new payroll_generator_ctrl();


                //PASS A DATATABLE TO PAYROLL GENERATOR
                Cutoff_Details cd1            = new Cutoff_Details();
                cd1.cutoff_id = c1.cutoff_id;
                DataTable cutoffdetailsdt = cd1.SELECT_BYID();

                pgctrl.cutoffdetailsdt = cutoffdetailsdt;

                pnlops.Controls.Clear();

                pgctrl.cutoff = c;
                pgctrl.Width  = pnlops.Width;
                pnlops.Height = pgctrl.Height;
                pnlops.Controls.Add(pgctrl);
            }
        }
Exemple #2
0
        public ActionResult Delete(string id)
        {
            ViewBag.Cutoffs = CutoffData.ListAll();
            Cutoff cutoff = CutoffData.GetById(id);

            return(View(cutoff));
        }
Exemple #3
0
 public bool Equals(IndexQuery other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(PageSizeSet.Equals(other.PageSizeSet) &&
            String.Equals(Query, other.Query) &&
            Equals(TotalSize, other.TotalSize) &&
            Equals(QueryInputs, other.QueryInputs) &&
            Start == other.Start &&
            AggregationOperation == other.AggregationOperation &&
            Equals(GroupBy, other.GroupBy) &&
            Equals(FieldsToFetch, other.FieldsToFetch) &&
            Equals(SortedFields, other.SortedFields) &&
            Cutoff.Equals(other.Cutoff) &&
            Equals(CutoffEtag, other.CutoffEtag) &&
            String.Equals(DefaultField, other.DefaultField) &&
            DefaultOperator == other.DefaultOperator &&
            SkipTransformResults.Equals(other.SkipTransformResults) &&
            Equals(SkippedResults, other.SkippedResults) &&
            DebugOptionGetIndexEntries.Equals(other.DebugOptionGetIndexEntries) &&
            Equals(HighlightedFields, other.HighlightedFields) &&
            Equals(HighlighterPreTags, other.HighlighterPreTags) &&
            Equals(HighlighterPostTags, other.HighlighterPostTags) &&
            String.Equals(ResultsTransformer, other.ResultsTransformer) &&
            DisableCaching.Equals(other.DisableCaching));
 }
Exemple #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PageSizeSet.GetHashCode();
         hashCode = (hashCode * 397) ^ (Query != null ? Query.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalSize != null ? TotalSize.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (QueryInputs != null ? QueryInputs.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Start;
         hashCode = (hashCode * 397) ^ (int)AggregationOperation;
         hashCode = (hashCode * 397) ^ (GroupBy != null ? GroupBy.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FieldsToFetch != null ? FieldsToFetch.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SortedFields != null ? SortedFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Cutoff.GetHashCode();
         hashCode = (hashCode * 397) ^ (CutoffEtag != null ? CutoffEtag.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DefaultField != null ? DefaultField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)DefaultOperator;
         hashCode = (hashCode * 397) ^ SkipTransformResults.GetHashCode();
         hashCode = (hashCode * 397) ^ (SkippedResults != null ? SkippedResults.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DebugOptionGetIndexEntries.GetHashCode();
         hashCode = (hashCode * 397) ^ (HighlightedFields != null ? HighlightedFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlighterPreTags != null ? HighlighterPreTags.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlighterPostTags != null ? HighlighterPostTags.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ResultsTransformer != null ? ResultsTransformer.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DisableCaching.GetHashCode();
         return(hashCode);
     }
 }
Exemple #5
0
 public bool Equals(IndexQuery other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(PageSizeSet.Equals(other.PageSizeSet) &&
            String.Equals(Query, other.Query) &&
            Equals(TotalSize, other.TotalSize) &&
            Equals(TransformerParameters, other.TransformerParameters) &&
            Start == other.Start &&
            Equals(IsDistinct, other.IsDistinct) &&
            Equals(FieldsToFetch, other.FieldsToFetch) &&
            Equals(SortedFields, other.SortedFields) &&
            Equals(SortHints, other.SortHints) &&
            Cutoff.Equals(other.Cutoff) &&
            WaitForNonStaleResultsAsOfNow.Equals(other.WaitForNonStaleResultsAsOfNow) &&
            WaitForNonStaleResults.Equals(other.WaitForNonStaleResults) &&
            Equals(CutoffEtag, other.CutoffEtag) &&
            String.Equals(DefaultField, other.DefaultField) &&
            DefaultOperator == other.DefaultOperator &&
            Equals(SkippedResults, other.SkippedResults) &&
            DebugOptionGetIndexEntries.Equals(other.DebugOptionGetIndexEntries) &&
            Equals(HighlightedFields, other.HighlightedFields) &&
            Equals(HighlighterPreTags, other.HighlighterPreTags) &&
            Equals(HighlighterPostTags, other.HighlighterPostTags) &&
            Equals(HighlighterKeyName, other.HighlighterKeyName) &&
            String.Equals(ResultsTransformer, other.ResultsTransformer) &&
            ShowTimings == other.ShowTimings &&
            DisableCaching.Equals(other.DisableCaching));
 }
Exemple #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PageSizeSet.GetHashCode();
         hashCode = (hashCode * 397) ^ (Query != null ? Query.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalSize != null ? TotalSize.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TransformerParameters != null ? TransformerParameters.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Start;
         hashCode = (hashCode * 397) ^ (IsDistinct ? 1 : 0);
         hashCode = (hashCode * 397) ^ (FieldsToFetch != null ? FieldsToFetch.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SortedFields != null ? SortedFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SortHints != null ? SortHints.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Cutoff.GetHashCode();
         hashCode = (hashCode * 397) ^ WaitForNonStaleResultsAsOfNow.GetHashCode();
         hashCode = (hashCode * 397) ^ (CutoffEtag != null ? CutoffEtag.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DefaultField != null ? DefaultField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)DefaultOperator;
         hashCode = (hashCode * 397) ^ (SkippedResults != null ? SkippedResults.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DebugOptionGetIndexEntries.GetHashCode();
         hashCode = (hashCode * 397) ^ (HighlightedFields != null ? HighlightedFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlighterPreTags != null ? HighlighterPreTags.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlighterPostTags != null ? HighlighterPostTags.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlighterKeyName != null ? HighlighterKeyName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ResultsTransformer != null ? ResultsTransformer.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ShowTimings ? 1 : 0);
         hashCode = (hashCode * 397) ^ DisableCaching.GetHashCode();
         return(hashCode);
     }
 }
Exemple #7
0
 public static Cutoff GetById(string uniqueId)
 {
     using (DB context = new DB())
     {
         Cutoff obj = context.Cutoffs.Where(o => o.UniqueId == new Guid(uniqueId)).SingleOrDefault();
         return(obj);
     }
 }
Exemple #8
0
        public override int GetHashCode()
        {
            var hash = 17;

            hash = hash * 23 + Cutoff.GetHashCode();
            hash = hash * 23 + AMTMatches.GetHashCode();
            hash = hash * 23 + FDR.GetHashCode();
            hash = hash * 23 + m_label.GetHashCode();
            return(hash);
        }
Exemple #9
0
        public ActionResult Delete(Cutoff cutoff)
        {
            bool result = CutoffData.Delete(cutoff.UniqueId.ToString());

            if (result)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
Exemple #10
0
        public ActionResult Edit(Cutoff cutoff)
        {
            bool result = CutoffData.Edit(cutoff);

            if (result)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
Exemple #11
0
        public ActionResult Add(Cutoff cutoff)
        {
            cutoff.CreatedDate = DateTime.Now;
            bool result = CutoffData.Add(cutoff);

            if (result)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
		public void Update(float timeStepInSeconds)
		{
			float now = mCurrentTime + timeStepInSeconds;
			IEffect queuedTo = new Cutoff{ TimeToStart = now };
			IEffect activeTo = new Cutoff{ TimeToEnd = now };

			// MOVE EFFECTS TO APPLIED LISTS
			MoveQueuedEffectsToActive (queuedTo);

			// RESET MOTORS
			ResetAndRemoveExpiryEffects (activeTo);
			UpdateActiveEffects (now);
			ApplyEffect ();
			mCurrentTime = now;
		}
Exemple #13
0
    void Start()
    {
        Begin();
        AStar.SetAllNodes();
        SprintContainer sprint = GetComponent <SprintContainer>();

        bringFlagHome = new ReturnHome(theTransform, enemy.GetComponent <Transform>(), sprint, teamFlag);
        seekEnemyFlag = new SeekEnemyFlag(theTransform, sprint, enemyFlag);
        captureEnemy  = new Cutoff(theTransform, sprint, enemyFlag, teamFlag);
        chaseEnemy    = new Chase(theTransform, enemyTransform, sprint);

        machine = new StateMachine(seekEnemyFlag);

        initialEnemyFlagPosition = enemyFlagObject.transform.position;
        initialTeamFlagPosiiton  = teamFlagObject.transform.position;
    }
Exemple #14
0
        public static bool Add(Cutoff obj)
        {
            using (DB context = new DB())
            {
                obj.UniqueId = Guid.NewGuid();
                context.Cutoffs.Add(obj);
                try
                {
                    context.SaveChanges();
                }
                catch
                {
                    return(false);
                }

                return(true);
            }
        }
Exemple #15
0
        public static bool Delete(String UniqueId)
        {
            using (DB context = new DB())
            {
                Cutoff obj = context.Cutoffs.Where(o => o.UniqueId == new Guid(UniqueId)).SingleOrDefault();
                context.Cutoffs.Remove(obj);
                try
                {
                    context.SaveChanges();
                }
                catch
                {
                    return(false);
                }

                return(true);
            }
        }
Exemple #16
0
        public static bool Edit(Cutoff obj)
        {
            using (DB context = new DB())
            {
                Cutoff _obj = context.Cutoffs.Where(o => o.UniqueId == obj.UniqueId).SingleOrDefault();
                _obj.Name        = obj.Name;
                _obj.IsActive    = obj.IsActive;
                _obj.CreatedBy   = obj.CreatedBy;
                _obj.CuttoffDate = obj.CuttoffDate;
                try
                {
                    context.SaveChanges();
                }
                catch
                {
                    return(false);
                }

                return(true);
            }
        }
Exemple #17
0
        public override bool Equals(object obj)
        {
            var stacFDR = obj as STACFDR;

            if (stacFDR == null)
            {
                return(false);
            }
            if (!Cutoff.Equals(stacFDR.Cutoff))
            {
                return(false);
            }
            if (!AMTMatches.Equals(stacFDR.AMTMatches))
            {
                return(false);
            }
            if (!FDR.Equals(stacFDR.FDR))
            {
                return(false);
            }
            return(ConformationMatches.Equals(stacFDR.ConformationMatches));
        }
Exemple #18
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lv.SelectedItems.Count > 0)
            {
                string cutoff_id = lv.SelectedItems[0].SubItems[1].Text;

                Cutoff cd1 = new Cutoff();

                cd1.cutoff_id = cutoff_id;

                if (MessageBox.Show("Are you sure you want to delete this cutoff?.", "Confirm Delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    if (cd1.delete())
                    {
                        MessageBox.Show("Successful", "Delete");
                    }
                    else
                    {
                        MessageBox.Show("Tehere was a problem deleting this cutoff.\n\n Message :" + db.err.Message);
                    }
                }
            }
        }
Exemple #19
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            Cutoff c = new Cutoff();

            txtcutoff_id.Text = dtfrom_date.Value.ToString("MMddyyyy") + dtto_date.Value.ToString("MMddyyyy");
            c.cutoff_id       = txtcutoff_id.Text;
            c.from_date       = dtfrom_date.Value;
            c.to_date         = dtto_date.Value;

            TimeSpan numofdays = c.to_date.Subtract(c.from_date);



            if (c.save())
            {
                for (int x = 0; x <= numofdays.Days; x++)
                {
                    Cutoff_Details cd = new Cutoff_Details();
                    Day_Marker     dm, dm1 = new Day_Marker();


                    DateTime thisdate = c.from_date.AddDays(x);


                    //MessageBox.Show(thisdate.ToString("MMMM-d"));
                    //CHECK FOR HOLIDAYS IN THE DAY MARKER TABLE
                    dm = dm1.SELECT_BY_DATE(thisdate.ToString("MMMM-d"));


                    String day_type     = "";
                    String holiday_name = "";


                    if (thisdate.ToString("dddd") == "Sunday")
                    {
                        day_type = "REST_DAY";
                    }
                    else
                    {
                        day_type     = (dm != null) ? dm.type_ : "REGULAR_DAY";
                        holiday_name = (dm != null) ? dm.name_of_holiday : "";
                    }


                    cd.cutoff_id    = c.cutoff_id;
                    cd.date_        = thisdate;
                    cd.day_type     = day_type;
                    cd.holiday_name = holiday_name;

                    cd.save();

                    //MessageBox.Show(day_type + "-" + holiday_name);
                }

                MessageBox.Show("Successful.", "Saving Cutoff");
            }
            else
            {
                MessageBox.Show("There was a problem saving this cutoff.\n\n Message :" + db.err.Message, "Saving Cutoff");
            }
        }
Exemple #20
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);
        }
Exemple #21
0
        private void cutoff_ctrl_Load(object sender, EventArgs e)
        {
            Cutoff c = new Cutoff();

            c.LoadOnListView(lv);
        }