コード例 #1
0
        public string Shorten(string longLink, Guid?userId, string password)
        {
            using (var dc = new LinkKSDataContext())
            {
                var item = new LINK();

                item.ID          = Guid.NewGuid();
                item.LongLink    = longLink;
                item.ShortLink   = this.GenerateShortLink(dc);
                item.UserID      = userId;
                item.Password    = password;
                item.CreatedDate = DateTime.Now;

                dc.LINKs.InsertOnSubmit(item);
                dc.SubmitChanges();

                return(item.ShortLink);
            }
        }
コード例 #2
0
        public string Shorten(string longLink, Guid?userId, string password, DateTime?expireDate, bool notification, bool oneshot, byte status)
        {
            using (var dc = new LinkKSDataContext())
            {
                var item = new LINK();
                item.LINK_ID           = Guid.NewGuid();
                item.SHORT_LINK        = this.GenerateShortLink(dc);
                item.LONG_LINK         = longLink;
                item.LINK_PASSWORD     = password;
                item.USERID            = userId;
                item.CREATE_DATE       = DateTime.Now;
                item.EXPIRE_DATE       = expireDate;
                item.LINK_NOTIFICATION = notification;
                item.ONE_SHOT          = oneshot;
                item.LINK_STATUS       = status;

                dc.LINKs.InsertOnSubmit(item);
                dc.SubmitChanges();
                return(item.SHORT_LINK);
            }
        }
コード例 #3
0
ファイル: Link.cs プロジェクト: talipturkmen/LinkKs
        public string Shorten(string longLink, Guid?userId, string password, DateTime?expireDate, bool oneShot, bool notification)
        {
            using (var dc = new LinkKSDataContext())
            {
                var item = new LINK(); //veri tabanında yeni satır oluşturduk

                item.Id           = Guid.NewGuid();
                item.LongLink     = longLink;
                item.ShortLink    = this.GenerateShortLink(dc);
                item.UserId       = userId;
                item.Password     = password;
                item.CreateDate   = DateTime.Now;
                item.OneShot      = oneShot;
                item.Notification = notification;

                dc.LINKs.InsertOnSubmit(item);
                dc.SubmitChanges();

                return(item.ShortLink);
            }
        }
コード例 #4
0
 private void detach_LINKs(LINK entity)
 {
     this.SendPropertyChanging();
     entity.USER = null;
 }
コード例 #5
0
 private void attach_LINKs(LINK entity)
 {
     this.SendPropertyChanging();
     entity.USER = this;
 }
コード例 #6
0
 partial void DeleteLINK(LINK instance);
コード例 #7
0
 partial void UpdateLINK(LINK instance);
コード例 #8
0
 partial void InsertLINK(LINK instance);