示例#1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (Session[Constant.SESSION_BIDREFNO] == null)
        {
            Response.Redirect("bidsforeval.aspx");
        }

        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Item Details");

        if (!IsPostBack)
        {
            fillGrid();
            //lnkComparison.NavigateUrl = "javascript://";
            //lnkComparison.Attributes.Add("onclick", "javascript:__doPostBack('lnkSave',''); window.open('../reports/eventtenderscanvass.aspx?brn=' + " + Session[Constant.SESSION_BIDREFNO].ToString() + " , 'x', 'toolbar=no, menubar=no, width=950; height=790, top=80, left=80, resizable=yes, scrollbars=yes'); ");

            int bidrefno = 0;
            rvBidEventTendersComparisons.LocalReport.ReportPath = Request.PhysicalApplicationPath + @"web\reports\eventtenderscanvass.rdlc";
            rvBidEventTendersComparisons.ShowReportBody         = false;

            if (!string.IsNullOrEmpty(Session["BidRefNo"].ToString()))
            {
                if (int.TryParse(Session["BidRefNo"].ToString(), out bidrefno))
                {
                    ReportParameter[] RequestorParameter = new ReportParameter[1];
                    RequestorParameter[0] = new ReportParameter("BidRefNo", bidrefno.ToString());
                    //RequestorParameter[1] = new ReportParameter("UseAlias", "2410");
                    rvBidEventTendersComparisons.LocalReport.SetParameters(RequestorParameter);
                }
                rvBidEventTendersComparisons.ShowReportBody = true;
            }
        }
        else
        {
            //GvTendersAddedCosts.DataBind();
            fillGrid();
            GvTenders.DataBind();
        }

        lnkComparison.Enabled = !isEnabledComparison();

        if (Session["EndorsementMessage"] != null)
        {
            lblMessage.Text = Session["EndorsementMessage"].ToString().Trim();
            Session["EndorsementMessage"] = null;
        }
    }
示例#2
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (Session[Constant.SESSION_BIDREFNO] == null)
        {
            Response.Redirect("bidsforeval.aspx");
        }

        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Item Details");



        if (!IsPostBack)
        {
            int bidrefno = 0;
            rvBidEventTendersComparisons.LocalReport.ReportPath = Request.PhysicalApplicationPath + @"web\reports\eventtenderscanvass.rdlc";
            rvBidEventTendersComparisons.ShowReportBody         = false;

            if (!string.IsNullOrEmpty(Session["BidRefNo"].ToString()))
            {
                if (int.TryParse(Session["BidRefNo"].ToString(), out bidrefno))
                {
                    ReportParameter[] RequestorParameter = new ReportParameter[1];
                    RequestorParameter[0] = new ReportParameter("BidRefNo", bidrefno.ToString());
                    rvBidEventTendersComparisons.LocalReport.SetParameters(RequestorParameter);
                }
                rvBidEventTendersComparisons.ShowReportBody = true;
            }
        }
        else
        {
            GvTenders.DataBind();
        }

        if (Session["EndorsementMessage"] != null)
        {
            lblMessage.Text = Session["EndorsementMessage"].ToString().Trim();
            Session["EndorsementMessage"] = null;
        }
    }
示例#3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (Session[Constant.SESSION_BIDREFNO] == null)
        {
            Response.Redirect("bidsforeval.aspx");
        }

        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Item Details");

        if (!IsPostBack)
        {
            fillGrid();
            lnkComparison.NavigateUrl = "javascript://";
            lnkComparison.Attributes.Add("onclick", "javascript:__doPostBack('lnkSave',''); window.open('../reports/eventtenderscanvass.aspx?brn=' + " + Session[Constant.SESSION_BIDREFNO].ToString() + " , 'x', 'toolbar=no, menubar=no, width=950; height=790, top=80, left=80, resizable=yes, scrollbars=yes'); ");
        }
        else
        {
            GvTenders.DataBind();
            GvTendersAddedCosts.DataBind();
            fillGrid();
        }

        lnkComparison.Enabled = !isEnabledComparison();

        if (Session["EndorsementMessage"] != null)
        {
            lblMessage.Text = Session["EndorsementMessage"].ToString().Trim();
            Session["EndorsementMessage"] = null;
        }
    }
