예제 #1
0
        public void FillItems(SoItems soItem)
        {
            cbSaleType.SelectedIndex = soItem.saleType;
            tbPartNo.Text = soItem.partNo;
            tbMfg.Text = soItem.mfg;
            cbRohs.Checked =( soItem.rohs == 1 ? true : false);
            tbDc.Text = soItem.dc;
            tbIntPartNo.Text = soItem.intPartNo;
            tbShipFrom.Text = soItem.shipFrom;
            tbShipMethod.Text = soItem.shipMethod;
            tbTrackingNo.Text = soItem.trackingNo;
            tbQty.Text = soItem.qty.ToString();
            tbQtyShipped.Text=soItem.qtyshipped.ToString();
            cbCurrency.SelectedIndex = soItem.currencyType;
            tbUnitPrice.Text = soItem.unitPrice.ToString();
            dateTimePicker1.Value = soItem.dockDate;

            if (soItem.shippedDate == null)
            {
                dateTimePicker2.Checked = false;
            }
            else
            {
                dateTimePicker2.Value = soItem.shippedDate.Value;
            }
            tbShipInst.Text = soItem.shippingInstruction;
            tbPackingInst.Text = soItem.packingInstruction;
        }
예제 #2
0
        public void FillTheTable(SoItems item)
        {
            this.soItem = item;
            this.soItemsControl1.FillItems(item);
            SetComboxItem();

            if (!isNewCreateSo)
            {
                if (soItemOrderStateList.GetSoStateAccordingToValue(item.soItemState).WhoCanUpdate().Contains(UserInfo.Job))
                {
                    this.tsbOp.Enabled = true;
                }
                else
                {
                    this.tsbOp.Enabled = false;
                }

                if (UserCombine.GetUserCanBeBuyers().Contains((int)UserInfo.Job))
                {
                    if(soItem.soItemState==new SoItemNew().GetStateValue())
                    {
                     this.tsbGeneratePo.Enabled=false;
                    }
                    else
                    {
                    this.tsbGeneratePo.Enabled = true;
                    }
                }
                else
                {
                    this.tsbGeneratePo.Enabled = false;
                }

            }
        }
예제 #3
0
파일: SoMgr.cs 프로젝트: hongbao66/ERP
 public static string GetSaveNewSoItemString(SoItems soItem)
 {
     string strsql = "insert into SoItems(soId,saleType,partNo,mfg,rohs,dc,intPartNo,shipFrom,shipMethod,trackingNo,qty,qtyShipped,currency,unitPrice,dockDate,shippedDate,shippingInstruction,packingInstruction) " +
     string.Format(" values({0},{1},'{2}','{3}',{4},'{5}','{6}','{7}','{8}','{9}',{10},{11},{12},{13},'{14}','{15}','{16}','{17}')", soItem.soId, soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc,
     soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped, soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? soItem.shippedDate.Value.ToShortDateString() : "null",
     soItem.shippingInstruction, soItem.packingInstruction);
        return strsql;
 }
예제 #4
0
        public static string GetSaveNewSoItemString(SoItems soItem)
        {
            string strsql = "insert into SoItems(soId,saleType,partNo,mfg,rohs,dc,intPartNo,shipFrom,shipMethod,trackingNo,qty,qtyShipped,currency,unitPrice,dockDate,shippedDate,shippingInstruction,packingInstruction) " +
                            string.Format(" values({0},{1},'{2}','{3}',{4},'{5}','{6}','{7}','{8}','{9}',{10},{11},{12},{13},'{14}','{15}','{16}','{17}')", soItem.soId, soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc,
                                          soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped, soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? soItem.shippedDate.Value.ToShortDateString() : "null",
                                          soItem.shippingInstruction, soItem.packingInstruction);

            return(strsql);
        }
예제 #5
0
파일: SoMgr.cs 프로젝트: hnjm/AmbleSystem
        public static void SaveSoItems(int soId, SoItems soItem)
        {
            string strsql = "insert into SoItems(soId,rfqId,saleType,partNo,mfg,rohs,dc,intPartNo,shipFrom,shipMethod,trackingNo,qty,qtyShipped,currency,unitPrice,dockDate,shippedDate,shippingInstruction,packingInstruction,soItemState) " +
                            string.Format(" values({0},{1},{2},'{3}','{4}',{5},'{6}','{7}','{8}','{9}','{10}',{11},{12},{13},{14},'{15}',{16},'{17}','{18}',{19})", soId, soItem.rfqId, soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc,
                                          soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped.HasValue ? soItem.qtyshipped.Value.ToString() : "null", soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? ("'" + soItem.shippedDate.Value.ToShortDateString() + "'") : "null",
                                          soItem.shippingInstruction, soItem.packingInstruction, 0);

            db.ExecDataBySql(strsql);
        }
예제 #6
0
파일: SoMgr.cs 프로젝트: phox/AmbleSystem
 public static void UpdateSoItems(SoItems soItem)
 {
     string strSql = GetUpdateSoItemString(soItem);
        db.ExecDataBySql(strSql);
 }
