Exemplo n.º 1
0
        public override void FillTheTable(AmbleClient.RfqGui.RfqManager.Rfq rfq)
        {
            base.FillTheTable(rfq);

               this.tbCustomer.Text = string.Empty;
               this.tbContact.Text = string.Empty;
               this.tbPhone.Text = string.Empty;

               AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
               cbSales.Items.Add(accountMgr.GetNameById(rfq.salesId));
               cbSales.SelectedIndex = 0;

              if (rfq.firstPA != null)
               {
               cbPrimaryPA.Items.Add(accountMgr.GetNameById(rfq.firstPA.Value));
               cbPrimaryPA.SelectedIndex = 0;

               }
               if (rfq.secondPA != null)
               {
               cbAltPA.Items.Add(accountMgr.GetNameById(rfq.secondPA.Value));
              cbAltPA.SelectedIndex = 0;

               }
        }
Exemplo n.º 2
0
        public override void FillTheTable(AmbleClient.RfqGui.RfqManager.Rfq rfq)
        {
            base.FillTheTable(rfq);


            this.tbCustomer.Text = string.Empty;
            this.tbContact.Text  = string.Empty;
            this.tbPhone.Text    = string.Empty;

            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
            cbSales.Items.Add(accountMgr.GetNameById(rfq.salesId));
            cbSales.SelectedIndex = 0;


            if (rfq.firstPA != null)
            {
                cbPrimaryPA.Items.Add(accountMgr.GetNameById(rfq.firstPA.Value));
                cbPrimaryPA.SelectedIndex = 0;
            }
            if (rfq.secondPA != null)
            {
                cbAltPA.Items.Add(accountMgr.GetNameById(rfq.secondPA.Value));
                cbAltPA.SelectedIndex = 0;
            }
        }
Exemplo n.º 3
0
        public override void FillTheTable(Rfq rfq)
        {
            base.FillTheTable(rfq);

               //Fill the salesId
               tbCustomer.Text = rfq.customerName;
               //select the sales ID
               //获得下级号和名字
               AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
               mySubs = accountMgr.GetAllSubsId(UserInfo.UserId,UserCombine.GetUserCanBeSales());

               Dictionary<int, string> mySubsIdAndName = accountMgr.GetIdsAndNames(mySubs);
               foreach (string name in mySubsIdAndName.Values)
               {
               cbSales.Items.Add(name);

               }
               for (int i = 0; i < mySubs.Count; i++)
               {
               if (mySubs[i] == rfq.salesId)
               {
                   cbSales.SelectedIndex = i;
                   break;

               }

               }

              List<int> pAList=new List<int>();
               //Fill the PA
              if (rfq.firstPA.HasValue)
              pAList.Add(rfq.firstPA.Value);
              if (rfq.secondPA.HasValue)
              pAList.Add(rfq.secondPA.Value);

              if (pAList.Count > 0)
              {
              Dictionary<int, string> paIDAndName = accountMgr.GetIdsAndNames(pAList);

              if (rfq.firstPA.HasValue&&rfq.secondPA.HasValue)
              {
                  cbPrimaryPA.Text = paIDAndName[rfq.firstPA.Value];
                  cbAltPA.Text = paIDAndName[rfq.secondPA.Value];
              }
              else if (rfq.firstPA.HasValue)
              {
                  cbPrimaryPA.Text = paIDAndName[rfq.firstPA.Value];
              }
              else if(rfq.secondPA.HasValue)
              {
                 cbAltPA.Text = paIDAndName[rfq.secondPA.Value];
              }
              else
              {
                  //error
              }

              }
        }
Exemplo n.º 4
0
        private void FillThePACombo()
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
            mysubs = accountMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeBuyers());

            buyerIdsAndNames = accountMgr.GetIdsAndNames(mysubs);

            foreach (string buyerName in buyerIdsAndNames.Values)
            {
                cbPa.Items.Add(buyerName);
            }
        }
Exemplo n.º 5
0
        private void FillTheSalesComboBox()
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accMgr = new Admin.AccountMgr.AccountMgr();

            mySubs = accMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeSales());

            Dictionary <int, string> mySubsIdAndName = accMgr.GetIdsAndNames(mySubs);

            foreach (string name in mySubsIdAndName.Values)
            {
                cbSp.Items.Add(name);
            }
        }
