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(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.º 3
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.º 4
0
 private void FillTheIdNameDict()
 {
     AmbleClient.Admin.AccountMgr.AccountMgr accountMgr = new Admin.AccountMgr.AccountMgr();
     idNameDict =accountMgr.GetIdsAndNames(accountMgr.GetAllSubsId(UserInfo.UserId,null));
 }
Exemplo n.º 5
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.º 6
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);
            }
        }