Ejemplo n.º 1
0
 public int InsertManagement(ManagementEntity entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("InsertManagement");
     command.SetParameterValue("@Title", entity.Title);
     command.SetParameterValue("@Content", entity.Content);
     command.SetParameterValue("@Field1", entity.Field1);
     command.SetParameterValue("@Field2", entity.Field2);
     command.SetParameterValue("@Field3", entity.Field3);
     command.SetParameterValue("@Field4", entity.Field4);
     command.SetParameterValue("@Field5", entity.Field5);
     command.SetParameterValue("@Status", entity.Status);
     command.SetParameterValue("@InUser", entity.InUser);
     command.SetParameterValue("@InDate", entity.InDate);
     object obj = command.ExecuteScalar();
     if (obj != null)
     {
         int result = Convert.ToInt32(obj);
         if (result > 0)
         {
             entity.Files.ForEach(x => {
                 x.FSysNo = result;
                 new FilesDataAccess().InsertFiles(x);
             });
         }
         return Convert.ToInt32(obj);
     }
     else
         return 0;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="log"></param>
 public static int UpdateManagement(ManagementEntity entity)
 {
     return RestClient.Post<int>("ManagementService/UpdateManagement", entity);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="log"></param>
 public static int InsertManagement(ManagementEntity entity)
 {
     return RestClient.Post<int>("ManagementService/InsertManagement", entity);
 }
Ejemplo n.º 4
0
 public int UpdateManagement(ManagementEntity entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("UpdateManagement");
     command.SetParameterValue("@SysNo", entity.SysNo);
     command.SetParameterValue("@Title", entity.Title);
     command.SetParameterValue("@Content", entity.Content);
     command.SetParameterValue("@Field1", entity.Field1);
     command.SetParameterValue("@Field2", entity.Field2);
     command.SetParameterValue("@Field3", entity.Field3);
     command.SetParameterValue("@Field4", entity.Field4);
     command.SetParameterValue("@Field5", entity.Field5);
     command.SetParameterValue("@Status", entity.Status);
     command.SetParameterValue("@InUser", entity.InUser);
     command.SetParameterValue("@InDate", entity.InDate);
     int result= command.ExecuteNonQuery();
     if (result > 0)
     {
         FilesDataAccess fda = new FilesDataAccess();
         fda.DeleteFilesByFSysNo(entity.SysNo);
         entity.Files.ForEach(x =>
         {
             new FilesDataAccess().InsertFiles(x);
         });
     }
     return result;
 }
Ejemplo n.º 5
0
 public int UpdateManagement(ManagementEntity entity)
 {
     return ObjectFactory<IManagementDataAccess>.Instance.UpdateManagement(entity);
 }