Beispiel #1
0
        public override void FillTheTable(AmbleClient.RfqGui.RfqManager.Rfq rfq)
        {
            base.FillTheTable(rfq);


            this.tbCustomer.Text = string.Empty; this.tbCustomer.ReadOnly = true;
            this.tbContact.Text  = string.Empty; this.tbContact.ReadOnly = true;
            this.tbPhone.Text    = string.Empty; this.tbPhone.ReadOnly = true;
            this.tbFax.Text      = string.Empty; this.tbFax.ReadOnly = true;

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


            if (rfq.firstPA != null)
            {
                cbPrimaryPA.Items.Add(AmbleClient.Admin.AccountMgr.AccountMgr.GetNameById(rfq.firstPA.Value));
                cbPrimaryPA.SelectedIndex = 0;
            }
            if (rfq.secondPA != null)
            {
                cbAltPA.Items.Add(AmbleClient.Admin.AccountMgr.AccountMgr.GetNameById(rfq.secondPA.Value));
                cbAltPA.SelectedIndex = 0;
            }
        }
Beispiel #2
0
        public static void SendOfferRouteEmail(int offerId)
        {
            List <string> emailTos = new List <string>();

            Offer offer = GetOfferByOfferId(offerId);

            AmbleClient.RfqGui.RfqManager.Rfq rfq = AmbleClient.RfqGui.RfqManager.RfqMgr.GetRfqAccordingToRfqId(offer.rfqNo);

            int salesId = rfq.salesId;

            emailTos.Add(AmbleClient.Admin.AccountMgr.AccountMgr.GetEmailAddressById(salesId));

            List <string> ccTos  = new List <string>();
            string        email1 = Admin.AccountMgr.AccountMgr.GetEmailAddressById(UserInfo.UserId);

            if (!emailTos.Contains(email1))
            {
                ccTos.Add(email1);
            }
            string        subject = string.Format("Your RFQ {0} (MPN:{1}) has an Offer.", Tool.Get6DigitalNumberAccordingToId(rfq.rfqNo), rfq.partNo);
            StringBuilder body    = new StringBuilder();

            body.Append("<table border=\"0\">");
            body.Append(string.Format("<tr><td>Offer ID</td><td>{0}</td>", Tool.Get6DigitalNumberAccordingToId(offer.offerId)));
            body.Append(string.Format("<tr><td>MPN</td><td>{0}</td>", offer.mpn));
            body.Append(string.Format("<tr><td>MFG</td><td>{0}</td>", offer.mfg));
            body.Append(string.Format("<tr><td>QTY</td><td>{0}</td>", offer.quantity));
            body.Append(string.Format("<tr><td>LT</td><td>{0}</td>", offer.LT));
            body.Append(string.Format("<tr><td>Price</td><td>{0}</td>", offer.price));
            body.Append("</table>");

            AmbleClient.MailService.MailService.SendMail(emailTos, ccTos, subject, body.ToString());
        }
Beispiel #3
0
        private void btOK_Click(object sender, EventArgs e)
        {
            if (!CheckText())
            {
                return;
            }

            if (isRfq)
            {
                this.rfqId = rfqSoId;
                //check the rfq state
                AmbleClient.RfqGui.RfqManager.Rfq rfq = AmbleClient.RfqGui.RfqManager.RfqMgr.GetRfqAccordingToRfqId(this.rfqId);
                if (rfq == null)
                {
                    MessageBox.Show("The RFQ:" + Tool.Get6DigitalNumberAccordingToId(this.rfqId) + " does not exist!");
                    return;
                }

                if (rfq.rfqStates != (int)AmbleClient.RfqGui.RfqManager.RfqStatesEnum.Quoted)
                {
                    MessageBox.Show("The RFQ State of RFQ:" + Tool.Get6DigitalNumberAccordingToId(this.rfqId) + " is not QUOTED!");
                    return;
                }
            }
            else
            {
                int?soState = AmbleClient.Order.SoMgr.SoMgr.GetSoStateAccordingToSoId(rfqSoId);
                if (soState == null)
                {
                    MessageBox.Show("The SO:" + Tool.Get6DigitalNumberAccordingToId(rfqSoId) + " does not exist!");
                    return;
                }
                if (soState != (int)Order.SoMgr.SoStatesEnum.Approved)
                {
                    MessageBox.Show("The SO State of SO:" + Tool.Get6DigitalNumberAccordingToId(rfqSoId) + " is not APPROVED!");
                    return;
                }
                this.soItemsList = SoMgr.SoMgr.GetSoItemsIdsAccordingToSoId(rfqSoId);
            }
            this.DialogResult = DialogResult.Yes;
            this.Close();
        }
Beispiel #4
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;
            }
        }