Esempio n. 1
0
        private void SendRfqRouteEmail()
        {
            List <string> emailTos = new List <string>();

            emailTos.AddRange(Admin.AccountMgr.AccountMgr.GetEmailsAccordingToJob(JobDescription.Admin));
            emailTos.AddRange(Admin.AccountMgr.AccountMgr.GetEmailsAccordingToJob(JobDescription.Boss));
            string address1 = Admin.AccountMgr.AccountMgr.GetEmailAddressById(UserInfo.UserId);

            if (!emailTos.Contains(address1))
            {
                emailTos.Add(address1);
            }
            string address2 = Admin.AccountMgr.AccountMgr.GetEmailAddressById(Admin.AccountMgr.AccountMgr.GetSuperviserId(UserInfo.UserId));

            if (!emailTos.Contains(address2))
            {
                emailTos.Add(address2);
            }

            string        subject = string.Format("The RFQ {0} (MPN:{1},sales:{2} )has been Routed.", Tool.Get6DigitalNumberAccordingToId(rfq.rfqNo), rfq.partNo, AllAccountInfo.GetNameAccordingToId(rfq.salesId));
            StringBuilder body    = new StringBuilder();

            body.Append("<table border=\"0\">");
            body.Append(string.Format("<tr><td>RFQ ID</td><td>{0}</td>", Tool.Get6DigitalNumberAccordingToId(rfq.rfqNo)));
            body.Append(string.Format("<tr><td>Customer Name</td><td>{0}</td>", rfq.customerName));
            body.Append(string.Format("<tr><td>Contact</td><td>{0}</td>", rfq.contact));
            body.Append(string.Format("<tr><td>MPN</td><td>{0}</td>", rfq.partNo));
            body.Append(string.Format("<tr><td>MFG</td><td>{0}</td>", rfq.mfg));
            body.Append(string.Format("<tr><td>DC</td><td>{0}</td>", rfq.dc));
            body.Append(string.Format("<tr><td>CPN</td><td>{0}</td>", rfq.custPartNo));
            body.Append(string.Format("<tr><td>Sales Name</td><td>{0}</td>", AllAccountInfo.GetNameAccordingToId(rfq.salesId)));
            body.Append("</table>");

            AmbleClient.MailService.MailService.SendMail(emailTos, new List <string>(), subject, body.ToString());
        }
Esempio n. 2
0
        protected override void FillTheDataGrid()
        {
            if (tscbList.SelectedIndex < 0)
            {
                return;
            }

            bool includeSubs = false;

            dataGridView1.Rows.Clear();

            if (tscbList.SelectedIndex == 0)
            {
                includeSubs = true;
            }

            poCombineList = Order.PoMgr.PoMgr.GetPoCombineAccordingToFilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);



            foreach (PoCombine poItem in poCombineList)
            {
                dataGridView1.Rows.Add(poItem.poId, poItem.poItemsId, Tool.Get6DigitalNumberAccordingToId(poItem.poId), poItem.partNo, poItem.mfg, poItem.dc, poItem.qty, poItem.unitPrice, poItem.vendorName, AllAccountInfo.GetNameAccordingToId(poItem.buyerId),
                                       poItem.poDate.ToShortDateString(), AllAccountInfo.GetNameAccordingToId(poItem.salesAgentId), poItemStateList.GetPoStateStringAccordingToValue(poItem.poItemState));
            }
        }
Esempio n. 3
0
 private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
 {
     if (e.ColumnIndex == dataGridView1.Columns.IndexOf(bomOwnerDataGridViewTextBoxColumn))
     {
         e.Value = AllAccountInfo.GetNameAccordingToId(Convert.ToInt32(e.Value));
     }
 }
