예제 #1
0
        internal void InitData(OrderData obj)
        {
            List <OrderBody> ob = new OrderControllers().GetReportJobList(obj);
            int ctn             = 0;
            int xqty            = 0;

            ob.ForEach(i => {
                ctn  += i.Ctn;
                xqty += i.BalQty;
            });
            if (ob.Count > 0)
            {
                var r = ob[0];
                prAffCode.Value    = r.Affcode;
                prQrCode.Value     = r.RefNo;
                prRefNo.Value      = r.RefNo;
                prInvoice.Value    = r.RefInv;
                prZone.Value       = r.Zone;
                prCountry.Value    = r.Custname;
                prEtd.Value        = r.Etd;
                prShipType.Value   = r.Ship;
                prFactory.Value    = r.Factory;
                prGroupOrder.Value = r.PoType;
                prPrintDate.Value  = DateTime.Now;
                prCustCode.Value   = r.Custcode;
                prBalQty.Value     = xqty;
                prTotal.Value      = ctn;
            }

            objectDataSource1.DataSource = ob;
            SplashScreenManager.CloseDefaultWaitForm();
        }
예제 #2
0
 private void bbiSearch_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         SplashScreenManager.ShowDefaultWaitForm();
         if (bbiOrderId.EditValue != null)
         {
             if (bbiOrderId.EditValue.ToString() != "")
             {
                 List <OrderData> obj = new OrderControllers().GetOrderData(bbiOrderId.EditValue.ToString());
                 gridControl.DataSource  = obj;
                 bsiRecordsCount.Caption = "RECORDS : " + obj.Count;
             }
             else
             {
                 XtraMessageBox.Show("กรุณาระบุเลขที่ออร์เดอร์ที่ต้องการค้นหาด้วย");
             }
         }
         SplashScreenManager.CloseDefaultWaitForm();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message);
     }
 }
예제 #3
0
        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            var result = XtraInputBox.Show("ระบุเลขที่ LOTNO ที่ต้องการค้นหา", "ค้นหาข้อมูล", null);

            Console.WriteLine(result);
            try
            {
                SplashScreenManager.ShowDefaultWaitForm();
                if (result != null)
                {
                    if (result.ToString() != "")
                    {
                        List <OrderData> obj = new OrderControllers().GetLotNoData(result.ToString());
                        if (obj.Count > 0)
                        {
                            gridControl.DataSource  = obj;
                            bsiRecordsCount.Caption = "RECORDS : " + obj.Count;
                        }
                        else
                        {
                            XtraMessageBox.Show("ไม่พบข้อมูลที่ต้องการค้นหา");
                        }
                    }
                }
                SplashScreenManager.CloseDefaultWaitForm();
            }
            catch (Exception ex)
            {
                new GreeterFunction().CreateLogSearch(result.ToString());
                XtraMessageBox.Show("ไม่พบข้อมูลที่ต้องการค้นหา");
            }
        }
예제 #4
0
 void ReloadOrder()
 {
     this.Invoke(new MethodInvoker(delegate {
         List <OrderData> obj    = new OrderControllers().GetOrderData(bbiFactory.EditValue.ToString(), DateTime.Parse(bbiEtd.EditValue.ToString()), bool.Parse(bbiOnDay.EditValue.ToString()));
         gridControl.DataSource  = obj;
         bsiRecordsCount.Caption = "RECORDS : " + obj.Count;
     }));
 }
예제 #5
0
        public OrderPalletDetailForm(OrderData obj)
        {
            InitializeComponent();
            List <string> refkey = new OrderControllers().GetOrderRefinvoice(obj);

            refno     = "'" + string.Join("','", refkey) + "'";
            this.Text = $"{refno.Replace("'", "").Trim()} PALLET DETAIL";
            ReloadData();
        }
예제 #6
0
        bool CreateJobList()
        {
            SplashScreenManager.ShowDefaultWaitForm();
            string refinv = new OrderControllers().CreatedJobList(ord);

            ord.RefNo            = refinv;
            ord.RefInv           = refinv;
            bbiRefInv.EditValue  = refinv;
            bbiInvoice.EditValue = refinv;
            SplashScreenManager.CloseDefaultWaitForm();
            return(true);
        }