Exemplo n.º 6
0
        public void NewRfqFill()
        {
            this.tbCustomer.Leave += new System.EventHandler(this.tbCustomer_Leave);


            cbCloseReason.Enabled = false;
            tbRfqDate.ReadOnly    = true; tbRfqDate.Enabled = false;
            //clear all the necessary textbox

            tbCustomer.Clear();
            //customer auto complete
            CustomerAutoComplete();
            tbProject.Clear();
            tbContact.Clear();
            tbPhone.Clear();
            tbFax.Clear();
            tbEmail.Clear();
            cbPriority.SelectedIndex = -1;
            cbRohs.Checked           = false;
            tbPartNo.Clear();
            tbMfg.Clear();
            tbDc.Clear();
            tbCustPartNo.Clear();
            tbGenPartNo.Clear();
            tbAlt.Clear();
            tbQuantity.Clear();
            tbPartNo.Clear();
            tbTargetPrice.Clear();
            tbResale.Clear();
            tbCost.Clear();
            cbPrimaryPA.Text            = "";
            cbAltPA.Text                = "";
            cbCloseReason.SelectedIndex = -1;
            tbToCustomer.Clear();
            tbToInternal.Clear();
            tbRoutingHistory.Clear();


            //Fill the cbSale;
            //获得下级号和名字
            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
            mySubs = accountMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeSales());

            Dictionary <int, string> mySubsIdAndName = accountMgr.GetIdsAndNames(mySubs);

            foreach (string name in mySubsIdAndName.Values)
            {
                cbSales.Items.Add(name);
            }
            cbSales.SelectedIndex = 0;
        }
Exemplo n.º 7
0
        public void NewRfqFill()
        {
            this.tbCustomer.Leave += new System.EventHandler(this.tbCustomer_Leave);

            cbCloseReason.Enabled = false;
            tbRfqDate.ReadOnly = true; tbRfqDate.Enabled = false;
            //clear all the necessary textbox

            tbCustomer.Clear();
            //customer auto complete
            CustomerAutoComplete();
            tbProject.Clear();
            tbContact.Clear();
            tbPhone.Clear();
            tbFax.Clear();
            tbEmail.Clear();
            cbPriority.SelectedIndex = -1;
            cbRohs.Checked = false;
            tbPartNo.Clear();
            tbMfg.Clear();
            tbDc.Clear();
            tbCustPartNo.Clear();
            tbGenPartNo.Clear();
            tbAlt.Clear();
            tbQuantity.Clear();
            tbPartNo.Clear();
            tbTargetPrice.Clear();
            tbResale.Clear();
            tbCost.Clear();
            cbPrimaryPA.Text = "";
            cbAltPA.Text = "";
            cbCloseReason.SelectedIndex = -1;
            tbToCustomer.Clear();
            tbToInternal.Clear();
            tbRoutingHistory.Clear();

            //Fill the cbSale;
            //获得下级号和名字
            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
              mySubs = accountMgr.GetAllSubsId(UserInfo.UserId,UserCombine.GetUserCanBeSales());

              Dictionary<int, string> mySubsIdAndName = accountMgr.GetIdsAndNames(mySubs);
              foreach (string name in mySubsIdAndName.Values)
              {
              cbSales.Items.Add(name);

              }
              cbSales.SelectedIndex = 0;
        }
