public HttpResponseMessage PostNgTsUser(NgTsUser item)
 {
     item = mgr.CreateNgTsUser(item);
     var response = Request.CreateResponse<NgTsUser>(HttpStatusCode.Created, item);
     string uri = Url.Link("DefaultApi", new { id = item.UserId});
     response.Headers.Location = new Uri(uri);
     return response;
 }
 public void UpdateNgTsUser( NgTsUser ngtsuser)
 {
     if (null ==  ngtsuser)
     {
     throw new ArgumentNullException("NgTsUser");
     }
     using (NgTsTransactionScope scope = new NgTsTransactionScope())
     {
     _AddUpdate( ngtsuser);
     scope.Complete();
     }
 }
Пример #3
0
        static void Main(string[] args)
        {
            NgTsUserManager mgr = new NgTsUserManager();
            NgTsUser u = new NgTsUser();
            u.FirstName = "dddd";
            u.LastName = "lastn";
            u.Password = "******";
            u.UserCode = "usercode";
               //mgr.GetNgTsUser()
            mgr.CreateNgTsUser(u);

            mgr.GetAll();
        }
 private void _AddUpdate(NgTsUser ngtsuser)
 {
     if (0 == ngtsuser.UserId)
     {
     _DefaultsForCreate(ngtsuser);
     //ValidationUtility.Validate(ngtsuser);
     RepNgTsUser.Add(ngtsuser);
     }
     else
     {
     NgTsUser oldNgTsUser;
     oldNgTsUser = _GetNgTsUser(ngtsuser.UserId);
     _DefaultsForUpdate(ngtsuser);
     _OverrideEdit(oldNgTsUser, ngtsuser);
     //ValidationUtility.Validate(ngtsuser);
     RepNgTsUser.Save(ngtsuser);
     }
 }
 public void PutNgTsUser(long id, NgTsUser item)
 {
     item.UserId = id;
     mgr.UpdateNgTsUser(item);
 }
 private void _DefaultsForCreate(NgTsUser ngtsuser)
 {
     //ngtsuser.CreatedDate = DateTime.UtcNow;
     //ngtsuser.UpdatedDate = DateTime.UtcNow;
     //ngtsuser.CreatedById = this.Session.MemberEzkey;
     //ngtsuser.UpdatedById = this.Session.MemberEzkey;
 }
 private void _Validate(NgTsUser ngtsuser)
 {
 }
 private void _OverrideEdit(NgTsUser oldValue, NgTsUser newValue)
 {
     //newValue.UpdatedDate = oldValue.UpdatedDate;
     //newValue.UpdatedById = oldValueMemberEzkey;
 }