Example #1
0
        protected void BtnAddQuotation_Click(object sender, EventArgs e)
        {
            if (ddlPurchaseOrder.SelectedValue == "0" || ddlSupplier.SelectedValue == "0" || txtCPU.Text == "" || txtQuotationDate.Text == "")
            {
                return;
            }
            Hashtable ht        = new Hashtable();
            string    PrOrderNo = ddlPurchaseOrder.SelectedValue;

            try
            {
                ht.Add("QtNo", txtQuotationNo.Text);
                ht.Add("PrOrderNo", ddlPurchaseOrder.SelectedValue);
                ht.Add("SupplierCode", ddlSupplier.SelectedValue);
                ht.Add("BarCode", ddlProduct.SelectedValue);
                ht.Add("CPU", txtCPU.Text);
                ht.Add("QtDate", txtQuotationDate.Text);
                ht.Add("OCode", ((SessionUser)Session["SessionUser"]).OCode);
                if (QuotationBll.AddQuotation(ht))
                {
                    LoadQuotations(PrOrderNo, ddlSupplier.SelectedValue);
                    lblMessage.Text = "<font color='green'>Quotation added successfully!</font>";
                    ClearForQuotation();
                }
                else
                {
                    lblMessage.Text = "<font color='red'>Error in adding quotation!</font>";
                }
            }
            catch
            {
            }
        }
Example #2
0
 public void FillSupplier(string PrOrderNo, string BarCode)
 {
     ddlSupplier.DataSource     = QuotationBll.GetBidders(PrOrderNo, BarCode);
     ddlSupplier.DataValueField = "SupplierCode";
     ddlSupplier.DataTextField  = "SupplierName";
     ddlSupplier.DataBind();
     ddlSupplier.Items.Insert(0, new ListItem("Select One", "0"));
 }
Example #3
0
        private void GenerateReport(string PrOrderNo)
        {
            Hashtable ht = new Hashtable();

            ht.Add("PrOrderNo", PrOrderNo);
            DataTable dt = new DataTable();

            dt = QuotationBll.QuotationReportReportData(ht);
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource reportDataset = new ReportDataSource("QuotationByPrOrder_DS", dt);

            ReportViewer1.LocalReport.DataSources.Add(reportDataset);
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reports/QuotationByPrOrder.rdlc");
            ReportViewer1.LocalReport.Refresh();
        }
Example #4
0
 protected void btnWorkOrderDone_Click(object sender, EventArgs e)
 {
     if (QuotationBll.CompleteWorkOrder(ddlPurchaseOrder.SelectedValue, ddlSupplier.SelectedValue, ddlProduct.SelectedValue, txtRemarks.Text))
     {
         btnWorkOrderDone.Visible = false;
         DataTable dt3 = PurchaseOrderBll.GetPurchaseOrderProducts(ddlPurchaseOrder.SelectedValue);
         if (PurchaseOrderBll.MailToSupplier(ddlSupplier.SelectedValue, ddlPurchaseOrder.SelectedValue, dt3))
         {
         }
         lblWorkOrder.Text = "<font color='green'>Work order has been given to this supplier.</font>";
         FillPurchaseOrder();
     }
     else
     {
         lblWorkOrder.Text = "<font color='red'>Error in generating work order!.</font>";
     }
 }
Example #5
0
        protected void btnOrderWork_Click(object sender, EventArgs e)
        {
            lblMessage.Text = "Please print this report before completing Work order.";
            DataTable dt        = new DataTable();
            string    PrOrderNo = ddlPurchaseOrder.SelectedValue;
            Hashtable ht        = new Hashtable();

            ht.Add("PrOrderNo", PrOrderNo);
            ht.Add("SupCode", ddlSupplier.SelectedValue);
            ht.Add("BarCode", ddlProduct.SelectedValue);
            dt = QuotationBll.GetPurchaseOrder(ht);
            ReportViewer2.LocalReport.DataSources.Clear();
            ReportDataSource reportDataset = new ReportDataSource("WorkOrder_RPT_DS", dt);

            ReportViewer2.LocalReport.DataSources.Add(reportDataset);
            ReportViewer2.LocalReport.ReportPath = Server.MapPath("Reports/WorkOrder_RPT.rdlc");
            ReportViewer2.LocalReport.Refresh();
            btnWorkOrderDone.Visible = true;
        }
