예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,TypeCode,Description,CreatedBy,CreatedAt,UpdatedBy,UpdatedAt,IsDeleted,DeletedBy,DeletedAt,IsActive,IpAddress,UserAgent,Location")] OrderType orderType)
 {
     if (ModelState.IsValid)
     {
         var entity = Mapper.Map <OrderType>(orderType);
         orderTypeService.Update(entity);
         return(RedirectToAction("Index"));
     }
     return(View(orderType));
 }
예제 #2
0
 public static string Save(OrderTypeModel model)
 {
     if (model.Id > 0)
     {
         OrderType savedOrder = service.GetSingle(model.Id.ToString(), AuthenticationHelper.CompanyId.Value);
         if (savedOrder != null)
         {
             model.CreateDate = savedOrder.CreateDate;
             model.CreateBy   = savedOrder.CreateBy;
             model.UpdateDate = savedOrder.UpdateDate;
             model.UpdateBy   = savedOrder.UpdateBy;
         }
         return(service.Update(getEntityByModel(model)));
     }
     else
     {
         return(service.Insert(getEntityByModel(model)));
     }
 }