Ejemplo n.º 1
0
        /// <summary>
        /// 添加文件夹
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void ADDFLODER(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            FT_Folder Folder = JsonConvert.DeserializeObject <FT_Folder>(P1);

            if (Folder.Name == "")
            {
                Folder.Name = "新建文件夹";
            }
            if (Folder.ID == 0)
            {
                Folder.CRUser = UserInfo.User.UserName;
                Folder.CRDate = DateTime.Now;
                Folder.ComId  = UserInfo.User.ComId;
                new FT_FolderB().Insert(Folder);


                //更新文件夹路径Code
                Folder.Remark = Folder.Remark + "-" + Folder.ID;
                new FT_FolderB().Update(Folder);
            }
            else
            {
            }
            msg.Result = Folder;
        }
Ejemplo n.º 2
0
        public void ADDZYFL(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            try
            {
                string strName = P1;
                int    PID     = int.Parse(P2);
                int    ID      = int.Parse(context.Request("selid").ToString());

                FT_Folder MODEL = new FT_Folder();
                if (strName.Trim() != "")
                {
                    MODEL.ID        = ID;
                    MODEL.PFolderID = PID;
                    MODEL.Name      = strName;

                    MODEL.CRUser = UserInfo.User.UserName;
                    MODEL.CRDate = DateTime.Now;
                    MODEL.ComId  = UserInfo.User.ComId.Value;
                    if (MODEL.ID == 0)
                    {
                        new FT_FolderB().Insert(MODEL);
                        //更新文件夹路径Code
                        MODEL.Remark = MODEL.Remark + "-" + MODEL.ID;
                        new FT_FolderB().Update(MODEL);
                    }
                    else
                    {
                        new FT_FolderB().Update(MODEL);
                    }
                }
                else
                {
                    msg.ErrorMsg = "请输入内容";
                }
            }
            catch (Exception ex)
            {
                msg.ErrorMsg = ex.Message;
            }
        }