Пример #1
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        MojoCube.Web.Memo.List list = new MojoCube.Web.Memo.List();
        int index = Convert.ToInt32(e.CommandArgument);

        //标星
        if (e.CommandName == "_star")
        {
            list.GetData(int.Parse(((Label)GridView1.Rows[index].FindControl("lblID")).Text));
            if (list.IsStar)
            {
                list.IsStar = false;
            }
            else
            {
                list.IsStar = true;
            }
            list.UpdateData(list.pk_Memo);
        }
        //删除
        if (e.CommandName == "_delete")
        {
            list.DeleteData(int.Parse(((Label)GridView1.Rows[index].FindControl("lblID")).Text));
        }
        GridBind();
    }
Пример #2
0
    protected void lnbSaveMemo_Click(object sender, EventArgs e)
    {
        if (txtMemoContent.Text.Trim() != "")
        {
            MojoCube.Web.Memo.List list = new MojoCube.Web.Memo.List();

            list.fk_User        = int.Parse(Session["UserID"].ToString());
            list.fk_Department  = int.Parse(Session["DepartmentID"].ToString());
            list.TypeID         = 0;
            list.StatusID       = 0;
            list.Title          = string.Empty;
            list.Description    = txtMemoContent.Text.Trim();
            list.ImagePath      = string.Empty;
            list.FilePath       = string.Empty;
            list.UserList       = string.Empty;
            list.DepartmentList = string.Empty;
            list.RoleList       = string.Empty;
            list.Url            = string.Empty;
            list.IsStar         = false;
            list.Tags           = string.Empty;
            list.fk_Company     = 0;
            list.CreateUser     = int.Parse(Session["UserID"].ToString());
            list.CreateDate     = DateTime.Now.ToString();
            list.ModifyUser     = 0;
            list.ModifyDate     = DateTime.Now.ToString();
            list.InsertData();
        }

        Response.Redirect("Default.aspx");
    }