예제 #1
0
        public void Execute(UpdatePartMasterCM model)
        {
            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspUpdatePartMaster]";
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(AddParameter("@PartCode", SsDbType.BigInt, ParameterDirection.Input, model.PartCode));

                sqlCommand.Parameters.Add(AddParameter("@VendorCode", SsDbType.BigInt, ParameterDirection.Input, model.VendorCode));
                sqlCommand.Parameters.Add(AddParameter("@Description", SsDbType.VarChar, ParameterDirection.Input, model.Description));
                sqlCommand.Parameters.Add(AddParameter("@DrawingNumber", SsDbType.VarChar, ParameterDirection.Input, model.DrawingNumber));
                sqlCommand.Parameters.Add(AddParameter("@DrawingUnit", SsDbType.VarChar, ParameterDirection.Input, model.DrawingUnit));
                sqlCommand.Parameters.Add(AddParameter("@DrawingNoRevision", SsDbType.VarChar, ParameterDirection.Input, model.DrawingNumberRevision));
                sqlCommand.Parameters.Add(AddParameter("@ItemCode", SsDbType.VarChar, ParameterDirection.Input, model.ItemCode));
                sqlCommand.Parameters.Add(AddParameter("@RatePiece", SsDbType.Decimal, ParameterDirection.Input, model.RatePiece));
                sqlCommand.Parameters.Add(AddParameter("@RawWeight", SsDbType.Decimal, ParameterDirection.Input, model.RawWeight));
                sqlCommand.Parameters.Add(AddParameter("@FinishWeight", SsDbType.Decimal, ParameterDirection.Input, model.FinishWeight));
                sqlCommand.Parameters.Add(AddParameter("@MaterialCode", SsDbType.Decimal, ParameterDirection.Input, model.MaterialCode));


                sqlCommand.Parameters.Add(AddParameter("@UpdatedBy", SsDbType.UniqueIdentifier, ParameterDirection.Input, new Guid()));
                sqlCommand.Parameters.Add(AddParameter("@UpdatedDateTime", SsDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow));

                sqlCommand.ExecuteNonQuery();
            }
        }
예제 #2
0
        public UpdatePartMasterQM UpdatePartMaster(UpdatePartMasterCM updatePartMasterCM)
        {
            using (var connection = new DbConnectionProvider().CreateConnection())
            {
                connection.Open();

                var command = new PartMasterUpdateCommand {
                    Connection = connection
                };
                command.Execute(updatePartMasterCM);
            }

            return(new UpdatePartMasterQM());;
        }
        public UpdatePartMasterResponseDto UpdatePartMaster(UpdatePartMasterRequestDto updatePartMasterRequestDto)
        {
            var cModel = new UpdatePartMasterCM
            {
                Description           = updatePartMasterRequestDto.Description,
                DrawingNumber         = updatePartMasterRequestDto.DrawingNumber,
                DrawingUnit           = updatePartMasterRequestDto.DrawingUnit,
                DrawingNumberRevision = updatePartMasterRequestDto.DrawingNumberRevision,
                FinishWeight          = updatePartMasterRequestDto.FinishWeight,
                ItemCode     = updatePartMasterRequestDto.ItemCode,
                MaterialCode = updatePartMasterRequestDto.MaterialCode,
                RatePiece    = updatePartMasterRequestDto.RatePiece,
                RawWeight    = updatePartMasterRequestDto.RawWeight,
                VendorCode   = updatePartMasterRequestDto.VendorCode,
                PartCode     = updatePartMasterRequestDto.PartCode
            };

            var response = partMasterRepository.UpdatePartMaster(cModel);

            return(new UpdatePartMasterResponseDto());
        }