Esempio n. 1
0
 private void btnFil_Click(object sender, EventArgs e)
 {
     if (dgvData.Rows.Count == 0)
     {
         baseClass.Warning("Not have data for Filter.\n");
         return;
     }
     //
     this.Cursor = Cursors.WaitCursor;
     try
     {
         var ft = new PlanningCal_Filter(false, false);
         ft.ShowDialog();
         if (ft.okFilter)
         {
             FilterE(ft.dateFrom, ft.dateTo, ft.MRP, ft.MPS, ft.ItemNo, ft.locationItem);
         }
     }
     catch (Exception ex)
     {
         baseClass.Error(ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Esempio n. 2
0
        private void btnRecal_Click(object sender, EventArgs e)
        {
            var ft = new PlanningCal_Filter(true, false);

            ft.ShowDialog();
            if (ft.okFilter)
            {
                ClearPlan();

                radLabelElement1.Text = $"Filter date : {ft.dateFrom.ToDtString()}-{ft.dateTo.ToDtString()}";
                //LoadData(true, ft.dateFrom, ft.dateTo, ft.MRP, ft.MPS, ft.ItemNo, ft.locationItem);
                var ps = new PlanningCal_Status(ft.dateFrom, ft.dateTo, ft.ItemNo, ft.locationItem, ft.MRP, ft.MPS);
                //ps.dFrom = ft.dateFrom;
                //ps.dTo = ft.dateTo;
                //ps.ItemNo = ft.ItemNo;
                //ps.LocationItem = ft.locationItem;
                ps.ShowDialog();
                if (ps.calComplete)
                {
                    dgvData.DataSource          = null;
                    dgvData.AutoGenerateColumns = false;
                    //dgvData.DataSource = ps.gridPlans.OrderBy(x => x.ReqDate);

                    SavePlan(ps.gridPlans, ft.dateFrom, ft.dateTo);
                    //SaveCapacity_TEMP(ps.capacityLoad);
                    //SaveCalendar_TEMP(ps.calLoad);
                    SaveReserve(ps.sReserve);

                    DataLoad();
                    dFrom = ps.dFrom;

                    //FilterE(ft.dateFrom, ft.dateTo, ft.MRP, ft.MPS, ft.ItemNo, ft.locationItem);
                }
            }
        }