Beispiel #1
0
        public ActionResult UpdateWareHouse(ResponseAdminWareHouseList item1, RequestAdminWareHouse item2, ResponseAdminWareHouseDetail item3, ResponseAdminWareHouse item4)
        {
            if (ModelState.IsValid)
            {
                LogicAdminWareHouse    adm      = new LogicAdminWareHouse();
                ResponseAdminWareHouse response = new ResponseAdminWareHouse();

                item2.flag         = 'M';
                item2.dateUpdate   = DateTime.Now;
                item2.userUpdate   = Session["user"].ToString();
                item2.userRegister = "";
                response           = adm.setWareHouse(item2);

                if (response.code == 50000)
                {
                    Session.Add("msgOk", response.message);
                }
                else
                {
                    Session.Add("msgEr", response.message);
                }
            }

            return(RedirectToAction("WareHouse"));
        }
Beispiel #2
0
        public ActionResult addWareHouse(ResponseAdminWareHouseList item1, RequestAdminWareHouse item2,
                                         ResponseAdminWareHouseDetail item3, ResponseAdminWareHouse item4)
        {
            // Método para agregar opciones de catálogo
            if (ModelState.IsValid)
            {
                LogicAdminWareHouse adm = new LogicAdminWareHouse();

                item2.stateRecord  = true;
                item2.flag         = 'N';
                item2.dateRegister = DateTime.Now;
                item2.userRegister = Session["user"].ToString();
                item2.dateUpdate   = DateTime.Now;
                item2.userUpdate   = Session["user"].ToString();
                item4 = adm.setWareHouse(item2);

                if (item4.code == 50000)
                {
                    Session.Add("msgOk", item4.message);
                }
                else
                {
                    Session.Add("msgEr", item4.message);
                }
            }

            Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse> response =
                new Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse>(item1, item2, item3, item4);

            return(RedirectToAction("WareHouse"));
        }
Beispiel #3
0
        public ActionResult WareHouse()
        {
            // Obtener el listado de sedes
            RequestAdminWareHouse      req   = new RequestAdminWareHouse();
            ResponseAdminWareHouseList res   = new ResponseAdminWareHouseList();
            LogicAdminWareHouse        logic = new LogicAdminWareHouse();

            req.id = 0;
            res    = logic.getWareHouseList(req);

            req.stateRecord = true;
            Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse> response =
                new Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse>(res, null, null, null);

            return(View(response));
        }
Beispiel #4
0
        public ActionResult ShowWareHouse(string id)
        {
            // Cargar los datos de la sede
            RequestAdminWareHouse      req   = new RequestAdminWareHouse();
            ResponseAdminWareHouseList res   = new ResponseAdminWareHouseList();
            LogicAdminWareHouse        logic = new LogicAdminWareHouse();

            req.id = int.Parse(id);
            res    = logic.getWareHouseList(req);

            req.description = res.lst[0].description;
            req.idCompany   = res.lst[0].idCompany;
            req.responsable = res.lst[0].responsable;
            req.stateRecord = res.lst[0].stateRecord;

            Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse> response =
                new Tuple <ResponseAdminWareHouseList, RequestAdminWareHouse, ResponseAdminWareHouseDetail, ResponseAdminWareHouse>(res, req, null, null);

            return(View(response));
        }
Beispiel #5
0
        public ResponseAdminWareHouse adminWareHouse(RequestAdminWareHouse request)
        {
            ResponseAdminWareHouse response = new ResponseAdminWareHouse();

            try
            {
                LogicAdminWareHouse logic = new LogicAdminWareHouse();
                request.dateRegister = System.DateTime.Now;
                request.dateUpdate   = System.DateTime.Now;

                response = logic.adminWareHouse(request);
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                // Cuando sea una excepción por SQL ya vendrá el mensaje de error controlado
                response.code    = exSql.ErrorCode;
                response.message = exSql.Message;
                response.status  = exSql.State;
            }
            catch (Exception ex)
            {
                // Registrar el error real
                LogicLogError logicError = new LogicLogError();
                LogError      error      = new LogError();

                error.module       = "ADMIN";
                error.method       = "adminWareHouse";
                error.errorMessage = ex.Message;
                error.moreInfo     = request.id.ToString();

                logicError.newError(error);

                response.code    = -1;
                response.message = "Error no controlado, favor consultar con el administrador del sistema.";
            }

            return(response);
        }