Exemplo n.º 8
0
        static void FillTheSoSheet(ISheet sheet, So so, List <SoItemsContentAndState> soitemList)
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accMgr = new Admin.AccountMgr.AccountMgr();
            sheet.GetRow(0).CreateCell(2).SetCellValue(so.customerName);
            sheet.GetRow(0).CreateCell(6).SetCellValue(so.contact);
            sheet.GetRow(0).CreateCell(9).SetCellValue(accMgr.GetNameById(so.salesId));

            if (so.approverId != null)
            {
                sheet.GetRow(0).CreateCell(14).SetCellValue(accMgr.GetNameById(so.approverId.Value) + "," + so.approveDate.Value.ToShortDateString());
            }
            sheet.GetRow(1).CreateCell(2).SetCellValue(so.salesOrderNo);
            sheet.GetRow(1).CreateCell(6).SetCellValue(so.orderDate.ToShortDateString());

            sheet.GetRow(1).CreateCell(9).SetCellValue(so.customerPo);
            sheet.GetRow(1).CreateCell(14).SetCellValue(so.paymentTerm);

            sheet.GetRow(2).CreateCell(2).SetCellValue(so.freightTerm);
            sheet.GetRow(2).CreateCell(6).SetCellValue(so.customerAccount);
            sheet.GetRow(2).CreateCell(9).SetCellValue(so.specialInstructions);

            IRow row = sheet.CreateRow(4);

            row.CreateCell(0).SetCellValue(so.billTo);
            row.CreateCell(8).SetCellValue(so.shipTo);

            int itemRowIndex = 9;

            foreach (SoItemsContentAndState scs in soitemList)
            {
                IRow itemRow = sheet.CreateRow(itemRowIndex);
                itemRow.CreateCell(0).SetCellValue(soitemList.IndexOf(scs) + 1);
                string strSaleType;
                switch (scs.soitem.saleType)
                {
                case 0:

                    strSaleType = "OEM EXCESS";
                    break;

                case 1:
                    strSaleType = "OWN STOCK";
                    break;

                case 2:
                    strSaleType = "OTHERS";
                    break;

                default:
                    strSaleType = "ERROR";
                    break;
                }

                itemRow.CreateCell(1).SetCellValue(strSaleType);
                itemRow.CreateCell(2).SetCellValue(scs.soitem.partNo);
                itemRow.CreateCell(3).SetCellValue(scs.soitem.mfg);
                itemRow.CreateCell(4).SetCellValue(scs.soitem.rohs == 1 ? "Y" : "N");
                itemRow.CreateCell(5).SetCellValue(scs.soitem.dc);
                itemRow.CreateCell(6).SetCellValue(scs.soitem.intPartNo);
                itemRow.CreateCell(7).SetCellValue(scs.soitem.shipFrom);
                itemRow.CreateCell(8).SetCellValue(scs.soitem.shipMethod);
                itemRow.CreateCell(9).SetCellValue(scs.soitem.trackingNo);
                itemRow.CreateCell(10).SetCellValue(scs.soitem.qty);
                itemRow.CreateCell(11).SetCellValue(scs.soitem.qtyshipped);
                itemRow.CreateCell(12).SetCellValue(Enum.GetName(typeof(AmbleClient.Currency), scs.soitem.currencyType));
                itemRow.CreateCell(13).SetCellValue(scs.soitem.unitPrice);
                itemRow.CreateCell(14).SetCellValue(scs.soitem.unitPrice * scs.soitem.qty);
                itemRow.CreateCell(15).SetCellValue(scs.soitem.dockDate.ToShortDateString());

                if (scs.soitem.shippedDate != null)
                {
                    itemRow.CreateCell(16).SetCellValue(scs.soitem.shippedDate.Value.ToShortDateString());
                }
                itemRowIndex++;

                IRow infoRow = sheet.CreateRow(itemRowIndex);
                infoRow.CreateCell(1).SetCellValue("Shipping Instructions >>" + scs.soitem.shippingInstruction);
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 1, 16));


                itemRowIndex++;
                infoRow = sheet.CreateRow(itemRowIndex);
                infoRow.CreateCell(1).SetCellValue("Packing Instructions >>" + scs.soitem.packingInstruction);
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 1, 16));
                itemRowIndex++;
            }
        }
