Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hlBack.NavigateUrl = "Category.aspx?active=" + Request.QueryString["active"];

            if (Request.QueryString["id"] != null)
            {
                ViewState["pk_Category"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]);

                MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();
                category.GetData(int.Parse(ViewState["pk_Category"].ToString()));

                txtPageName.Text        = category.PageName;
                txtCategoryName.Text    = category.CategoryName;
                txtSortID.Text          = category.SortID.ToString();
                cbVisible.Checked       = category.Visible;
                txtSEO_Title.Text       = category.SEO_Title;
                txtSEO_Keyword.Text     = category.SEO_Keyword;
                txtSEO_Description.Text = category.SEO_Description;

                this.Title = "招聘分类编辑:" + txtCategoryName.Text.Trim();
            }
            else
            {
                txtPageName.Text  = MojoCube.Web.String.GetPageName();
                cbVisible.Checked = true;
                this.Title        = "招聘分类编辑";
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["OrderByKey"]  = "pk_Job";
            ViewState["OrderByType"] = true;

            if (Request.QueryString["parentId"] != null)
            {
                ViewState["ParentID"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["parentId"]);

                MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();
                category.GetData(int.Parse(ViewState["ParentID"].ToString()));

                lblTitle.Text = category.CategoryName;
            }
            else
            {
                ViewState["ParentID"] = "0";

                lblTitle.Text = "全部";
            }

            CategoryDiv.InnerHtml = CreateCategory();
            GridBind();
            this.Title = "招聘列表";
        }
    }
Exemplo n.º 3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtCategoryName.Text.Trim() == "")
        {
            AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写名称");
            return;
        }

        MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();

        //修改
        if (ViewState["pk_Category"] != null)
        {
            category.GetData(int.Parse(ViewState["pk_Category"].ToString()));
            category.PageName        = txtPageName.Text.Trim();
            category.CategoryName    = txtCategoryName.Text.Trim();
            category.SortID          = MojoCube.Web.String.ToInt(txtSortID.Text.Trim());
            category.Visible         = cbVisible.Checked;
            category.SEO_Title       = txtSEO_Title.Text.Trim();
            category.SEO_Keyword     = txtSEO_Keyword.Text.Trim();
            category.SEO_Description = txtSEO_Description.Text.Trim();
            category.ModifyDate      = DateTime.Now.ToString();
            category.ModifyUserID    = int.Parse(Session["UserID"].ToString());
            category.UpdateData(category.pk_Category);
        }
        //新增
        else
        {
            if (Request.QueryString["parentId"] != null)
            {
                category.ParentID = int.Parse(MojoCube.Api.Text.Security.DecryptString(Request.QueryString["parentId"]));
            }
            else
            {
                category.ParentID = 0;
            }
            category.PageName        = txtPageName.Text.Trim();
            category.CategoryName    = txtCategoryName.Text.Trim();
            category.Subtitle        = string.Empty;
            category.SortID          = MojoCube.Web.String.ToInt(txtSortID.Text.Trim());
            category.Visible         = cbVisible.Checked;
            category.SEO_Title       = txtSEO_Title.Text.Trim();
            category.SEO_Keyword     = txtSEO_Keyword.Text.Trim();
            category.SEO_Description = txtSEO_Description.Text.Trim();
            category.Url             = string.Empty;
            category.ImagePath       = string.Empty;
            category.CreateDate      = DateTime.Now.ToString();
            category.CreateUserID    = int.Parse(Session["UserID"].ToString());
            category.ModifyDate      = DateTime.Now.ToString();
            category.ModifyUserID    = 0;
            category.Language        = MojoCube.Api.UI.Language.GetLanguage();
            ViewState["pk_Category"] = category.InsertData();
        }

        AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功");
    }
Exemplo n.º 4
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();
        int index = Convert.ToInt32(e.CommandArgument);

        //删除
        if (e.CommandName == "_delete")
        {
            category.DeleteData(int.Parse(((Label)GridView1.Rows[index].FindControl("lblID")).Text));
        }
        //上移
        if (e.CommandName == "_up")
        {
            MojoCube.Web.Sql.SetSortID("Job_Category", "pk_Category", ((Label)GridView1.Rows[index].FindControl("lblID")).Text, -1);
        }
        //下移
        if (e.CommandName == "_down")
        {
            MojoCube.Web.Sql.SetSortID("Job_Category", "pk_Category", ((Label)GridView1.Rows[index].FindControl("lblID")).Text, 1);
        }
        GridBind(null);
    }
Exemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtTitle.Text.Trim() == "")
        {
            AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写职位名称");
            return;
        }

        MojoCube.Web.Job.List list = new MojoCube.Web.Job.List();

        //修改
        if (ViewState["pk_Job"] != null)
        {
            list.GetData(int.Parse(ViewState["pk_Job"].ToString()));

            MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();
            category.GetData(int.Parse(ddlCategory.SelectedValue));

            if (category.ParentID == 0)
            {
                list.CategoryID1 = category.pk_Category;
                list.CategoryID2 = 0;
            }
            else
            {
                list.CategoryID1 = category.ParentID;
                list.CategoryID2 = category.pk_Category;
            }

            list.PageName        = txtPageName.Text.Trim();
            list.Title           = txtTitle.Text.Trim();
            list.Subtitle        = txtSubtitle.Text.Trim();
            list.Description     = txtDescription.Text.Trim();
            list.Department      = txtDepartment.Text.Trim();
            list.Position        = txtPosition.Text.Trim();
            list.Number          = txtNumber.Text.Trim();
            list.Place           = txtPlace.Text.Trim();
            list.Education       = txtEducation.Text.Trim();
            list.Sex             = txtSex.Text.Trim();
            list.Wages           = txtWages.Text.Trim();
            list.Experiences     = txtExperiences.Text.Trim();
            list.Age             = txtAge.Text.Trim();
            list.Issue           = cbIssue.Checked;
            list.SEO_Title       = txtSEO_Title.Text.Trim();
            list.SEO_Keyword     = txtSEO_Keyword.Text.Trim();
            list.SEO_Description = txtSEO_Description.Text.Trim();
            list.EndDate         = txtEndDate.Text.Trim();
            list.ModifyDate      = DateTime.Now.ToString();
            list.ModifyUserID    = int.Parse(Session["UserID"].ToString());
            list.UpdateData(list.pk_Job);
        }
        //新增
        else
        {
            MojoCube.Web.Job.Category category = new MojoCube.Web.Job.Category();
            category.GetData(int.Parse(ddlCategory.SelectedValue));

            if (category.ParentID == 0)
            {
                list.CategoryID1 = category.pk_Category;
                list.CategoryID2 = 0;
            }
            else
            {
                list.CategoryID1 = category.ParentID;
                list.CategoryID2 = category.pk_Category;
            }

            list.PageName    = txtPageName.Text.Trim();
            list.Title       = txtTitle.Text.Trim();
            list.Subtitle    = txtSubtitle.Text.Trim();
            list.Description = txtDescription.Text.Trim();
            list.Department  = txtDepartment.Text.Trim();
            list.Position    = txtPosition.Text.Trim();
            list.Number      = txtNumber.Text.Trim();
            list.Place       = txtPlace.Text.Trim();
            list.Education   = txtEducation.Text.Trim();
            list.Sex         = txtSex.Text.Trim();
            list.Major       = string.Empty;
            list.Wages       = txtWages.Text.Trim();
            list.Experiences = txtExperiences.Text.Trim();
            list.Age         = txtAge.Text.Trim();
            if (txtSEO_Title.Text.Trim() != "")
            {
                list.SEO_Title = txtSEO_Title.Text.Trim();
            }
            else
            {
                list.SEO_Title = txtTitle.Text.Trim();
            }
            list.SEO_Keyword     = txtSEO_Keyword.Text.Trim();
            list.SEO_Description = txtSEO_Description.Text.Trim();
            list.Tags            = string.Empty;
            list.Visual          = string.Empty;
            list.ImagePath       = string.Empty;
            list.Issue           = cbIssue.Checked;
            list.IsComment       = false;
            list.IsRecommend     = false;
            list.Clicks          = 0;
            list.SortID          = 0;
            list.TypeID          = 0;
            list.StartDate       = DateTime.Now.ToString();
            list.EndDate         = txtEndDate.Text.Trim();
            list.CreateDate      = DateTime.Now.ToString();
            list.CreateUserID    = int.Parse(Session["UserID"].ToString());
            list.ModifyDate      = DateTime.Now.ToString();
            list.ModifyUserID    = 0;
            list.Language        = MojoCube.Api.UI.Language.GetLanguage();
            ViewState["pk_Job"]  = list.InsertData();
        }

        AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功");
    }