/// <summary> /// The update drag and drop option field document process view section step. /// </summary> /// <param name="dto"> /// The dto. /// </param> /// <param name="fieldDocumentId"> /// The field Document Id. /// </param> /// <exception cref="ArgumentException"> /// </exception> public void UpdateDragAndDropOptionFieldDocumentProcessViewSectionStep(SectionViewDragAndDropOptionDto dto, int fieldDocumentId) { if (dto == null) throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.NullArguementException, "dto")); using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false)) { var connection = ctx.Connection; var CommandText = @" UPDATE [dbo].[APQPProcessViewFieldDocumentDragAndDropOptions] SET [FieldDocumentId]=@p_FieldDocumentId ,[DragField]=@p_DragField ,[DropFieldPath]=@p_DropFieldPath WHERE id=@p_Id "; using (var command = new SqlCommand(CommandText, connection)) { command.Parameters.AddWithValue("@p_Id", dto.Id); command.Parameters.AddWithValue("@p_FieldDocumentId", fieldDocumentId); command.Parameters.AddWithValue("@p_DragField", dto.DragField); command.Parameters.AddWithValue("@p_DropFieldPath", dto.SourcePath); command.ExecuteNonQuery(); } } }
/// <summary> /// The insert drag and drop option field document process view section step. /// </summary> /// <param name="dto"> /// The dto. /// </param> /// <param name="fieldDocumentId"> /// The field Document Id. /// </param> /// <exception cref="ArgumentException"> /// </exception> public void InsertDragAndDropOptionFieldDocumentProcessViewSectionStep(SectionViewDragAndDropOptionDto dto, int fieldDocumentId) { if (dto == null) throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.NullArguementException, "dto")); using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false)) { var connection = ctx.Connection; var CommandText = @" INSERT INTO [dbo].[APQPProcessViewFieldDocumentDragAndDropOptions] ([FieldDocumentId] ,[DragField] ,[DropFieldPath] ) VALUES (@p_FieldDocumentId ,@p_DragField ,@p_DropFieldPath) SELECT CAST(SCOPE_IDENTITY() AS INT) "; using (var command = new SqlCommand(CommandText, connection)) { command.Parameters.AddWithValue("@p_FieldDocumentId", fieldDocumentId); command.Parameters.AddWithValue("@p_DragField", dto.DragField); command.Parameters.AddWithValue("@p_DropFieldPath", dto.SourcePath); dto.Id = (int)command.ExecuteScalar(); } } }