Ejemplo n.º 1
0
        public IActionResult TraCuuPhieuNhap(TraCuuPhieuNhap traCuuPhieuNhap)
        {
            TraCuuPhieuNhap mymodel = new TraCuuPhieuNhap();

            mymodel.pS = service.GetAllStore();
            mymodel.pi = service.TraCuuPhieuNhap(traCuuPhieuNhap);
            return(View(mymodel));
        }
Ejemplo n.º 2
0
        public IActionResult TraCuuPhieuNhap()
        {
            TraCuuPhieuNhap mymodel = new TraCuuPhieuNhap();

            mymodel.pS      = service.GetAllStore();
            mymodel.TuNgay  = DateTime.Today;
            mymodel.DenNgay = mymodel.TuNgay.AddDays(1);
            return(View(mymodel));
        }
Ejemplo n.º 3
0
        public IEnumerable <PM_INPUTORDER> TraCuuPhieuNhap(TraCuuPhieuNhap traCuuPhieuNhap)
        {
            Debug.WriteLine("Log" + traCuuPhieuNhap.TuKhoa);
            List <PM_INPUTORDER> stoList = new List <PM_INPUTORDER>();

            using (OracleConnection con = new OracleConnection(_connectString))
            {
                string queryString = "Select * from PM_INPUTORDER where INPUTVOUCHERID like '%" + traCuuPhieuNhap.TuKhoa +
                                     "%' and AUTOSTORECHANGETOSTOREID like '%" + traCuuPhieuNhap.Kho + "%'" +
                                     " and INPUTDATE BETWEEN TO_DATE ('" + traCuuPhieuNhap.TuNgay.ToString("dd/MM/yyyy") + "', 'DD/MM/YYYY')" +
                                     "AND TO_DATE('" + traCuuPhieuNhap.DenNgay.ToString("dd/MM/yyyy") + "', 'DD/MM/YYYY')" +
                                     "and PAYABLETYPE like '%" + traCuuPhieuNhap.HinhThucNhap + "%' and PROCESSSTATUS like '%" + traCuuPhieuNhap.TrangThaiNhap + "%'";
                Debug.WriteLine("Log" + queryString);
                OracleCommand command = new OracleCommand(queryString, con);
                con.Open();
                OracleDataReader reader = command.ExecuteReader();
                try
                {
                    while (reader.Read())
                    {
                        PM_INPUTORDER store = new PM_INPUTORDER()
                        {
                            INPUTVOUCHERID           = reader["INPUTVOUCHERID"].ToString(),
                            AUTOSTORECHANGETOSTOREID = Convert.ToInt32(reader["AUTOSTORECHANGETOSTOREID"]),
                            INPUTDATE     = reader["INPUTDATE"].ToString(),
                            CUSTOMERNAME  = reader["CUSTOMERNAME"].ToString(),
                            TOTALAMOUNTBF = Convert.ToInt32(reader["TOTALAMOUNTBF"]),
                            PROCESSSTATUS = Convert.ToInt32(reader["PROCESSSTATUS"])
                        };
                        Debug.WriteLine("Log" + stoList.Count());
                        stoList.Add(store);
                    }
                }
                finally
                {
                    reader.Close();
                }
            }

            return(stoList);
        }