示例#1
0
        public IHttpActionResult GetMatHangTheoDieuKien(MatHangViewModel.PARAM_NHAPMUA_OBJ param)
        {
            var result    = new TransferObj <MatHangViewModel.VIEW_MODEL>();
            var viewModel = new MatHangViewModel.VIEW_MODEL();

            if (string.IsNullOrEmpty(param.MAHANG))
            {
                return(BadRequest("Mã hàng không chính xác"));
            }
            else
            {
                var unitCode     = _service.GetCurrentUnitCode();
                var listSearched = _service.TimKiemMatHang_NhieuDieuKien(param.MAHANG, unitCode, _service.GetConnectionString());
                if (listSearched != null && listSearched.Count == 1)
                {
                    result.Data    = listSearched[0];
                    result.Status  = true;
                    result.Message = "Oke";
                }
                else
                {
                    result.Data    = null;
                    result.Status  = false;
                    result.Message = "NotFound";
                }
            }
            return(Ok(result));
        }
示例#2
0
        public IHttpActionResult GetMatHangXuatBanTheoMaKho(MatHangViewModel.PARAM_NHAPMUA_OBJ param)
        {
            var result    = new TransferObj <MatHangViewModel.VIEW_MODEL>();
            var viewModel = new MatHangViewModel.VIEW_MODEL();

            if (string.IsNullOrEmpty(param.MAHANG))
            {
                result.Data    = null;
                result.Message = "NOTEXISTS_MAHANG";
                result.Status  = false;
            }
            else if (string.IsNullOrEmpty(param.MAKHO_XUAT))
            {
                result.Data    = null;
                result.Message = "NOTEXISTS_MAKHO_XUAT";
                result.Status  = false;
            }
            else if (string.IsNullOrEmpty(param.TABLE_NAME))
            {
                result.Data    = null;
                result.Message = "NOTEXISTS_TABLE_NAME";
                result.Status  = false;
            }
            else
            {
                var unitCode     = _service.GetCurrentUnitCode();
                var listSearched = _service.TimKiemMatHang_TonKho_NhieuDieuKien(param.MAHANG, unitCode, _service.GetConnectionString(), param.TABLE_NAME, param.MAKHO_XUAT);
                if (listSearched != null && listSearched.Count == 1)
                {
                    result.Data    = listSearched[0];
                    result.Status  = true;
                    result.Message = "Oke";
                }
                else
                {
                    result.Data    = null;
                    result.Status  = false;
                    result.Message = "NotFound";
                }
            }
            return(Ok(result));
        }