Exemplo n.º 9
0
        static void FillThePoSheet(ISheet sheet, po po, List <PoItemContentAndState> poitemList)
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accMgr = new Admin.AccountMgr.AccountMgr();

            sheet.GetRow(0).CreateCell(2).SetCellValue(po.vendorName);
            sheet.GetRow(0).CreateCell(9).SetCellValue(po.contact);
            if (po.pa != null)
            {
                sheet.GetRow(0).CreateCell(14).SetCellValue(accMgr.GetNameById((int)po.pa.Value));
            }
            sheet.GetRow(1).CreateCell(2).SetCellValue(po.vendorNumber);

            if (po.poDate != null)
            {
                sheet.GetRow(1).CreateCell(5).SetCellValue(po.poDate.Value.ToShortDateString());
            }
            sheet.GetRow(1).CreateCell(9).SetCellValue(po.poNo);
            sheet.GetRow(1).CreateCell(14).SetCellValue(po.paymentTerms);

            sheet.GetRow(2).CreateCell(2).SetCellValue(po.shipMethod);
            sheet.GetRow(2).CreateCell(9).SetCellValue(po.freight);
            sheet.GetRow(2).CreateCell(14).SetCellValue(po.shipToLocation);

            IRow row = sheet.CreateRow(4);

            row.CreateCell(0).SetCellValue(po.billTo);
            row.CreateCell(10).SetCellValue(po.shipTo);

            int itemRowIndex = 9; int totalQty = 0; float totalTotal = 0; int totalQtyRecd = 0;

            foreach (PoItemContentAndState pcs in poitemList)
            {
                IRow itemRow = sheet.CreateRow(itemRowIndex);
                itemRow.CreateCell(0).SetCellValue(poitemList.IndexOf(pcs) + 1);
                itemRow.CreateCell(1).SetCellValue(pcs.poItem.partNo);
                itemRow.CreateCell(2).SetCellValue(pcs.poItem.mfg);
                itemRow.CreateCell(3).SetCellValue(pcs.poItem.dc);
                itemRow.CreateCell(4).SetCellValue(pcs.poItem.vendorIntPartNo);
                itemRow.CreateCell(5).SetCellValue(pcs.poItem.org);
                itemRow.CreateCell(6).SetCellValue(pcs.poItem.qty.Value);
                totalQty += pcs.poItem.qty.Value;

                if (pcs.poItem.qtyRecd != null)
                {
                    itemRow.CreateCell(7).SetCellValue(pcs.poItem.qtyRecd.Value);
                    totalQtyRecd += pcs.poItem.qtyRecd.Value;
                }
                if (pcs.poItem.qtyCorrected != null)
                {
                    itemRow.CreateCell(8).SetCellValue(pcs.poItem.qtyCorrected.Value);
                }

                if (pcs.poItem.qtyAccept != null)
                {
                    itemRow.CreateCell(9).SetCellValue(pcs.poItem.qtyAccept.Value);
                }

                if (pcs.poItem.qtyRejected != null)
                {
                    itemRow.CreateCell(10).SetCellValue(pcs.poItem.qtyRejected.Value);
                }

                if (pcs.poItem.qtyRTV != null)
                {
                    itemRow.CreateCell(11).SetCellValue(pcs.poItem.qtyRTV.Value);
                }

                if (pcs.poItem.qcPending != null)
                {
                    itemRow.CreateCell(12).SetCellValue(pcs.poItem.qcPending.Value);
                }

                itemRow.CreateCell(13).SetCellValue(Enum.GetName(typeof(AmbleClient.Currency), pcs.poItem.currency));
                itemRow.CreateCell(14).SetCellValue(pcs.poItem.unitPrice.Value);
                itemRow.CreateCell(15).SetCellValue(pcs.poItem.qty.Value * pcs.poItem.unitPrice.Value);
                totalTotal += pcs.poItem.qty.Value * pcs.poItem.unitPrice.Value;



                if (pcs.poItem.dueDate != null)
                {
                    itemRow.CreateCell(16).SetCellValue(pcs.poItem.dueDate.Value.ToShortDateString());
                }

                if (pcs.poItem.receiveDate != null)
                {
                    itemRow.CreateCell(17).SetCellValue(pcs.poItem.receiveDate.Value.ToShortDateString());
                }

                itemRow.CreateCell(18).SetCellValue(pcs.poItem.stepCode);
                itemRow.CreateCell(19).SetCellValue("Unknown");

                itemRowIndex++;

                IRow infoRow = sheet.CreateRow(itemRowIndex);
                infoRow.CreateCell(1).SetCellValue("Note To Vendor >>" + pcs.poItem.noteToVendor);
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 1, 16));

                itemRowIndex++;
            }
            //add total bar
            IRow totalRow = sheet.CreateRow(itemRowIndex);

            sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 0, 4));
            totalRow.CreateCell(5).SetCellValue("Total");
            totalRow.CreateCell(6).SetCellValue(totalQty);
            totalRow.CreateCell(7).SetCellValue(totalQtyRecd);
            totalRow.CreateCell(15).SetCellValue(totalTotal);
        }
Exemplo n.º 10
0
        public override void FillTheTable(Rfq rfq)
        {
            base.FillTheTable(rfq);

            //Fill the salesId
            tbCustomer.Text = rfq.customerName;
            //select the sales ID
            //获得下级号和名字
            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
            mySubs = accountMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeSales());

            Dictionary <int, string> mySubsIdAndName = accountMgr.GetIdsAndNames(mySubs);

            foreach (string name in mySubsIdAndName.Values)
            {
                cbSales.Items.Add(name);
            }
            for (int i = 0; i < mySubs.Count; i++)
            {
                if (mySubs[i] == rfq.salesId)
                {
                    cbSales.SelectedIndex = i;
                    break;
                }
            }

            List <int> pAList = new List <int>();

            //Fill the PA
            if (rfq.firstPA.HasValue)
            {
                pAList.Add(rfq.firstPA.Value);
            }
            if (rfq.secondPA.HasValue)
            {
                pAList.Add(rfq.secondPA.Value);
            }

            if (pAList.Count > 0)
            {
                Dictionary <int, string> paIDAndName = accountMgr.GetIdsAndNames(pAList);

                if (rfq.firstPA.HasValue && rfq.secondPA.HasValue)
                {
                    cbPrimaryPA.Text = paIDAndName[rfq.firstPA.Value];
                    cbAltPA.Text     = paIDAndName[rfq.secondPA.Value];
                }
                else if (rfq.firstPA.HasValue)
                {
                    cbPrimaryPA.Text = paIDAndName[rfq.firstPA.Value];
                }
                else if (rfq.secondPA.HasValue)
                {
                    cbAltPA.Text = paIDAndName[rfq.secondPA.Value];
                }
                else
                {
                    //error
                }
            }
        }