Esempio n. 4
0
        protected override void FillTheDataGrid()
        {
            if (tscbList.SelectedIndex < 0)
            {
                return;
            }

            bool includeSubs = false;

            dataGridView1.Rows.Clear();

            if (tscbList.SelectedIndex == 0)
            {
                includeSubs = true;
            }
            if (isSaleView)
            {
                offerList = OfferMgr.OfferMgr.SalesGetOfferAccordingToFilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);
            }
            else
            {
                offerList = OfferMgr.OfferMgr.GetOfferAccordingToFilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);
            }
            foreach (Offer offer in offerList)
            {
                dataGridView1.Rows.Add(offer.offerId, Tool.Get6DigitalNumberAccordingToId(offer.rfqNo), offer.mpn, offer.mfg, offer.vendorName, offer.contact, offer.phone, offer.packing,
                                       offer.quantity, offer.price, offer.LT, AllAccountInfo.GetNameAccordingToId(offer.buyerId), offer.offerDate.ToShortDateString(),
                                       Enum.GetName(typeof(OfferState), offer.offerStates));
            }
        }
Esempio n. 5
0
        public static void SaveSoDocx(So so, List <SoItemsContentAndState> soitemsList)
        {
            document = DocX.Load(@"SoDocx.dll");
            Formatting format = new Formatting();

            format.FontFamily = new System.Drawing.FontFamily("Arial");
            format.Size       = 9;
            Table soTable = document.Tables[0];

            soTable.Rows[0].Cells[1].Paragraphs[0].InsertText(so.customerName, false, format);
            soTable.Rows[0].Cells[3].Paragraphs[0].InsertText(Tool.Get6DigitalNumberAccordingToId(so.soId), false, format);
            soTable.Rows[1].Cells[3].Paragraphs[0].InsertText((so.orderDate.Year + "-" + so.orderDate.Month + "-" + so.orderDate.Day).ToString(), false, format);
            soTable.Rows[2].Cells[3].Paragraphs[0].InsertText(so.paymentTerm, false, format);
            soTable.Rows[3].Cells[1].Paragraphs[0].InsertText(so.contact, false, format);
            soTable.Rows[3].Cells[3].Paragraphs[0].InsertText(so.freightTerm, false, format);
            soTable.Rows[4].Cells[1].Paragraphs[0].InsertText(AllAccountInfo.GetNameAccordingToId(UserInfo.UserId), false, format);

            custvendorinfo custven = CustVenInfoManager.GetUniqueCustVenInfo(0, so.customerName, UserInfo.UserId);

            if (custven != null)
            {
                soTable.Rows[1].Cells[1].Paragraphs[0].InsertText(custven.phone1, false, format);
                soTable.Rows[2].Cells[1].Paragraphs[0].InsertText(custven.fax, false, format);
            }

            Table itemTable = document.Tables[1];

            if (soitemsList.Count > 2)
            {
                Row sampleRow = itemTable.Rows[2];
                for (int i = 0; i < soitemsList.Count - 2; i++)
                {
                    itemTable.InsertRow(sampleRow, 2);
                }
            }
            float totalAmount = 0;

            for (int i = 0; i < soitemsList.Count; i++)
            {
                itemTable.Rows[i + 2].Cells[0].Paragraphs[0].InsertText((i + 1).ToString(), false, format);
                itemTable.Rows[i + 2].Cells[1].Paragraphs[0].InsertText(soitemsList[i].soitem.partNo, false, format);
                itemTable.Rows[i + 2].Cells[2].Paragraphs[0].InsertText(soitemsList[i].soitem.mfg, false, format);
                itemTable.Rows[i + 2].Cells[3].Paragraphs[0].InsertText(soitemsList[i].soitem.qty.ToString(), false, format);
                // itemTable.Rows[i+2].Cells[4].InsertParagraph(soitemsList[i].soitem.
                if (soitemsList[i].soitem.currencyType == (int)Currency.USD)
                {
                    itemTable.Rows[i + 2].Cells[5].Paragraphs[0].InsertText(soitemsList[i].soitem.unitPrice.ToString(), false, format);
                    itemTable.Rows[i + 2].Cells[6].Paragraphs[0].InsertText((soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty).ToString(), false, format);
                }
                else
                {
                    itemTable.Rows[i + 2].Cells[5].Paragraphs[0].InsertText(soitemsList[i].soitem.unitPrice.ToString() + Enum.GetName(typeof(Currency), soitemsList[i].soitem.currencyType), false, format);
                    itemTable.Rows[i + 2].Cells[6].Paragraphs[0].InsertText((soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty).ToString() + Enum.GetName(typeof(Currency), soitemsList[i].soitem.currencyType), false, format);
                }
                totalAmount += soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty;
            }
            itemTable.Rows[itemTable.Rows.Count - 1].Cells[4].Paragraphs[0].InsertText(totalAmount.ToString(), false, format);
            WriteToFile();
        }
