Ejemplo n.º 1
0
 public HttpResponseMessage AddItem(RequestItem item)
 {
     try
     {
         ItemInfo newItem = new ItemInfo();
         newItem.ModuleId = item.ModuleId;
         newItem.CreatedByUserId = UserInfo.UserID;
         newItem.CreatedOnDate = DateTime.Now;
         newItem.LastModifiedByUserId = UserInfo.UserID;
         newItem.LastModifiedOnDate = DateTime.Now;
         newItem.AssignedUserId = item.AssignedUserId;
         newItem.ItemName = item.ItemName;
         newItem.ItemDescription = item.ItemDescription;
         int itemId = BBAngularController.Instance.NewItem(newItem);
         return Request.CreateResponse(HttpStatusCode.OK, newItem);
     }
     catch (Exception ex)
     {
         return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates the item.
 /// </summary>
 /// <param name="item">The item.</param>
 public void UpdateItem(ItemInfo item)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository<ItemInfo>();
         rep.Update((ItemInfo)item);
     }
 }
Ejemplo n.º 3
0
 public HttpResponseMessage UpdateItem(ItemInfo item)
 {
     try
     {
         item.LastModifiedByUserId = UserInfo.UserID;
         item.LastModifiedOnDate = DateTime.Now;
         BBAngularController.Instance.UpdateItem(item);
         return Request.CreateResponse(HttpStatusCode.OK, true.ToString());
     }
     catch (Exception ex)
     {
         return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>System.Int32.</returns>
 public int NewItem(ItemInfo item)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository<ItemInfo>();
         rep.Insert((ItemInfo)item);
         return item.ItemId;
     }
 }