예제 #1
0
        void Reload()
        {
            npl.Clear();
            gridPartControl.DataSource          = null;
            gridPalletControl.DataSource        = null;
            gridPalleteDetailControl.DataSource = null;
            List <SetPallatData> list = new SetPalletControllers().GetPartListDetail(inv);
            List <SetPallatData> ord  = new List <SetPallatData>();

            if (list.Count > 0)
            {
                var r = list[0];
                bbiFactory.EditValue  = r.Factory;
                bbiShip.EditValue     = r.ShipType;
                bbiZone.EditValue     = r.ZName;
                bbiEtd.EditValue      = r.EtdDte;
                bbiAff.EditValue      = r.AffCode;
                bbiCustCode.EditValue = r.CustCode;
                bbiCustName.EditValue = r.CustName;
                bbiOrderBy.EditValue  = r.CombInv;
                bbiRefInv.EditValue   = r.RefNo;
                bbiInv.EditValue      = r.RefInv;
                list.ForEach(i => {
                    if (i.Ctn > 0)
                    {
                        ord.Add(i);
                    }
                });
            }
            gridPartControl.DataSource = ord;
            bsiRecordsCount.Caption    = "RECORDS : " + ord.Count;
            npl = new SetPalletControllers().GetPartListCompletedDetail(inv);
            gridPalletControl.DataSource = npl;
        }
예제 #2
0
        internal void InitData(string refinv)
        {
            List <SetPalletListData> obj = new SetPalletControllers().GetJobListPallet(refinv);

            if (obj.Count > 0)
            {
                int x = 0;
                obj.ForEach(i => {
                    x += i.ITem;
                });
                prAffCode.Value    = obj[0].AffCode;
                prInvoiceNo.Value  = obj[0].RefInv;
                prRefNo.Value      = obj[0].RefNo;
                prQrCode.Value     = obj[0].RefNo;
                prCustCode.Value   = obj[0].CustCode;
                prCountry.Value    = obj[0].CustName;
                prShipType.Value   = obj[0].ShipType;
                prFactory.Value    = obj[0].Factory;
                prGroupOrder.Value = obj[0].CombInv;
                pPartName.Value    = "PARTNO";
                if (obj[0].Factory != "INJ")
                {
                    pPartName.Value = "PARTNAME";
                }

                prContainerType.Value = obj[0].ContainerType;
                prDesinations.Value   = "";
                prEtdDate.Value       = obj[0].EtdDte;
                prQty.Value           = x;
                prPrintDate.Value     = DateTime.Now;
            }
            objectDataSource1.DataSource = obj;
        }