Esempio n. 6
0
        protected override void FillTheDataGrid()
        {
            dataGridView1.Rows.Clear();

            poCombineList = Order.PoMgr.PoMgr.GetPoCombineAccordingToFilter(1 /*Admin*/, true, filterColumn, filterString, intStateList);

            foreach (PoCombine poItem in poCombineList)
            {
                dataGridView1.Rows.Add(poItem.poId, poItem.poItemsId, Tool.Get6DigitalNumberAccordingToId(poItem.poId), poItem.partNo, poItem.mfg, poItem.dc, poItem.qty, poItem.unitPrice, poItem.vendorName, AllAccountInfo.GetNameAccordingToId(poItem.buyerId),
                                       poItem.poDate.ToShortDateString(), AllAccountInfo.GetNameAccordingToId(poItem.salesAgentId), poItemStateList.GetPoStateStringAccordingToValue(poItem.poItemState));
            }
        }
Esempio n. 7
0
        protected override void FillTheDataGrid()
        {
            dataGridView1.Rows.Clear();
            soList = SoMgr.SoMgr.SalesGetSoAccordingTofilter(1 /*Admin*/, true, filterColumn, filterString, intStateList);

            int i = 0;

            foreach (So so in soList)
            {
                dataGridView1.Rows.Add(i++, so.customerName, so.contact, AllAccountInfo.GetNameAccordingToId(so.salesId), so.salesOrderNo, so.orderDate.ToShortDateString(), so.customerPo,
                                       so.paymentTerm, so.freightTerm, so.customerAccount, Enum.GetName(typeof(SoStatesEnum), so.soStates));
            }
        }
Esempio n. 8
0
        public void FillTheItems(poitems item, bool isNewCreatePo)
        {
            if (isNewCreatePo)
            {
                this.btFiles.Enabled = false;
            }
            this.poItemId          = item.poItemsId;
            tbPartNo.Text          = item.partNo;
            tbMfg.Text             = item.mfg;
            tbDc.Text              = item.dc;
            tbVendorIntPartNo.Text = item.vendorIntPartNo;
            tbCoo.Text             = item.coo;
            if (UserInfo.Job == JobDescription.LogisticsManager || UserInfo.Job == JobDescription.Boss || UserInfo.Job == JobDescription.Admin)
            {
                tbCoo.ReadOnly = false;
            }
            else
            {
                tbCoo.ReadOnly = true;
            }

            tbQty.Text               = item.qty.ToString();
            tbQtyRevd.Text           = item.qtyRecd.ToString();
            tbQtyCorrected.Text      = item.qtyCorrected.ToString();
            tbQtyAccept.Text         = item.qtyAccept.ToString();
            tbQtyRejected.Text       = item.qtyRejected.ToString();
            tbQtyRtv.Text            = item.qtyRTV.ToString();
            tbQcPending.Text         = item.qcPending.ToString();
            cbCurrency.SelectedIndex = (int)item.currency;
            tbUnitPrice.Text         = item.unitPrice.ToString();
            tbTotal.Text             = (item.qty * item.unitPrice).ToString();
            dateTimePicker1.Value    = item.dockDate;
            tbSalesAgent.Text        = AllAccountInfo.GetNameAccordingToId(item.salesAgent);

            if (item.receiveDate == null)
            {
                dateTimePicker2.Checked = false;
            }
            else
            {
                dateTimePicker2.Value = item.receiveDate.Value;
            }
            tbStepCode.Text     = item.stepCode;
            tbSalesAgent.Text   = AllAccountInfo.GetNameAccordingToId(item.salesAgent);
            tbNoteToVendor.Text = item.noteToVendor;
        }
        protected override void FillTheDataGrid()
        {
            custVenInfoList.Clear();
            if (tscbAllOrMine.SelectedIndex == 0)
            {
                custVenInfoList.AddRange(CustVendorManager.CustVenInfoManager.GetCVIcanSee(cvtype, UserInfo.UserId, filterColumn, tstbFilterString.Text.Trim()));
            }
            else if (tscbAllOrMine.SelectedIndex == 1)
            {
                custVenInfoList.AddRange(CustVenInfoManager.GetMyCustomerOrVendors(cvtype, UserInfo.UserId, filterColumn, tstbFilterString.Text.Trim()));
            }
            else
            {
            }
            int i = 0;

            foreach (custvendorinfo cvInfo in custVenInfoList)
            {
                dataGridView1.Rows.Add(i, cvInfo.cvname, cvInfo.contact1, cvInfo.phone1, cvInfo.cellphone, cvInfo.fax, cvInfo.email1,
                                       AllAccountInfo.GetNameAccordingToId(cvInfo.ownerName));
                i++;
            }
        }
