Exemple #1
0
    private void ViewWidgetType()
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        DataTable         table          = _widgetTypeBSO.GetSYS_WidgetTypeAll();

        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvWidgetType, table);
    }
Exemple #2
0
    //#region Bind_ddlPageLayout
    //protected void Bind_ddlPageLayout()
    //{
    //    SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO();
    //    DataTable table = _pageLayoutBSO.GetSYS_PageLayoutAll(Language.language);
    //    commonBSO commonBSO = new commonBSO();
    //    ddlPageLayout.Items.Clear();
    //    commonBSO.FillToDropDown(ddlPageLayout, table, "~ Chọn trang ~", "0", "PageName", "Id", "");
    //}
    //#endregion

    #region Bind_ddlWidgetType
    protected void Bind_ddlWidgetType()
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        DataTable         table          = _widgetTypeBSO.GetSYS_WidgetTypeAll();
        commonBSO         commonBSO      = new commonBSO();

        ddlWidgetType.Items.Clear();
        commonBSO.FillToDropDown(ddlWidgetType, table, "~ Tất cả ~", "0", "WidgetTypeName", "Id", "");
    }
    private void NavigationTitle(int type)
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        SYS_WidgetType    _widgetType    = _widgetTypeBSO.GetSYS_WidgetTypeById(Convert.ToInt32(Request["type"].ToString()));

        if (_widgetType != null)
        {
            litModules.Text = "Cấu hình " + _widgetType.WidgetTypeName;
        }
    }
    private void NavigationTitle(int type)
    {
        //imgIcon.ImageUrl = "~/images/Admin_Theme/Icons/icon-32-config.png";

        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        SYS_WidgetType    _widgetType    = _widgetTypeBSO.GetSYS_WidgetTypeById(Convert.ToInt32(Request["type"].ToString()));

        if (_widgetType != null)
        {
            litModules.Text = "Cấu hình " + _widgetType.WidgetTypeName;
        }
    }
Exemple #5
0
    protected void btn_Order_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in grvWidgetType.Rows)
        {
            TextBox           textOrder      = (TextBox)row.FindControl("txtOrder");
            int               cOrder         = Convert.ToInt32(textOrder.Text);
            int               ID             = Convert.ToInt32(row.Cells[0].Text);
            SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
            _widgetTypeBSO.SYS_WidgetTypeUpOrder(ID, cOrder);
        }

        error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>";
        ViewWidgetType();
        AspNetCache.Reset();
    }
Exemple #6
0
    protected void btn_add_Click_more(object sender, EventArgs e)
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        SYS_WidgetType    _widgetType    = ReceiveHtml();

        try
        {
            int id = _widgetTypeBSO.CreateSYS_WidgetTypeGet(_widgetType);
            error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            AspNetCache.Reset();
            ViewWidgetType();
        }
        catch (Exception ex)
        {
            error.Text = ex.Message.ToString();
        }
    }
Exemple #7
0
    protected void Edit()
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        SYS_WidgetType    _widgetType    = ReceiveHtml();

        try
        {
            _widgetTypeBSO.UpdateSYS_WidgetType(_widgetType);
            error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>";
            initControl(_widgetType.Id);
            ViewWidgetType();
        }
        catch (Exception ex)
        {
            error.Text = ex.Message.ToString();
        }
    }
Exemple #8
0
    protected void Add()
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        SYS_WidgetType    _widgetType    = ReceiveHtml();

        try
        {
            int id = _widgetTypeBSO.CreateSYS_WidgetTypeGet(_widgetType);
            error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            initControl(id);
            ViewWidgetType();
        }
        catch (Exception ex)
        {
            error.Text = ex.Message.ToString();
        }
    }
Exemple #9
0
    protected void grvWidgetType_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    Id    = Convert.ToInt32(e.CommandArgument.ToString());
        string nName = e.CommandName.ToLower();

        switch (nName)
        {
        case "_edit":
            Response.Redirect("~/Homepage.aspx?dll=EditWidgetType&id=" + Id);
            break;

        case "_delete":
            SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
            _widgetTypeBSO.DeleteSYS_WidgetType(Id);

            ViewWidgetType();
            break;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie_lang = Request.Cookies["LangInfo_CMS"];

        if (cookie_lang == null || cookie_lang["Lang"] == null || cookie_lang["Lang"] == string.Empty)
        {
            cookie_lang         = new HttpCookie("LangInfo_CMS");
            cookie_lang["Lang"] = "vi-VN";
            cookie_lang.Expires = DateTime.Now.AddDays(1);
            Response.Cookies.Add(cookie_lang);
        }
        Language.language = cookie_lang["Lang"].ToString();
        Session["Lang"]   = cookie_lang["Lang"].ToString();

        Config config = new Config();

        if (AspNetCache.CheckCache("Config_" + Language.language) == false)
        {
            ConfigBSO configBSO = new ConfigBSO();

            config = configBSO.GetAllConfig(Language.language);
            AspNetCache.SetCacheWithTime("Config_" + Language.language, config, 150);
        }
        else
        {
            config = (Config)AspNetCache.GetCache("Config_" + Language.language);
        }
        Page.Title = config.Titleweb;

        if (!string.IsNullOrEmpty(Request["type"]))
        {
            SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
            SYS_WidgetType    _widgetType    = _widgetTypeBSO.GetSYS_WidgetTypeById(Convert.ToInt32(Request["type"].ToString()));

            if (_widgetType != null)
            {
                if (_widgetType.WidgetControl != "")
                {
                    PlaceHolder1.Controls.Add(LoadControl(ResolveUrl("~") + _widgetType.WidgetDir + "/" + _widgetType.WidgetControl));
                }
            }
        }
    }
Exemple #11
0
    protected void initControl(int ID)
    {
        if (ID > 0)
        {
            txtID.Value      = Convert.ToString(ID);
            btn_add.Visible  = false;
            btn_edit.Visible = true;

            btn_add1.Visible  = false;
            btn_add2.Visible  = false;
            btn_edit1.Visible = true;

            try
            {
                SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
                SYS_WidgetType    _widgetType    = _widgetTypeBSO.GetSYS_WidgetTypeById(ID);

                txtWidgetTypeName.Text = _widgetType.WidgetTypeName;
                GetFile();
                dropControl.SelectedValue = _widgetType.WidgetControl;
                hddDir.Value      = _widgetType.WidgetDir;
                txtInfo.Text      = _widgetType.WidgetInfo;
                chkStatus.Checked = _widgetType.WidgetStatus;
                hddOrders.Value   = _widgetType.Orders.ToString();
            }
            catch (Exception ex)
            {
                error.Text = ex.Message.ToString();
            }
        }
        else
        {
            GetFile();
            txtID.Value      = "";
            btn_add.Visible  = true;
            btn_edit.Visible = false;

            btn_add1.Visible  = true;
            btn_add2.Visible  = true;
            btn_edit1.Visible = false;
        }
    }