예제 #7
0
파일: SoMgr.cs 프로젝트: phox/AmbleSystem
        public static void SaveSoItems(int soId, SoItems soItem)
        {
            string strsql = "insert into SoItems(soId,rfqId,saleType,partNo,mfg,rohs,dc,intPartNo,shipFrom,shipMethod,trackingNo,qty,qtyShipped,currency,unitPrice,dockDate,shippedDate,shippingInstruction,packingInstruction,soItemState) " +
            string.Format(" values({0},{1},{2},'{3}','{4}',{5},'{6}','{7}','{8}','{9}','{10}',{11},{12},{13},{14},'{15}',{16},'{17}','{18}',{19})", soId, soItem.rfqId, soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc,
            soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped.HasValue ? soItem.qtyshipped.Value.ToString() : "null", soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? ("'" + soItem.shippedDate.Value.ToShortDateString() + "'") : "null",
            soItem.shippingInstruction, soItem.packingInstruction, 0);

            db.ExecDataBySql(strsql);
        }
예제 #8
0
파일: SoMgr.cs 프로젝트: phox/AmbleSystem
 public static string GetUpdateSoItemString(SoItems soItem)
 {
     return string.Format("update SoItems set saleType={0},partNo='{1}',mfg='{2}',rohs={3},dc='{4}',intPartNo='{5}',shipFrom='{6}',shipMethod='{7}',trackingNo='{8}',qty={9},qtyShipped={10},currency={11},unitPrice={12},dockDate='{13}',shippedDate={14},shippingInstruction='{15}',packingInstruction='{16}' where soItemsId={17} ",
        soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc, soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped.HasValue ? soItem.qtyshipped.Value.ToString() : "null", soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? ("'" + soItem.shippedDate.Value.ToShortDateString() + "'") : "null",
     soItem.shippingInstruction, soItem.packingInstruction,soItem.soItemsId);
 }
예제 #9
0
 public static string GetUpDateSoItemString(SoItems soItem)
 {
     return(string.Format("update SoItems set saleType={0},partNo='{1}',mfg='{2}',rohs={3},dc='{4}',intPartNo='{5}',shipFrom='{6}',shipMethod='{7}',trackingNo='{8}',qty={9},qtyShipped={10},currency={11},unitPrice={12},dockDate='{13}',shippedDate='{14}',shippingInstruction='{15}',packingInstruction='{16}' where soItemsId={17} ",
                          soItem.saleType, soItem.partNo, soItem.mfg, soItem.rohs, soItem.dc, soItem.intPartNo, soItem.shipFrom, soItem.shipMethod, soItem.trackingNo, soItem.qty, soItem.qtyshipped, soItem.currencyType, soItem.unitPrice, soItem.dockDate.ToShortDateString(), soItem.shippedDate.HasValue ? soItem.shippedDate.Value.ToShortDateString() : "null",
                          soItem.shippingInstruction, soItem.packingInstruction, soItem.soItemsId));
 }
예제 #10
0
파일: SoItemView.cs 프로젝트: hongbao66/ERP
 public void FillTheTable(SoItems item)
 {
     this.soItemsControl1.FillItems(item);
 }
예제 #11
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            NewAddItem nai=new NewAddItem(true);

            if (DialogResult.Yes == nai.ShowDialog())
            {

                Rfq rfq = RfqGui.RfqManager.RfqMgr.GetRfqAccordingToRfqId(nai.rfqId);

                SoItems soItem = new SoItems();
                soItem.currencyType = (int)AmbleClient.Currency.USD;
                soItem.unitPrice = rfq.targetPrice ?? 0;
                soItem.mfg = rfq.mfg;
                soItem.partNo = rfq.partNo;
                soItem.rohs = rfq.rohs;
                soItem.qty = rfq.qty ?? 0;
                soItem.intPartNo = rfq.custPartNo;
                soItem.dc = rfq.dc;
                soItem.dockDate = rfq.dockdate;
                soItem.rfqId = nai.rfqId;

                if (isNewCreateSo)
                {
                    soItemsStateList.Add(new SoItemsContentAndState
                    {
                        soitem = soItem,
                        state = OrderItemsState.New
                    }
                   );
                }
                else
                {
                    SoMgr.SaveSoItems(this.soId, soItem);
                    GetSoItems();

                }
                ShowDataInDataGridView();
                this.HasItemChange = true;

            }
        }
예제 #12
0
        public void NewSOFill()
        {
            FillTheSalesComboBox();
            cbSp.SelectedIndex = 0;
            this.isNewCreateSo = true;

            foreach (int id in rfqList)
            {
                Rfq rfq = RfqGui.RfqManager.RfqMgr.GetRfqAccordingToRfqId(id);
                SoItems soItem = new SoItems();
                soItem.currencyType =(int) AmbleClient.Currency.USD;
                soItem.unitPrice = rfq.targetPrice ?? 0;
                soItem.mfg = rfq.mfg;
                soItem.partNo = rfq.partNo;
                soItem.rohs = rfq.rohs;
                soItem.qty = rfq.qty ?? 0;
                soItem.intPartNo = rfq.custPartNo;
                soItem.dc = rfq.dc;
                soItem.dockDate = rfq.dockdate;
                soItem.rfqId = id;
                soItem.soItemState = new SoItemNew().GetStateValue();

               this.soItemsStateList.Add(
               new SoItemsContentAndState
               {
                   soitem=soItem,
                   state = OrderItemsState.New
               }
               );

            }

            ShowDataInDataGridView();
        }
예제 #13
0
파일: SoMgr.cs 프로젝트: hnjm/AmbleSystem
        public static void UpdateSoItems(SoItems soItem)
        {
            string strSql = GetUpdateSoItemString(soItem);

            db.ExecDataBySql(strSql);
        }