Esempio n. 10
0
        protected override void FillTheDataGrid()
        {
            custVenInfoList.Clear();
            custVenInfoList.AddRange(CustVendorManager.CustVenInfoManager.GetAllCustomerAndVendors(filterColumn, tstbFilterString.Text.Trim()));
            int i = 0;

            foreach (custvendorinfo info in custVenInfoList)
            {
                dataGridView1.Rows.Add(i, info.cvtype == 0 ? "C" : "V", info.cvname, info.country, AllAccountInfo.GetNameAccordingToId(info.ownerName), info.paymentTerm, info.shippingTerm);
                i++;
            }
        }
Esempio n. 11
0
        protected override void FillTheDataGrid()
        {
            if (tscbList.SelectedIndex < 0)
            {
                return;
            }

            bool includeSubs = false;

            dataGridView1.Rows.Clear();

            if (tscbList.SelectedIndex == 0)
            {
                includeSubs = true;
            }

            soList = SoMgr.SoMgr.SalesGetSoAccordingTofilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);

            int i = 0;

            foreach (So so in soList)
            {
                dataGridView1.Rows.Add(i++, Tool.Get6DigitalNumberAccordingToId(so.soId), so.customerName, so.contact, AllAccountInfo.GetNameAccordingToId(so.salesId), so.orderDate.ToShortDateString(), so.customerPo,
                                       so.paymentTerm, so.freightTerm, so.customerAccount, Enum.GetName(typeof(SoStatesEnum), so.soStates));
            }
        }
Esempio n. 12
0
        protected override void FillTheDataGrid()
        {
            if (tscbList.SelectedIndex < 0)
            {
                return;
            }

            bool includeSubs = false;

            dataGridView1.Rows.Clear();

            if (tscbList.SelectedIndex == 0)
            {
                includeSubs = true;
            }

            soCombineList = SoMgr.SoMgr.SalesGetSoCombineAccordingTofilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);

            int i = 0;

            foreach (SoCombine soc in soCombineList)
            {
                dataGridView1.Rows.Add(i++, soc.soItemsId, Tool.Get6DigitalNumberAccordingToId(soc.soId), soc.partNo, soc.mfg, soc.dc, soc.qty, soc.unitPrice, soc.customerName, soc.customerPo, soc.cpn, soc.orderDate.ToShortDateString(), AllAccountInfo.GetNameAccordingToId(soc.salesId), soItemStateList.GetSoStateStringAccordingToValue(soc.soItemState));
            }
        }
