public JsonResult PostInsertAdjustment(AdjustmentDTO oAdjustmentDTO)
        {
            AdjustmentsBO oAdjustmentsBO = new AdjustmentsBO();

            //  List<AdjustmentDTO> ocAdjustmentDTO = oAdjustmentsBO.GetTodaysAdjustments(LeagueName);

            return(Json(oAdjustmentsBO, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        private void populate_ocValuesForInsert(List <string> ocValues, object DTO)
        {
            AdjustmentDTO oAdjustmentDTO = (AdjustmentDTO)DTO;

            ocValues.Add(oAdjustmentDTO.LeagueName.ToString());
            ocValues.Add(oAdjustmentDTO.StartDate.ToString());
            ocValues.Add(oAdjustmentDTO.EndDate.ToString());
            ocValues.Add(oAdjustmentDTO.Team.ToString());
            ocValues.Add(oAdjustmentDTO.AdjustmentType.ToString());
            ocValues.Add(oAdjustmentDTO.AdjustmentAmount.ToString());
            ocValues.Add(oAdjustmentDTO.Player.ToString());
            ocValues.Add(oAdjustmentDTO.Description.ToString());
            ocValues.Add(oAdjustmentDTO.TS.ToString());
        }
Beispiel #3
0
        public async Task <IHttpActionResult> Post([FromBody] AdjustmentDTO adjustment)
        {
            var adjVoucher = new AdjVoucher
            {
                ItemNum       = adjustment.ItemNum,
                CreateDate    = DateTime.Today,
                Quantity      = adjustment.Quantity,
                Reason        = adjustment.Reason,
                Status        = AdjustmentVoucherStatus.Pending,
                RequestEmpNum = adjustment.RequestEmpNum
            };

            await _stockadjustmentRepo.AddAsync(adjVoucher);

            return(Ok(new { Message = "New adjusment sent" }));
        }
Beispiel #4
0
        private void writeAdjustment(Row oAdjRow)
        {
            AdjustmentDTO oAdjustmentDTO = new AdjustmentDTO()
            {
                LeagueName         = _oLeagueDTO.LeagueName
                , StartDate        = _GameDate
                , EndDate          = _GameDate
                , Team             = oAdjRow.Team
                , AdjustmentType   = oAdjRow.Type
                , AdjustmentAmount = oAdjRow.AdjAmt
                , Player           = oAdjRow.Player
                , Description      = oAdjRow.Desc
                , TS = (string.IsNullOrEmpty(oAdjRow.TS) ? _GameDate : Convert.ToDateTime(oAdjRow.TS))
            };

            //                       TableName     ColNames (csv)     DTO       Insert DTO into ocValues Method
            SqlFunctions.DALInsertRow(TableName, TableColumns, oAdjustmentDTO, populate_ocValuesForInsert, _ConnectionString);
        }
Beispiel #5
0
        static void populateDTOFromRdr(object oRow, SqlDataReader rdr)
        {
            AdjustmentDTO oAdjustmentDTO = new AdjustmentDTO();

            oAdjustmentDTO.AdjustmentID     = (int)rdr["AdjustmentID"];
            oAdjustmentDTO.LeagueName       = (string)rdr["LeagueName"];
            oAdjustmentDTO.StartDate        = (DateTime)rdr["StartDate"];
            oAdjustmentDTO.EndDate          = rdr["EndDate"] == DBNull.Value ? null : (DateTime?)rdr["EndDate"];
            oAdjustmentDTO.Team             = (string)rdr["Team"];
            oAdjustmentDTO.AdjustmentType   = (string)rdr["AdjustmentType"];
            oAdjustmentDTO.AdjustmentAmount = (float)rdr["AdjustmentAmount"];
            oAdjustmentDTO.Player           = (string)rdr["Player"];
            oAdjustmentDTO.Description      = (string)rdr["Description"];
            oAdjustmentDTO.TS = (DateTime)rdr["TS"];

            List <AdjustmentDTO> ocAdjustmentDTO = (List <AdjustmentDTO>)oRow;

            ocAdjustmentDTO.Add(oAdjustmentDTO);
        }