Exemplo n.º 11
0
        public override void FillTheTable(AmbleClient.RfqGui.RfqManager.Rfq rfq)
        {
            base.FillTheTable(rfq);
            tbCustomer.Text = rfq.customerName;

            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();

            this.tbContact.Text = string.Empty; //can not be seen by sales Manager
            this.tbPhone.Text   = string.Empty; //can not be seen by sales Manager.


            //Fill the sales
            List <int> sales = new List <int>();

            sales.Add(rfq.salesId);

            cbSales.Items.Add(accountMgr.GetIdsAndNames(sales)[rfq.salesId]);
            cbSales.SelectedIndex = 0;
            // cbSales.Text = (GlobalRemotingClient.GetAccountMgr().GetIdsAndNames(sales))[rfq.salesId];

            //Fill the PA
            mySubs = accountMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeBuyers());
            Dictionary <int, string> mySubsIdAndName = accountMgr.GetIdsAndNames(mySubs);

            //确认里面的buyer是不是我的下属,如果不是,不能更改。
            if (rfq.firstPA.HasValue == false || mySubs.Contains(rfq.firstPA.Value))
            {
                foreach (string name in mySubsIdAndName.Values)
                {
                    cbPrimaryPA.Items.Add(name);
                }
                if (rfq.firstPA.HasValue == false)
                {
                    cbPrimaryPA.SelectedIndex = -1;
                }
                else
                {
                    cbPrimaryPA.SelectedIndex = mySubs.IndexOf(rfq.firstPA.Value);
                }
            }
            else
            {
                List <int> buyer = new List <int>();
                buyer.Add(rfq.firstPA.Value);
                cbPrimaryPA.Items.Add(accountMgr.GetIdsAndNames(buyer)[rfq.firstPA.Value]);
                cbPrimaryPA.SelectedIndex = 0;
            }
            if (rfq.secondPA.HasValue == false || mySubs.Contains(rfq.secondPA.Value))
            {
                foreach (string name in mySubsIdAndName.Values)
                {
                    cbAltPA.Items.Add(name);
                }

                if (rfq.secondPA.HasValue == false)
                {
                    cbAltPA.SelectedIndex = -1;
                }
                else
                {
                    cbAltPA.SelectedIndex = mySubs.IndexOf(rfq.secondPA.Value);
                }
            }
            else
            {
                List <int> buyer = new List <int>();
                buyer.Add(rfq.secondPA.Value);
                cbAltPA.Items.Add(accountMgr.GetIdsAndNames(buyer)[rfq.secondPA.Value]);
                cbAltPA.SelectedIndex = 0;
            }
        }
Exemplo n.º 12
0
 private void FillTheIdNameDict()
 {
     AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
     idNameDict =accountMgr.GetIdsAndNames(accountMgr.GetAllSubsId(UserInfo.UserId,null));
 }
Exemplo n.º 13
0
 private void FillTheIdNameDict()
 {
     AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
     idNameDict = accountMgr.GetIdsAndNames(accountMgr.GetAllSubsId(UserInfo.UserId, null));
 }
Exemplo n.º 14
0
        private void FillThePACombo()
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
            mysubs = accountMgr.GetAllSubsId(UserInfo.UserId, UserCombine.GetUserCanBeBuyers());

            buyerIdsAndNames=accountMgr.GetIdsAndNames(mysubs);

            foreach (string buyerName in buyerIdsAndNames.Values)
            {
                cbPa.Items.Add(buyerName);

            }
        }
Exemplo n.º 15
0
        private void FillTheSalesComboBox()
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accMgr = new Admin.AccountMgr.AccountMgr();

            mySubs =accMgr.GetAllSubsId(UserInfo.UserId,UserCombine.GetUserCanBeSales());

            Dictionary<int, string> mySubsIdAndName = accMgr.GetIdsAndNames(mySubs);
            foreach (string name in mySubsIdAndName.Values)
            {
                cbSp.Items.Add(name);
            }
        }