Esempio n. 13
0
        public void FillTheDataGridPoItems()
        {
            dataGridView1.Rows.Clear();
            int indexForSelectedItemsId = -1;
            int i = 0;

            foreach (PoItemContentAndState cSitem in poItemsStateList)
            {
                dataGridView1.Rows.Add(i + 1, cSitem.poItem.partNo, cSitem.poItem.mfg, cSitem.poItem.dc, cSitem.poItem.vendorIntPartNo, cSitem.poItem.coo, cSitem.poItem.qty,
                                       cSitem.poItem.qtyRecd, cSitem.poItem.qtyCorrected, cSitem.poItem.qtyAccept, cSitem.poItem.qtyRejected, cSitem.poItem.qtyRTV, cSitem.poItem.qcPending,
                                       Enum.GetName(typeof(AmbleClient.Currency), cSitem.poItem.currency), cSitem.poItem.unitPrice, cSitem.poItem.qty * cSitem.poItem.unitPrice, cSitem.poItem.dockDate.ToShortDateString(), cSitem.poItem.receiveDate.HasValue?cSitem.poItem.receiveDate.Value.ToShortDateString():"", cSitem.poItem.stepCode, AllAccountInfo.GetNameAccordingToId(cSitem.poItem.salesAgent));

                if (this.selectedPoItemId != null && poItemsStateList[i].poItem.poItemsId == this.selectedPoItemId.Value)
                {
                    indexForSelectedItemsId = i;
                }
                i++;
            }
            if (indexForSelectedItemsId > -1)
            {
                //turn red
                foreach (DataGridViewCell dgvc in dataGridView1.Rows[indexForSelectedItemsId].Cells)
                {
                    dgvc.Style.BackColor = Color.Red;
                }
            }
        }
Esempio n. 14
0
        protected override void FillTheDataGrid()
        {
            if (tscbList.SelectedIndex < 0)
            {
                return;
            }

            bool includeSubs = false;

            dataGridView1.Rows.Clear();

            if (tscbList.SelectedIndex == 0)
            {
                includeSubs = true;
            }

            poList = Order.PoMgr.PoMgr.GetPoAccordingToFilter(UserInfo.UserId, includeSubs, filterColumn, filterString, intStateList);

            foreach (po poItem in poList)
            {
                dataGridView1.Rows.Add(poItem.poId, Tool.Get6DigitalNumberAccordingToId(poItem.poId), poItem.vendorName, poItem.contact, AllAccountInfo.GetNameAccordingToId((int)poItem.pa),
                                       poItem.poDate.ToShortDateString(),
                                       poItem.paymentTerms,
                                       poItem.freight, poItem.vendorNumber, Enum.GetName(typeof(PoStatesEnum), poItem.poStates));
            }
        }
Esempio n. 15
0
        protected override void FillTheDataGrid()
        {
            dataGridView1.Rows.Clear();
            soCombineList = SoMgr.SoMgr.SalesGetSoCombineAccordingTofilter(1, true, filterColumn, filterString, intStateList);

            int i = 0;

            foreach (SoMgr.SoCombine soc in soCombineList)
            {
                dataGridView1.Rows.Add(i++, soc.soItemsId, Tool.Get6DigitalNumberAccordingToId(soc.soId), soc.partNo, soc.mfg, soc.dc, soc.qty, soc.unitPrice, soc.customerName, soc.customerPo, soc.cpn, soc.orderDate.ToShortDateString(), AllAccountInfo.GetNameAccordingToId(soc.salesId), soItemStateList.GetSoStateStringAccordingToValue(soc.soItemState));
            }
        }
Esempio n. 16
0
        protected override void FillTheDataGrid()
        {
            dataGridView1.Rows.Clear();

            poList = Order.PoMgr.PoMgr.GetPoAccordingToFilter(1 /*Admin*/, true, filterColumn, filterString, intStateList);

            foreach (po poItem in poList)
            {
                dataGridView1.Rows.Add(poItem.poId, Tool.Get6DigitalNumberAccordingToId(poItem.poId), poItem.vendorName, poItem.contact, AllAccountInfo.GetNameAccordingToId((int)poItem.pa),
                                       poItem.poDate.ToShortDateString(),
                                       poItem.paymentTerms,
                                       poItem.freight, poItem.vendorNumber, Enum.GetName(typeof(PoStatesEnum), poItem.poStates));
            }
        }