예제 #7
0
        private void GetOrderNotCreateJobList()
        {
            DateTime d = DateTime.Parse(bbiEtd.EditValue.ToString());

            this.Invoke(new MethodInvoker(delegate {
                int x = new OrderControllers().GetOrderNotCreateJobList(d);
                bbiOrderStatus.Caption = "              ";
                if (x > 0)
                {
                    bbiOrderStatus.Caption = $"{x} PO NOT CREATE.";
                }
            }));
        }
예제 #8
0
 void ReloadData()
 {
     SplashScreenManager.ShowDefaultWaitForm();
     if (sload)
     {
         List <OrderData> obj = new OrderControllers().GetOrderData(bbiFactory.EditValue.ToString(), DateTime.Parse(bbiEtd.EditValue.ToString()), bool.Parse(bbiOnDay.EditValue.ToString()));
         List <OrderData> ob  = obj.OrderBy(j => j.PoType).ToList();
         gridControl.DataSource  = ob;
         bsiRecordsCount.Caption = "RECORDS : " + ob.Count;
     }
     sload = true;
     SplashScreenManager.CloseDefaultWaitForm();
 }
예제 #9
0
 void ReloadForm()
 {
     this.Invoke(new MethodInvoker(delegate {
         bbiEtd.EditValue        = ord.Etd;
         bbiShip.EditValue       = ord.Ship;
         bbiZone.EditValue       = ord.Zone;
         bbiAffcode.EditValue    = ord.Affcode;
         bbiCustCode.EditValue   = ord.Custcode;
         bbiCustName.EditValue   = ord.Custname;
         bbiOrderBy.EditValue    = ord.PoType;
         bbiRefInv.EditValue     = ord.RefNo;
         List <OrderBody> ob     = new OrderControllers().GetOrderDetail(ord);
         bbiInvoice.EditValue    = ob[0].RefInv;
         gridControl.DataSource  = ob;
         bsiRecordsCount.Caption = "RECORDS : " + ob.Count;
     }));
 }
예제 #10
0
        private void bbiRebuildPalletCarton_ItemClick(object sender, ItemClickEventArgs e)
        {
            DialogResult r = XtraMessageBox.Show("คุณต้องการที่จะ RE-BUILD PALLET ใหม่ใช่หรือไม่?", "XPW Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (r == DialogResult.Yes)
            {
                if (invno.Substring(0, 1) == "I")
                {
                    //new GreeterFunction().SumPlInj(invno);
                }
                else
                {
                    string custname = new OrderControllers().GetCustomerByRefInvoice(invno);
                    new GreeterFunction().SumPallet(invno, custname);
                }
                XtraMessageBox.Show("อัพเดทข้อมูลเสร็จแล้ว");
            }
            ReloadData();
        }
예제 #11
0
        void ReloadData()
        {
            bbiEtd.EditValue      = ord.Etd;
            bbiShip.EditValue     = ord.Ship;
            bbiZone.EditValue     = ord.Zone;
            bbiAffcode.EditValue  = ord.Affcode;
            bbiCustCode.EditValue = ord.Custcode;
            bbiCustName.EditValue = ord.Custname;
            bbiOrderBy.EditValue  = ord.PoType;
            bbiRefInv.EditValue   = ord.RefNo;
            List <OrderBody> ob = new OrderControllers().GetOrderDetail(ord);

            bbiInvoice.EditValue = "";
            if (ob.Count > 0)
            {
                bbiInvoice.EditValue = ob[0].RefInv;
            }
            gridControl.DataSource  = ob;
            bsiRecordsCount.Caption = "RECORDS : " + ob.Count;
        }
예제 #12
0
        public OrderDetailForm(OrderData obj)
        {
            InitializeComponent();
            this.Text = "ORDER DETAIL";
            ord       = obj;
            bool x = new OrderControllers().GetOrderBodyRefinvoice(obj);

            if (x)
            {
                DialogResult r = XtraMessageBox.Show("พบรายการออร์เดอร์ที่ไม่ตรงกัน\nคุณต้องการที่จะสร้าง JobList ก่อนใหม่", "XPW Alert!", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                if (r == DialogResult.Yes)
                {
                    if (CreateJobList())
                    {
                        OrderJobListPreviewForm frm = new OrderJobListPreviewForm(ord);
                        frm.ShowDialog();
                    }
                }
            }
            ReloadData();
        }