protected void eventSelectedProductIDs()
 {
     try
     {
         CustomProfile profile = CustomProfile.GetProfile();
         HiddenField   hdn     = (HiddenField)UCProductSearch1.FindControl("hdnProductSearchSelectedRec");
         Grid1.DataSource = null;
         Grid1.DataBind();
         if (hdn.Value != string.Empty)
         {
             string[] strings = new string[] { };
             strings = hdn.Value.Split(',');
             long[] arrayIDs = strings.Select(x => long.Parse(x)).ToArray();
             if (hdnDiscountID.Value == string.Empty)
             {
                 /* Grid1.DataSource = DiscountClient.CreateProductTempDataList(arrayIDs, Session.SessionID.ToString(), 0, profile.Personal.UserID.ToString(), profile.DBConnection._constr).ToList();
                  * Grid1.DataBind();*/
             }
             else
             {
                 /*Grid1.DataSource = DiscountClient.CreateProductTempDataList(arrayIDs, Session.SessionID.ToString(), Convert.ToInt64(hdnDiscountID.Value), profile.Personal.UserID.ToString(), profile.DBConnection._constr).ToList();
                  * Grid1.DataBind();*/
             }
         }
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Discount Master", "eventSelectedProductIDs");
     }
     finally
     {
     }
 }
        protected void Grid1_OnRebind(object sender, EventArgs e)
        {
            iPartConsumptionClient objService = new iPartConsumptionClient();

            try
            {
                Grid1.DataSource = null;
                Grid1.DataBind();
                CustomProfile profile = CustomProfile.GetProfile();
                HiddenField   hdn     = (HiddenField)UCProductSearch1.FindControl("hdnProductSearchSelectedRec");
                List <POR_SP_GetPartDetails_OfConsumption_Result> PartList = new List <POR_SP_GetPartDetails_OfConsumption_Result>();
                if (hdn.Value == "")
                {
                    PartList = objService.GetExistingTempDataBySessionIDObjectName(Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                }
                else if (hdn.Value != "")
                {
                    PartList = objService.AddPartIntoConsumption_TempDataByPartIDs(hdn.Value, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, Convert.ToInt32(ddlSites.SelectedItem.Value), profile.DBConnection._constr).ToList();
                }
                Grid1.DataSource = PartList;
                Grid1.DataBind();
            }
            catch { }
            finally { objService.Close(); }
        }
 protected void UpdateRecord(object sender, Obout.Grid.GridRecordEventArgs e)
 {
     try
     {
         HiddenField hdn = (HiddenField)UCProductSearch1.FindControl("hdnSelectedRec");
         hdn.Value = "";
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Discount Master", "UpdateRecord");
     }
     finally
     {
     }
 }
        protected void Grid1_OnRebind(object sender, EventArgs e)
        {
            iPartRequestClient objService = new iPartRequestClient();

            try
            {
                Grid1.DataSource = null;
                Grid1.DataBind();
                CustomProfile profile = CustomProfile.GetProfile();
                HiddenField   hdn     = (HiddenField)UCProductSearch1.FindControl("hdnProductSearchSelectedRec");
                List <POR_SP_GetPartDetail_ForRequest_Result> RequestPartList = new List <POR_SP_GetPartDetail_ForRequest_Result>();
                if (hdn.Value == "")
                {
                    RequestPartList = objService.GetExistingTempDataBySessionIDObjectName(Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList();
                }
                else if (hdn.Value != "")
                {
                    RequestPartList = objService.AddPartIntoRequest_TempData(hdn.Value, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, 0, profile.DBConnection._constr).ToList();
                }

                ////Add by Suresh
                //if (hdnprodID.Value != "")
                //{
                //    RequestPartList = objService.AddPartIntoRequest_TempData(hdnprodID.Value, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, Convert.ToInt32(ddlSites.SelectedItem.Value), profile.DBConnection._constr).ToList();
                //    hdnprodID.Value = "";
                //}

                if (hdnChngDept.Value == "0x00x0")
                {
                    objService.ClearTempDataFromDBNEW(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    RequestPartList = null;
                }
                hdnChngDept.Value = "";
                var chngdpt = "1x1";
                hdnChngDept.Value = chngdpt;

                Grid1.DataSource = RequestPartList;
                Grid1.DataBind();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Request Template", "Grid1_OnRebind");
            }
            finally { objService.Close(); }
        }
        protected void clear()
        {
            CustomProfile profile = CustomProfile.GetProfile();

            txtDiscount.Text = "";
            //txtSequence.Text = "";
            UC_FromDate.Date    = null;
            UC_ToDate.Date      = null;
            hdnDiscountID.Value = null;
            UC_FromDate.Date    = null;
            UC_ToDate.Date      = null;
            rbtnYes.Checked     = true;
            rbtnNo.Checked      = false;
            Grid1.DataSource    = null;
            Grid1.DataBind();
            HiddenField hdn = (HiddenField)UCProductSearch1.FindControl("hdnProductSearchSelectedRec");

            hdn.Value = "";
            /* DiscountClient.ClearTempDataFromDB(sessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr);*/
        }