Example #6
0
 private void LoadQuotations(string PrOrderNo, string BarCode)
 {
     grdQuotations.DataSource = QuotationBll.GetQuotationsByBarCode(PrOrderNo, BarCode);
     grdQuotations.DataBind();
 }
Example #7
0
        private void LoadRequisitionMatrix()
        {
            //Table Matrix = new Table();
            DataSet ds = new DataSet();

            ds = QuotationBll.GetQuotationMatrixData();
            DataTable pr  = ds.Tables[0];
            DataTable sup = ds.Tables[1];
            DataTable mat = ds.Tables[2];
            TableRow  tr1 = new TableRow();
            Hashtable ht  = new Hashtable();
            int       i   = 1;

            TableCell Ph = new TableCell();

            Ph.Text            = "Items";
            Ph.Font.Bold       = true;
            Ph.Width           = 200;
            Ph.HorizontalAlign = HorizontalAlign.Center;
            Ph.BackColor       = Color.DeepSkyBlue;
            tr1.Cells.Add(Ph);
            foreach (DataRow dr in sup.Rows)
            {
                //// Top head
                TableCell tc = new TableCell();
                tc.Text            = dr["SupplierName"].ToString();
                tc.Font.Bold       = true;
                tc.Width           = 150;
                tc.HorizontalAlign = HorizontalAlign.Center;
                tc.BackColor       = Color.DeepSkyBlue;
                tc.BorderColor     = Color.DimGray;
                tc.Height          = 40;
                //tc.Range.ParagraphFormat.Alignment =  WdParagraphAlignment.wdAlignParagraphCenter;
                ht.Add(i.ToString(), dr["SupplierCode"].ToString());
                tr1.Cells.Add(tc);
                i++;
            }

            tr1.BorderWidth = 1;
            tr1.BorderColor = Color.Gray;
            Matrix.Rows.Add(tr1);
            string PrDrNo = string.Empty;
            //string LowestSupCode = string.Empty;
            decimal minCpu = 0;
            int     x      = 0;

            foreach (DataRow dr0 in pr.Rows)
            {
                minCpu = 0;
                TableRow tr = new TableRow();
                for (int j = 0; j <= i - 1; j++)
                {
                    if (j == 0)
                    {
                        // left head
                        TableCell c1 = new TableCell();
                        c1.Text            = pr.Rows[x]["ProductName"].ToString(); // +"<br/>"; +pr.Rows[x]["BarCode"].ToString();
                        PrDrNo             = pr.Rows[x]["BarCode"].ToString();
                        minCpu             = GetLowestBidder(PrDrNo, mat);
                        c1.BorderColor     = Color.Gray;
                        c1.HorizontalAlign = HorizontalAlign.Center;
                        tr.Cells.Add(c1);
                        tr.BackColor   = Color.LightGray;
                        tr.BorderWidth = 1;
                        tr.BorderColor = Color.Gray;
                    }
                    else
                    {
                        TableCell c         = new TableCell();
                        string    valueText = GetCPU(j, ht, PrDrNo, mat);
                        c.Text = valueText;
                        try
                        {
                            if (int.Parse(valueText) == minCpu)
                            {
                                c.BackColor = Color.LightGreen;
                            }
                            else
                            {
                                c.BackColor = Color.WhiteSmoke;
                            }
                        }
                        catch
                        {
                            c.BackColor = Color.WhiteSmoke;
                        }

                        c.HorizontalAlign = HorizontalAlign.Center;
                        tr.Cells.Add(c);
                        tr.BorderWidth = 1;
                        tr.BorderColor = Color.Gray;
                    }
                }
                Matrix.Rows.Add(tr);
                x++;
            }

            //Matrix.DataBind();
            // Panel1.Controls.Add(Matrix);
        }
Example #8
0
 private void SetQuotationNo(string PrOrderNo, string Barcode, string SupplierCode)
 {
     txtQuotationNo.Text = PrOrderNo + Barcode + SupplierCode + QuotationBll.GetCount(PrOrderNo, SupplierCode);
 }
Example #9
0
 private void LoadQuotations(string PrOrderNo, string SupCode)
 {
     grdQuotations.DataSource = QuotationBll.GetQuotationsByPrOrder(PrOrderNo, SupCode);
     grdQuotations.DataBind();
 }