void GetModulePanel(string Panel, string lang)
        {
            ModulesFrontPanelBSO _module = new ModulesFrontPanelBSO();
            DataTable tb = _module.GetModulesFrontPanelbyPanel(Panel, lang);
            string _path = ResolveUrl("~/") + "Client/Modules/MainHome/";
            Control objControl = new Control();


            if (tb.Rows.Count > 0)
            {
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    //if (tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Left") || tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Right"))
                    //    _path += "Client/Modules/Panel/";
                    //else
                    //    if (tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Main"))
                    //        _path += "Client/Modules/MainHome/";

                    objControl = (Control)this.LoadControl(_path + tb.Rows[i]["ModulesFrontPanel_Url"].ToString());

                    AreaMainPanel.Controls.Add(objControl);
                    ControlParameter(objControl, tb.Rows[i]["ModulesFrontPanel_Title"].ToString(), tb.Rows[i]["ModulesFrontPanel_Icon"].ToString(), tb.Rows[i]["ModulesFrontPanel_Value"].ToString(), Convert.ToInt32(tb.Rows[i]["ModulesFrontPanel_Record"].ToString()));

                }
            }

        }
        public void ViewModulesFrontPanel(string Panel)
        {
            ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
            DataTable table = new DataTable();
            bool check_lag = Check_Viet.Checked;
            if (Panel.Equals("All"))
                if (check_lag)
                {
                    table = _modulesFrontPanelBSO.MixModulesFrontPanel_lag("vi-VN");
                }
                else
                {
                    //  table = _modulesFrontPanelBSO.MixModulesFrontPanel();
                    table = _modulesFrontPanelBSO.MixModulesFrontPanel_lag("en-US");
                }

            else
                if (check_lag)
                {
                    //table = _modulesFrontPanelBSO.MixModulesFrontPanel(Panel, "vi-VN");
                    table = _modulesFrontPanelBSO.MixModulesFrontPanel_lag_Vitri(Panel, "vi-VN");
                }
                else
                {
                    table = _modulesFrontPanelBSO.MixModulesFrontPanel_lag_Vitri(Panel, "en-US");
                    // table = _modulesFrontPanelBSO.MixModulesFrontPanel(Panel, "en-US");
                }
            //  table = _modulesFrontPanelBSO.MixModulesFrontPanel(Panel);

            commonBSO commonBSO = new commonBSO();
            commonBSO.FillToGridView(GridView1, table);
        }
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     int mID = Convert.ToInt32(e.CommandArgument.ToString().Trim());
     string cName = e.CommandName.ToLower().Trim();
     switch (cName)
     {
         case "edit":
             Response.Redirect("~/Admin/editmodulesfrontpanel/" + mID + "/Default.aspx");
             break;
         case "delete":
             ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
             _modulesFrontPanelBSO.DeleteModulesFrontPanel(mID);
             ViewModulesFrontPanel(rdbPanel.SelectedValue);
             break;
     }
 }
        protected void initControl(int ID)
        {
            if (ID > 0)
            {
                txtModulesFrontPanelID.Value = Convert.ToString(ID);
                btn_add.Visible = false;
                btn_edit.Visible = true;
                try
                {
                    ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();

                    ModulesFrontPanel _modulesFrontPanelRows = _modulesFrontPanelBSO.GetModulesFrontPanelById(ID);
                    ddlModulesFrontPanel.SelectedValue = _modulesFrontPanelRows.ModulesFrontPanelParent.ToString();
                    txtModulesFrontPanelName.Text = _modulesFrontPanelRows.ModulesFrontPanelName;
                    //  txtModulesFrontPanelUrl.Text = _modulesFrontPanelRows.ModulesFrontPanelUrl;


                    txtRadHelp.Content = _modulesFrontPanelRows.ModulesFrontPanelHelp;
                    txtRadFull.Content = _modulesFrontPanelRows.ModulesFontPanelContent;
                    hddIcon.Value = _modulesFrontPanelRows.ModulesFrontPanelIcon;
                    uploadPreview.Src = ResolveUrl("~/Upload/Admin_Theme/Icons/") + _modulesFrontPanelRows.ModulesFrontPanelIcon;

                    txtModulesFrontPanelTitle.Text = _modulesFrontPanelRows.ModulesFrontPanelTitle;
                    ddlValueCategory.SelectedValue = _modulesFrontPanelRows.ModulesFrontPanelValue;
                    txtRecord.Text = _modulesFrontPanelRows.ModulesFrontPanelRecord.ToString();
                    rdbPanel.SelectedValue = _modulesFrontPanelRows.ModulesFrontPanelPanel;
                    chkStatus.Checked = _modulesFrontPanelRows.ModulesFrontPanelStatus;
                    NgonNgu.SelectedValue = _modulesFrontPanelRows.Language;
                    GetFile();
                    dropControl.SelectedValue = _modulesFrontPanelRows.ModulesFrontPanelUrl;
                }
                catch (Exception ex)
                {
                    error.Text = ex.Message.ToString();
                }
            }
            else
            {
                rdbPanel.SelectedValue = "Main";
                GetFile();

                txtModulesFrontPanelID.Value = "";
                ddlModulesFrontPanel.SelectedIndex = 0;
                btn_add.Visible = true;
                btn_edit.Visible = false;
            }
        }
        void GetModulePanel(string panel, string lang)
        {
            var module = new ModulesFrontPanelBSO();
            var tb = module.GetModulesFrontPanelbyPanel(panel, lang);
            var path = ResolveUrl("~/") + "Client/Modules/MainHome/";

            if (tb.Rows.Count <= 0) return;
            for (var i = 0; i < tb.Rows.Count; i++)
            {
                try
                {
                    var objControl = (Control)this.LoadControl(path + tb.Rows[i]["ModulesFrontPanel_Url"].ToString());
                    AreaMainPanel.Controls.Add(objControl);
                    ControlParameter(objControl, tb.Rows[i]["ModulesFrontPanel_Title"].ToString(), tb.Rows[i]["ModulesFrontPanel_Icon"].ToString(), tb.Rows[i]["ModulesFrontPanel_Value"].ToString(), Convert.ToInt32(tb.Rows[i]["ModulesFrontPanel_Record"].ToString()), tb.Rows[i]["ModulesFrontPanel_ID"].ToString());
                }
                catch
                {

                }
            }
        }
        void GetModulePanel(string panel, string lang)
        {
            var module = new ModulesFrontPanelBSO();
            var tb = module.GetModulesFrontPanelbyPanel(panel, lang);
            var path = ResolveUrl("~/") + "Client/Modules/Panel/";
            var objControl = new Control();

            if (tb.Rows.Count > 0)
            {
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    try
                    {
                        objControl = (Control)this.LoadControl(path + tb.Rows[i]["ModulesFrontPanel_Url"].ToString());
                        AreaRightPanel.Controls.Add(objControl);
                        ControlParameter(objControl, tb.Rows[i]["ModulesFrontPanel_Title"].ToString(), tb.Rows[i]["ModulesFrontPanel_Icon"].ToString(), tb.Rows[i]["ModulesFrontPanel_Value"].ToString(), Convert.ToInt32(tb.Rows[i]["ModulesFrontPanel_Record"].ToString()), tb.Rows[i]["ModulesFontPanel_Content"].ToString());
                    }
                    catch
                    {

                    }
                }
            }
        }
        protected void Edit()
        {
            ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
            ModulesFrontPanel _modulesFrontPanel = ReceiveHtml();
            try
            {
                _modulesFrontPanelBSO.EditModulesFrontPanel(_modulesFrontPanel);
                error.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "ModulesFrontPanel", _modulesFrontPanel.ModulesFrontPanelName);

            }
            catch (Exception ex)
            {
                error.Text = ex.Message.ToString();
            }
        }
        protected void Add()
        {
            ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
            ModulesFrontPanel _modulesFrontPanel = ReceiveHtml();
            try
            {

                _modulesFrontPanelBSO.AddModulesFrontPanel(_modulesFrontPanel);
                error.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);

            }
            catch (Exception ex)
            {
                error.Text = ex.Message.ToString();
            }

        }
 protected void BindDropDownList()
 {
     ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
     DataTable table = _modulesFrontPanelBSO.MixModulesFrontPanel(rdbPanel.SelectedValue);
     commonBSO commonBSO = new commonBSO();
     ddlModulesFrontPanel.Items.Clear();
     commonBSO.FillToDropDown(ddlModulesFrontPanel, table, "~ Cấp độ Modules ~", "0", "ModulesFrontPanel_Name", "ModulesFrontPanel_ID", "");
 }
 protected void btn_Order_Click(object sender, ImageClickEventArgs e)
 {
     foreach (GridViewRow row in GridView1.Rows)
     {
         TextBox textOrder = (TextBox)row.FindControl("txtModulesFrontPanelOrder");
         int cOrder = Convert.ToInt32(textOrder.Text);
         int cateID = Convert.ToInt32(row.Cells[0].Text);
         ModulesFrontPanelBSO _modulesFrontPanelBSO = new ModulesFrontPanelBSO();
         _modulesFrontPanelBSO.ModulesFrontPanelUpOrder(cateID, cOrder);
     }
     ViewModulesFrontPanel(rdbPanel.SelectedValue);
 }