protected void dgvSubCategory_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
     {
         objCommon = new clsCommon();
         if (e.CommandName == "Up")
         {
             LinkButton  inkButton = (LinkButton)e.CommandSource;
             GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;
             if (drCurrent.RowIndex > 0)
             {
                 GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex - 1];
                 objCommon.SetDisplayOrder("tblSizeSubCategory", tblSizeSubCategory.ColumnNames.AppSizeSubCategoryID, tblSizeSubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]);
                 LoadSubCategoryData(false, false);
                 objCommon = null;
             }
         }
         else if (e.CommandName == "Down")
         {
             LinkButton  lnkButton = (LinkButton)e.CommandSource;
             GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;
             if (drCurrent.RowIndex < dgvSubCategory.Rows.Count - 1)
             {
                 GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex + 1];
                 objCommon.SetDisplayOrder("tblSizeSubCategory", tblSizeSubCategory.ColumnNames.AppSizeSubCategoryID, tblSizeSubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]);
                 LoadSubCategoryData(false, false);
                 objCommon = null;
             }
         }
     }
 }
Esempio n. 2
0
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            objCommon = new clsCommon();

            if (e.CommandName == "IsActive")
            {
                objMenuItem = new tblMenuItem();
                if (objMenuItem.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                {
                    if (objMenuItem.AppIsActive == true)
                    {
                        objMenuItem.AppIsActive = false;
                    }
                    else if (objMenuItem.AppIsActive == false)
                    {
                        objMenuItem.AppIsActive = true;
                    }
                    objMenuItem.Save();
                }
                objMenuItem = null;
            }
            else if (e.CommandName == "Up")
            {
                LinkButton  inkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;
                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblMenuItem", tblMenuItem.ColumnNames.AppMenuItemId, tblMenuItem.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);

                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "Down")
            {
                LinkButton lnkButton = (LinkButton)e.CommandSource;

                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;

                if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblMenuItem", tblMenuItem.ColumnNames.AppMenuItemId, tblMenuItem.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);

                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }

            LoadDataGrid(false, false, "", "");
        }
    }
