示例#1
0
文件: POST.ashx.cs 项目: ekah/pinsite
        private void SaveBoard(HttpContext context)
        {
            int    cat          = int.Parse(context.Request.Params["cat"]);
            string name         = context.Request.Params["name"];
            string contributors = context.Request.Params["contributors[]"];

            EyeShadow.dbml.Boards board = new EyeShadow.dbml.Boards()
            {
                Name   = name,
                CatID  = cat,
                UserID = Common.UserID
            };
            this.GetEyeShadowContext2.Boards.InsertOnSubmit(board);
            this.GetEyeShadowContext2.SubmitChanges();
            if (!string.IsNullOrEmpty(contributors))
            {
                string[] acontributors = contributors.Split(',');
                foreach (string contributor in acontributors)
                {
                    this.GetEyeShadowContext2.BoardContributor.InsertOnSubmit(new EyeShadow.dbml.BoardContributor()
                    {
                        BoardID       = board.ID,
                        ContributorID = GetEyeShadowContext3.AppUsers.First(o => o.Email == contributor).ID
                    });
                }
                this.GetEyeShadowContext2.SubmitChanges();
            }
            context.Response.Write(board.ID);
        }
示例#2
0
文件: POST.ashx.cs 项目: ekah/pinsite
 private void CreateBoard(HttpContext context)
 {
     EyeShadow.dbml.Boards boards = new EyeShadow.dbml.Boards();
     boards.Name = context.Request.Params["name"];
     this.GetEyeShadowContext2.Boards.InsertOnSubmit(boards);
     this.GetEyeShadowContext2.SubmitChanges();
 }
示例#3
0
文件: POST.ashx.cs 项目: ekah/pinsite
        private void SaveCreatedBoard(HttpContext context)
        {
            string name = context.Request.Params["name"];

            EyeShadow.dbml.Boards b = this.GetEyeShadowContext2.Boards.FirstOrDefault(o => o.Name == name && o.UserID == Common.UserID);
            if (b != null)
            {
                context.Response.Write("You already have a board with that name. Please use a different board name");
            }
            else
            {
                SaveBoard(context);
            }
        }
示例#4
0
 private void SaveBoard(HttpContext context)
 {
     int cat = int.Parse(context.Request.Params["cat"]);
     string name = context.Request.Params["name"];
     string contributors = context.Request.Params["contributors[]"];
     EyeShadow.dbml.Boards board = new EyeShadow.dbml.Boards()
     {
         Name = name,
         CatID = cat,
         UserID = Common.UserID
     };
     this.GetEyeShadowContext2.Boards.InsertOnSubmit(board);
     this.GetEyeShadowContext2.SubmitChanges();
     if (!string.IsNullOrEmpty(contributors))
     {
         string[] acontributors = contributors.Split(',');
         foreach (string contributor in acontributors)
         {
             this.GetEyeShadowContext2.BoardContributor.InsertOnSubmit(new EyeShadow.dbml.BoardContributor()
             {
                 BoardID = board.ID,
                 ContributorID = GetEyeShadowContext3.AppUsers.First(o => o.Email == contributor).ID
             });
         }
         this.GetEyeShadowContext2.SubmitChanges();
     }
     context.Response.Write(board.ID);
 }
示例#5
0
 private void CreateBoard(HttpContext context)
 {
     EyeShadow.dbml.Boards boards = new EyeShadow.dbml.Boards();
     boards.Name = context.Request.Params["name"];
     this.GetEyeShadowContext2.Boards.InsertOnSubmit(boards);
     this.GetEyeShadowContext2.SubmitChanges();
 }