Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Session["User"] = Session["UserInRole"];
                BindParentDropBox();
                BindMenuType();
                if (Convert.ToString(Request.QueryString["action"]) == "edit" && Request.QueryString["action"] != null)
                {
                    valueid  = Request.QueryString["shvid"];
                    valuepid = Request.QueryString["pid"];
                    try
                    {
                        //DataTable t_dt, t_dt1;
                        //SqlCommand t_SQLCmd = new SqlCommand();
                        //SqlCommand t_SQLCmd1 = new SqlCommand();
                        //t_SQLCmd.Parameters.Add("@MenuID", SqlDbType.Int);
                        //t_SQLCmd.Parameters["@MenuID"].Value = valueid;
                        objMenuSchema.Menuid = Convert.ToInt16(valueid);

                        string MenuID = GetMenuID(valuepid);
                        if (MenuID != "0")
                        {
                            drpMenu.SelectedValue = MenuID;
                            BindChildDropBox(MenuID);
                            drpSubMenu.SelectedValue = valuepid;
                            drpSubMenu.Visible       = true;
                        }
                        else
                        {
                            drpMenu.SelectedValue = valuepid;
                            drpSubMenu.Visible    = false;
                        }


                        ds = ObjmenuBL.GetPagedata(objMenuSchema);
                        dt = ds.Tables[0];
                        if (dt.Rows.Count > 0)
                        {
                            drpMenuCategory.SelectedValue = dt.Rows[0]["MenuCategory"].ToString();
                            drpMenuType.SelectedValue     = dt.Rows[0]["MenuType"].ToString();

                            txtMenuName.Text    = dt.Rows[0]["MenuName"].ToString();
                            txtMenuName_LL.Text = dt.Rows[0]["MenuName_LL"].ToString();
                            txtMDesc.Text       = dt.Rows[0]["MetaDescription"].ToString();
                            txtMDesc_LL.Text    = dt.Rows[0]["MetaDescription_LL"].ToString();

                            txtPageHead.Text    = dt.Rows[0]["PageHeading"].ToString();
                            txtPageHead_LL.Text = dt.Rows[0]["PageHeading_LL"].ToString();

                            txtPageTitle.Text    = dt.Rows[0]["PageTitle"].ToString();
                            txtPageTitle_LL.Text = dt.Rows[0]["PageTitle_LL"].ToString();

                            txtMKeywords.Text = dt.Rows[0]["MetaKeywords"].ToString();

                            txtMKeyWords_LL.Text = dt.Rows[0]["MetaKeywords_LL"].ToString();
                            txtSequence.Text     = dt.Rows[0]["SequenceNo"].ToString();

                            txtMTValue.Text = dt.Rows[0]["MenuTypeValue"].ToString();

                            // Added By K.P on 22-05-2018
                            txtMenuName_UL.Text  = dt.Rows[0]["MenuName_UL"].ToString();
                            txtMDesc_UL.Text     = dt.Rows[0]["MetaDescription_UL"].ToString();
                            txtMKeyWords_UL.Text = dt.Rows[0]["MetaKeywords_UL"].ToString();
                            txtPageHead_UL.Text  = dt.Rows[0]["PageHeading_UL"].ToString();
                            txtPageTitle_UL.Text = dt.Rows[0]["PageTitle_UL"].ToString();
                            //End

                            if (Convert.ToString(dt.Rows[0]["IsNewFlag"]) == "True")
                            {
                                chkIsNew.Checked = true;
                            }
                            else
                            {
                                chkIsNew.Checked = false;
                            }

                            if (Convert.ToString(dt.Rows[0]["Active"]) == "True")
                            {
                                chkActive.Checked = true;
                            }
                            else
                            {
                                chkActive.Checked = false;
                            }

                            if (Convert.ToString(dt.Rows[0]["IsExternalLink"]) == "True")
                            {
                                chkNewTab.Checked = true;
                            }
                            else
                            {
                                chkNewTab.Checked = false;
                            }

                            if (Convert.ToString(dt.Rows[0]["ForMobileVersion"]) == "True")
                            {
                                chkmobileversion.Checked = true;
                            }
                            else
                            {
                                chkmobileversion.Checked = false;
                            }
                        }
                    }
                    catch (Exception eee)
                    { throw eee; }
                }
            }
        }