Esempio n. 3
0
    protected void dgvSubCategory_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            objCommon = new clsCommon();
            if (e.CommandName == "Edit")
            {
                hdnSubCategoryId.Value = e.CommandArgument.ToString();
                SetSubCategoryValuesToControls();
            }
            else if (e.CommandName == "Up")
            {
                LinkButton  inkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;
                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblPropertySubCategory", tblPropertySubCategory.ColumnNames.AppPropertySubCategoryID, tblPropertySubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]);
                    LoadSubCategoryData(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "Down")
            {
                LinkButton  lnkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;
                if (drCurrent.RowIndex < dgvSubCategory.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblPropertySubCategory", tblPropertySubCategory.ColumnNames.AppPropertySubCategoryID, tblPropertySubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]);
                    LoadSubCategoryData(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "IsActive")
            {
                objPropertySubCategory = new tblPropertySubCategory();

                if (objPropertySubCategory.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                {
                    if (objPropertySubCategory.AppIsActive == true)
                    {
                        objPropertySubCategory.AppIsActive = false;
                    }
                    else if (objPropertySubCategory.AppIsActive == false)
                    {
                        objPropertySubCategory.AppIsActive = true;
                    }
                    objPropertySubCategory.Save();
                    LoadSubCategoryData(false, false);
                }
                objPropertySubCategory = null;
            }
        }
    }
Esempio n. 4
0
    protected void dgvGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            objCommon     = new clsCommon();
            hdnPKID.Value = e.CommandArgument.ToString();
            if (e.CommandName == "Up")
            {
                LinkButton  inkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;
                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblTrending", tblTrending.ColumnNames.AppTrendingID, tblTrending.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[2], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[2]);
                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "Down")
            {
                LinkButton  lnkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;
                if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblTrending", tblTrending.ColumnNames.AppTrendingID, tblTrending.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[2], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[2]);
                    //objCommon.SetDisplayOrder("tblBestSeller", tblBestSeller.ColumnNames.AppBestSellerID, tblBestSeller.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[2], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[2]);
                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }


            else if (e.CommandName == "IsActive")
            {
                objTrending = new tblTrending();

                if (objTrending.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
                {
                    if (objTrending.AppIsActive == true)
                    {
                        objTrending.AppIsActive = false;
                    }
                    else if (objTrending.AppIsActive == false)
                    {
                        objTrending.AppIsActive = true;
                    }
                    objTrending.Save();
                    LoadDataGrid(false, false, "", "");
                }
                objTrending = null;
            }
        }
    }
Esempio n. 5
0
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            clsEncryption objEncrypt    = new clsEncryption();
            int           intHiddenPKID = 0;

            if (!string.IsNullOrEmpty(hdnPKID.Value))
            {
                intHiddenPKID = Convert.ToInt32(hdnPKID.Value);
            }

            objCommon     = new clsCommon();
            hdnPKID.Value = e.CommandArgument.ToString();

            if (e.CommandName == "ListChildMenus")
            {
                Response.Redirect("Tab.aspx?ID=" + objEncrypt.Encrypt(hdnPKID.Value, appFunctions.strKey), true);
            }
            //else if (e.CommandName == "Edit")
            //{
            //    Response.Redirect("TabDetail.aspx?ID=" + objEncrypt.Encrypt(hdnPKID.Value, appFunctions.strKey), true);
            //}
            else if (e.CommandName == "Up")
            {
                LinkButton inkButton = (LinkButton)e.CommandSource;

                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;

                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblTab", tblTab.ColumnNames.AppTabID, tblTab.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[5], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[5]);
                    hdnPKID.Value = intHiddenPKID.ToString();
                    LoadDataGrid(false, false);
                    objCommon = null;
                }

                hdnPKID.Value = intHiddenPKID.ToString();
            }
            else if (e.CommandName == "Down")
            {
                LinkButton lnkButton = (LinkButton)e.CommandSource;

                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;

                if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblTab", tblTab.ColumnNames.AppTabID, tblTab.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[5], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[5]);
                    hdnPKID.Value = intHiddenPKID.ToString();
                    LoadDataGrid(false, false);
                    objCommon = null;
                }

                hdnPKID.Value = intHiddenPKID.ToString();
            }
            else if (e.CommandName == "IsActive")
            {
                objtab = new tblTab();

                objtab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));

                if (objtab.AppIsActive == true)
                {
                    objtab.AppIsActive = false;
                }
                else if (objtab.AppIsActive == false)
                {
                    objtab.AppIsActive = true;
                }

                objtab.Save();
                LoadDataGrid(false, false, "", "");
            }
            else if (e.CommandName == "IsAdd")
            {
                objtab = new tblTab();


                objtab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));

                if (objtab.AppIsAdd == true)
                {
                    objtab.AppIsAdd = false;
                }
                else if (objtab.AppIsAdd == false)
                {
                    objtab.AppIsAdd = true;
                }

                objtab.Save();
                LoadDataGrid(false, false, "", "");
            }
            else if (e.CommandName == "IsEdit")
            {
                objtab = new tblTab();

                objtab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));

                if (objtab.AppIsEdit == true)
                {
                    objtab.AppIsEdit = false;
                }
                else if (objtab.AppIsEdit == false)
                {
                    objtab.AppIsEdit = true;
                }

                objtab.Save();
                LoadDataGrid(false, false, "", "");
            }
            else if (e.CommandName == "IsDelete")
            {
                objtab = new tblTab();

                objtab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));

                if (objtab.AppIsDelete == true)
                {
                    objtab.AppIsDelete = false;
                }
                else if (objtab.AppIsDelete == false)
                {
                    objtab.AppIsDelete = true;
                }

                objtab.Save();
                LoadDataGrid(false, false, "", "");
            }
            else if (e.CommandName == "IsDashbord")
            {
                objtab = new tblTab();

                objtab.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));

                if (objtab.AppIsShowOnDashboard == true)
                {
                    objtab.AppIsShowOnDashboard = false;
                }
                else if (objtab.AppIsShowOnDashboard == false)
                {
                    objtab.AppIsShowOnDashboard = true;
                }

                objtab.Save();
                LoadDataGrid(false, false, "", "");
            }
        }
    }