예제 #3
0
        private void bbiSetCarton_ItemClick(object sender, ItemClickEventArgs e)
        {
            SetPallatData obj = gridPartView.GetFocusedRow() as SetPallatData;

            if (obj.Factory == "AW")
            {
                DialogResult r = XtraMessageBox.Show($"คุณต้องการที่จะ Set Carton({obj.PName}) นี้ใช่หรือไม่?", "ข้อความแจ้งเตือน", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (r == DialogResult.Yes)
                {
                    List <SetPallatData> list = gridPartControl.DataSource as List <SetPallatData>;
                    string plno = new SetPalletControllers().GetLastCarton(list[0]);
                    int    x    = 0;
                    while (x < list.Count)
                    {
                        if (list[x].CtnQty > 0)
                        {
                            if (ReloadCartonSet(list[x], plno))
                            {
                                InsertPalletToPackingDetailAll(list[x], plno);
                            }
                        }
                        x++;
                    }
                }
                Reload();
            }
            else
            {
                if (obj.CtnQty <= 0)
                {
                    DialogResult r = XtraMessageBox.Show($"คุณต้องการที่จะ Set Carton({obj.PName}) นี้ใช่หรือไม่?", "ข้อความแจ้งเตือน", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (r == DialogResult.Yes)
                    {
                        obj.CtnQty += 1;
                        int x = obj.Ctn -= 1;
                        if (obj.CtnQty > 0)
                        {
                            string plno = new SetPalletControllers().GetLastCarton(obj.RefNo);

                            if (ReloadCartonSet(obj, plno))
                            {
                                InsertPalletToPackingDetailAll(obj, plno);
                                if (x > 0)
                                {
                                    gridPartView.SetFocusedRowCellValue("Ctn", x);
                                    gridPartView.SetFocusedRowCellValue("CtnQty", 0);
                                }
                                else
                                {
                                    gridPartView.DeleteSelectedRows();
                                }
                                gridPartView.UpdateCurrentRow();
                                gridPartView.UpdateTotalSummary();
                            }
                        }
                    }
                }
            }
        }
예제 #4
0
        public SetPalletAddToForm(SetPallatData obj)
        {
            InitializeComponent();
            ob = obj;
            List <SetPallatData> list = new SetPalletControllers().GetPartListCompletedDetail(ob.RefNo);

            list.ForEach(i => {
                cbPalletObj.Properties.Items.Add(i.ShipPlNo);
            });
        }
예제 #5
0
        string ReloadPlSet(SetPallatData obj, int p)
        {
            if (p > 0)
            {
                obj.PlSize = null;
                string plno = null;
                if (obj.Factory == "INJ")
                {
                    plno       = new SetPalletControllers().GetLastPallet(obj.RefNo);
                    obj.PlSize = new GreeterFunction().GetPlSize(obj.PlSize, p);
                }
                else
                {
                    plno       = new SetPalletControllers().GetLastPallet(obj);
                    obj.PlSize = new GreeterFunction().GetPalletWireSize(p);
                }

                string sql = $"SELECT * FROM TXP_ISSPALLET l WHERE l.ISSUINGKEY = '{obj.RefNo}' AND l.PALLETNO = '{plno}'";
                string w   = "0";
                string ll  = "0";
                string hh  = "0";
                if (obj.PlSize != "MIX")
                {
                    w = obj.PlSize.Substring(0, obj.PlSize.IndexOf("x"));
                    string l = obj.PlSize.Substring(w.Length + 1);
                    ll = obj.PlSize.Substring(w.Length + 1, l.IndexOf("x"));

                    string h = obj.PlSize.Substring(ll.Length + 2);
                    hh = h.Substring(h.IndexOf("x") + 1);
                }

                DataSet dr = new ConnDB().GetFill(sql);
                if (dr.Tables[0].Rows.Count < 1)
                {
                    string ins = $"INSERT INTO TXP_ISSPALLET(FACTORY, ISSUINGKEY, PALLETNO, PLTYPE, PLOUTSTS, UPDDTE, SYSDTE, PLTOTAL, BOOKED,PLWIDE,PLLENG,PLHIGHT)\n" +
                                 $"VALUES('{StaticFunctionData.Factory}', '{obj.RefNo}', '{plno}', '{obj.PlSize}', 0, current_timestamp, current_timestamp, {p}, '0', '{w}', '{ll}' ,'{hh}')";
                    new ConnDB().ExcuteSQL(ins);
                }
                npl.Clear();
                npl = new SetPalletControllers().GetPartListCompletedDetail(inv);
                gridPalletControl.BeginUpdate();
                gridPalletControl.DataSource = npl;
                gridPalletControl.EndUpdate();
                return(plno);
            }
            return(null);
        }
예제 #6
0
        private void bbiDelPartDetail_ItemClick(object sender, ItemClickEventArgs e)
        {
            SetPalletListData obj = gridPalleteDetailView.GetFocusedRow() as SetPalletListData;
            DialogResult      r   = XtraMessageBox.Show($"ยืนยันคำสั่งลบ {obj.FTicket} ข้อมูล", "", MessageBoxButtons.YesNo, MessageBoxIcon.Error);

            if (r == DialogResult.Yes)
            {
                if (new SetPlControllers().UpdateSetPallet(obj))
                {
                    gridPalleteDetailView.DeleteSelectedRows();
                    gridPalleteDetailView.UpdateCurrentRow();
                    gridPalleteDetailView.UpdateTotalSummary();

                    npl = new SetPalletControllers().GetPartListCompletedDetail(inv);
                    gridPalletControl.BeginUpdate();
                    gridPalletControl.DataSource = npl;
                    gridPalletControl.EndUpdate();

                    List <SetPallatData> list = new SetPalletControllers().GetPartListDetail(inv);
                    gridPartControl.DataSource = list;
                }
            }
        }