示例#4
0
    protected void lnkSave_Click(object sender, EventArgs e)
    {
        //CreatePDF("sadasdasd.pdf");
        //Response.Write(getVendorIds());
        string control1 = Request.Form["__EVENTTARGET"];
        string biddetail;

        //Response.Write(control1 + GvTenders.Rows.Count.ToString());
        foreach (GridViewRow oGrid in GvTenders.Rows)
        {
            int  Num;
            bool isNum = int.TryParse(oGrid.Cells[0].Text.Trim(), out Num);
            if (isNum && oGrid.Cells[0].Text.Trim() != "0")
            {
                //Response.Write(oGrid.Cells[0].Text + "<br>");
                biddetail = oGrid.Cells[0].Text.Trim();
                string bidItem = oGrid.Cells[0].Text.Trim() != "" ? oGrid.Cells[0].Text.Trim() : "";

                TextBox biditemF = (TextBox)oGrid.FindControl(bidItem);
                if (biditemF.Text != "0")
                {
                    sCommand = "UPDATE tblBidTenders SET Status=1 WHERE BidDetailNo=" + bidItem;
                    SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                    sCommand = "UPDATE tblBidTenders SET Status=2 WHERE BidDetailNo=" + bidItem + " AND VendorId=" + biditemF.Text.Trim();
                    SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                    //Response.Write(sCommand + "<br>");
                }
            }
            //for (int i = 0; i < oGrid.Cells.Count; i++)
            //{

            //    if (i >= 3)
            //    {
            //        char[] delimiterChars = { '(' };
            //        string valu = GvTenders.HeaderRow.Cells[i].Text.Replace(")", "");
            //        string[] vendori = valu.Split(delimiterChars);

            //        //HtmlInputRadioButton vendori = Directcast(oGrid.FindControl("2042"),HtmlInputRadioButton);
            //        //Response.Write(oGrid.Cells[0].Text);
            //        //Response.Write(vendori[1].ToString());
            //    }
            //}
        }

        foreach (GridViewRow oGrid in GvTenders.Rows)
        {
            for (int i = 0; i < oGrid.Cells.Count; i++)
            {
                if (i >= 3 && oGrid.RowIndex > BidDetailNos.Count)
                {
                    string  vendori = VendorIds[i - 3].ToString();
                    TextBox txtFld  = (TextBox)oGrid.FindControl(vendori);

                    //Update InLandFreight
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "InLandFreight")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", InLandFreight=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update SeaAirFreight
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "SeaAirFreight")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", SeaAirFreight=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Brokerage
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "FowardingBrokerage")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", FowardingBrokerage=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Duties and Taxes
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "DutiesTaxes")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            //Response.Write(txtFld.Text.Trim());
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", DutiesTaxes=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            //Response.Write(VendorIds[i - 3].ToString() + " " + i.ToString() + "<br>");
                            //Response.Write(sCommand + "<br>");
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Insurance
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "Insurance")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", Insurance=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update DeliveryCostToSite
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "DeliveryCostToSite")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", DeliveryCostToSite=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                }
            }
            //string bidItem = oGrid.Cells[0].Text.Trim() != "" ? oGrid.Cells[0].Text.Trim() : "";

            //TextBox biditemF = (TextBox)oGrid.FindControl(bidItem);
            //Response.Write(biditemF.Text + "<br>");
        }
        fillGrid();
        GvTenders.DataBind();
    }
