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