protected void lnkJobPackets_Click(object sender, EventArgs e)
        {
            string      path          = "";
            string      Extention     = "";
            LinkButton  lnkJobPackets = sender as LinkButton;
            GridViewRow gr            = (GridViewRow)lnkJobPackets.Parent.Parent;

            //#- Shabbir Kanchwala. Added below 4 lines because Availability column functionality is moved out of grid.
            Label       lblReferenceID   = (Label)gr.FindControl("lblReferenceId");
            HiddenField hdnJobSequenceID = (HiddenField)gr.FindControl("hdnJobSequenceId");

            hdnJobSeqID.Value    = hdnJobSequenceID.Value;
            hdnReferenceID.Value = lblReferenceID.Text;

            //#- Shabbir Kanchwala: This code will bind the custom material list on Job Packet Popup
            JobID      = ((Label)gr.FindControl("lblCustomerIdJobId")).Text.ToString().Replace("&", "-").Replace(" ", "");
            CustomerID = Convert.ToInt32(JobID.Replace("C", "").Split('-')[0].ToString());
            BindCustomMaterialList();

            //Label lblCustomerIdJobId = (Label)gr.FindControl("lblCustomerIdJobId");
            //string[] Id = lblCustomerIdJobId.Text.Trim().Split('&');
            //string customerString = Id[0].Trim();
            //string resultString = Regex.Match(customerString, @"\d+").Value;
            //int customerId = Int32.Parse(resultString);
            //int productId = Convert.ToInt16(hdnproductid.Value);

            //int productTypeId = Convert.ToInt16(hdnProductTypeId.Value);
            // Label lblCategory = (Label)gr.FindControl("lblCategory");
            string [] s         = lnkJobPackets.Text.Trim().Split('-');
            string    soldJobId = s[0] + "-" + s[1];
            //soldJobId = ViewStateKey.Key.SoldJobNo.ToString();
            DataSet ds = new DataSet();

            ds = new_customerBLL.Instance.GetCustomerJobPackets(soldJobId);
            //if (ds.Tables.Count > 0)
            //{
            //    if (Convert.ToString(ds.Tables[0].Rows[0][1]) != "")
            //    {
            //        Extention = Path.GetExtension(Convert.ToString(ds.Tables[0].Rows[0][1]));
            //        if (Extention == ".pdf")
            //        {
            //            ds.Tables[0].Rows[0][1] = "Pdfs/pdf.jpg";
            //        }
            //    }
            //}

            Gridviewdocs.DataSource = ds;
            Gridviewdocs.DataBind();
            ScriptManager.RegisterStartupScript(this, GetType(), "overlay", "overlay();", true);
            //ResponseHelper.Redirect("ZipJobPackets.aspx?productId=" + productId + "&productTypeId=" + productTypeId + "&customerId=" + customerId, "_blank", "menubar=0,width=605px,height=630px");
            //ResponseHelper.Redirect("ZipJobPackets.aspx?" + ViewStateKey.Key.SoldJobNo.ToString() +"=" + soldJobId, "_blank", "menubar=0,width=605px,height=630px");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //int customerId = 0, productId = 0, productTypeId = 0;
            string soldJobId = string.Empty;

            try
            {
                if (!Page.IsPostBack)
                {
                    //if (Request.QueryString["productId"] != null)
                    //{
                    //    productId = Convert.ToInt16(Request.QueryString["productId"]);
                    //}
                    //if (Request.QueryString["productTypeId"] != null)
                    //{
                    //    productTypeId = Convert.ToInt16(Request.QueryString["productTypeId"]);
                    //}
                    if (Request.QueryString[ViewStateKey.Key.SoldJobNo.ToString()] != null)
                    {
                        soldJobId = Request.QueryString[ViewStateKey.Key.SoldJobNo.ToString()].ToString();
                        DataSet ds = new DataSet();
                        ds = new_customerBLL.Instance.GetCustomerJobPackets(soldJobId);
                        Gridviewdocs.DataSource = ds;
                        Gridviewdocs.DataBind();
                    }

                    //if (Request.QueryString["customerId"] != null)
                    //{
                    //    customerId = Convert.ToInt16(Request.QueryString["customerId"]);
                    //DataSet ds = new DataSet();
                    //ds = new_customerBLL.Instance.GetCustomerJobPackets(customerId, productId, productTypeId);
                    //Gridviewdocs.DataSource = ds;
                    //Gridviewdocs.DataBind();

                    //}
                    //else if (Session["CustomerId"] != null)
                    //{
                    //    DataSet ds = new DataSet();
                    //    ds = new_customerBLL.Instance.GetCustomerJobPackets(Convert.ToInt32(Session["CustomerId"].ToString()), productId, productTypeId);
                    //    Gridviewdocs.DataSource = ds;
                    //    Gridviewdocs.DataBind();
                    //}
                }
            }
            catch (Exception)
            {
                // Ignored
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int customerId = 0, productId = 0, productTypeId = 0;

            try
            {
                if (!Page.IsPostBack)
                {
                    if (Request.QueryString["productId"] != null)
                    {
                        productId = Convert.ToInt16(Request.QueryString["productId"]);
                    }
                    if (Request.QueryString["productTypeId"] != null)
                    {
                        productTypeId = Convert.ToInt16(Request.QueryString["productTypeId"]);
                    }
                    if (Request.QueryString["customerId"] != null)
                    {
                        customerId = Convert.ToInt16(Request.QueryString["customerId"]);

                        DataSet ds = new DataSet();
                        ds = new_customerBLL.Instance.GetCustomerJobPackets(customerId, productId, productTypeId);
                        Gridviewdocs.DataSource = ds;
                        Gridviewdocs.DataBind();
                    }
                    else if (Session["CustomerId"] != null)
                    {
                        DataSet ds = new DataSet();
                        ds = new_customerBLL.Instance.GetCustomerJobPackets(Convert.ToInt32(Session["CustomerId"].ToString()), productId, productTypeId);
                        Gridviewdocs.DataSource = ds;
                        Gridviewdocs.DataBind();
                    }
                }
            }
            catch (Exception)
            {
                // Ignored
            }
        }