示例#5
0
    protected void lnkSave_Click(object sender, EventArgs e)
    {
        lnkSave.Visible     = false;
        lnkSave2.Visible    = true;
        LinkButton3.Visible = true;
        //CreatePDF("sadasdasd.pdf");
        //Response.Write(getVendorIds());
        string control1 = Request.Form["__EVENTTARGET"];
        string biddetail;

        //Response.Write(control1 + GvTenders.Rows.Count.ToString());
        foreach (GridViewRow oGrid in GvTenders.Rows)
        {
            int  Num;
            bool isNum = int.TryParse(oGrid.Cells[0].Text.Trim(), out Num);
            if (isNum && oGrid.Cells[0].Text.Trim() != "0")
            {
                //Response.Write(oGrid.Cells[0].Text + "<br>");
                biddetail = oGrid.Cells[0].Text.Trim();
                string bidItem = oGrid.Cells[0].Text.Trim() != "" ? oGrid.Cells[0].Text.Trim() : "";

                TextBox biditemF = (TextBox)oGrid.FindControl(bidItem);
                if (biditemF.Text != "0")
                {
                    sCommand = "UPDATE tblBidTenders SET Status=1 WHERE BidDetailNo=" + bidItem;
                    SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                    sCommand = "UPDATE tblBidTenders SET Status=2 WHERE BidDetailNo=" + bidItem + " AND VendorId=" + biditemF.Text.Trim();
                    SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                    //Response.Write(sCommand + "<br>");
                }
            }
        }

        foreach (GridViewRow oGrid in GvTenders.Rows)
        {
            for (int i = 0; i < oGrid.Cells.Count; i++)
            {
                if (i >= 3 && oGrid.RowIndex > BidDetailNos.Count)
                {
                    string  vendori = VendorIds[i - 3].ToString();
                    TextBox txtFld  = (TextBox)oGrid.FindControl(vendori);

                    //Update InLandFreight
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "InLandFreight")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", InLandFreight=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update SeaAirFreight
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "SeaAirFreight")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", SeaAirFreight=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Brokerage
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "FowardingBrokerage")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", FowardingBrokerage=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Duties and Taxes
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "DutiesTaxes")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            //Response.Write(txtFld.Text.Trim());
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", DutiesTaxes=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            //Response.Write(VendorIds[i - 3].ToString() + " " + i.ToString() + "<br>");
                            //Response.Write(sCommand + "<br>");
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update Insurance
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "Insurance")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", Insurance=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                    //Update DeliveryCostToSite
                    if (oGrid.RowType == DataControlRowType.DataRow)
                    {
                        if (oGrid.Cells[1].Text == "DeliveryCostToSite")
                        {
                            double Num;
                            bool   isNum = double.TryParse(txtFld.Text.Trim(), out Num);
                            string txtFldnew;
                            if (isNum)
                            {
                                txtFldnew = txtFld.Text.Trim().Replace(",", "");
                            }
                            else
                            {
                                txtFldnew = "0";
                            }
                            sCommand = "UPDATE tblBidTendersAddedCosts SET BidRefNo=" + Session["BidRefNo"] + ", VendorId=" + vendori.Trim() + ", DeliveryCostToSite=" + txtFldnew + " WHERE BidRefNo=" + Session["BidRefNo"] + " AND VendorId=" + vendori.Trim();
                            SqlHelper.ExecuteNonQuery(connstring, CommandType.Text, sCommand);
                        }
                    }
                }
            }
            //string bidItem = oGrid.Cells[0].Text.Trim() != "" ? oGrid.Cells[0].Text.Trim() : "";

            //TextBox biditemF = (TextBox)oGrid.FindControl(bidItem);
            //Response.Write(biditemF.Text + "<br>");
        }
        fillGrid();
        GvTenders.DataBind();
        //lnkExportToExcel2_Click();
        //Response.Redirect("bidsforeval.aspx");
        Response.Redirect("bideventtenders.aspx");

        //rvBidTendersForPOFileImport.DataBind();
        //rvBidTendersForPOFileImport.LocalReport.Refresh();
    }