示例#1
0
        public ActionResult AddJilez(string fsl, string passport, int flat, string address)
        {
            var result = _jilezLogic.Add(new Jilez(passport, fsl, flat, address));

            _counterLogic.Add(new FloatCounter(passport, 0, 0, 0));
            return(RedirectToAction("HouseJilez", new { houseAddress = TempData["jilezAddress"] }));
        }
示例#2
0
        public ActionResult AddCompany(string title, string fsl, string address, int count)
        {
            var answer = _companyLogic.Add(_mapper.Map <ManageCompany>(new ManageCompanyModel(title, fsl, address, count)));

            ViewBag.AnswerFromBack = answer;
            return(RedirectToAction("AllCompanies"));
        }
示例#3
0
        public ActionResult AddHouse(string address, int podezd, int floor, string district, string company)
        {
            var result = _houseLogic.Add(new House(address, podezd, floor, district, company));

            _counterLogic.Add(new HouseCounter(address, 0, 0, 0));
            return(RedirectToAction("CompanyHouses", new { companyTitle = company }));
        }
示例#4
0
        public ActionResult Add()
        {
            var idJilez      = (string)TempData.Peek("passport");
            var idCompany    = _houseLogic.GetById(_jilezLogic.GetById(idJilez).HouseAddress).IdCompany;
            var idBill       = Request.Form["idBill"];
            var dateBill     = DateTime.Parse(Request.Form["dateBill"]);
            var amount       = Convert.ToInt32(Request.Form["amount"]);
            var debt         = Convert.ToInt32(Request.Form["debt"]);
            var balance      = Convert.ToInt32(Request.Form["balance"]);
            var serviceCount =
                (from ts in _tsjServiceLogic.GetAll()
                 let check = "on".Equals(Request.Form["check-" + ts.IdName])
                             where check
                             select ts).ToDictionary(ts => ts.IdName,
                                                     ts => Convert.ToInt32(Request.Form["amount-" + ts.IdName]));

            _billLogic.Add(_mapper.Map <Bill>(new BillModel(idBill, idCompany, idJilez)));
            _receiptLogic.Add(_mapper.Map <Receipt>(new ReceiptModel(idBill, dateBill, amount, debt, balance)));
            foreach (var n in serviceCount)
            {
                _servicesLogic.Add(new ListServices(idBill, n.Key, n.Value));
            }

            return(RedirectToAction("JilezInfo", new { passport = TempData["passport"] }));
        }
示例#5
0
        public ActionResult SetHouseCounter(int water, int gas, int electricity)
        {
            if (_houseCounterLogic.GetAll().Exists(c => c.Id == (string)TempData.Peek("jilezAddress")))
            {
                _houseCounterLogic.Delete((string)TempData.Peek("jilezAddress"));
            }

            _houseCounterLogic.Add(new HouseCounter((string)TempData.Peek("jilezAddress"), water, gas, electricity));
            TempData["water"]       = water;
            TempData["gas"]         = gas;
            TempData["electricity"] = electricity;
            return(RedirectToAction("Jilezes"));
        }
示例#6
0
        public ActionResult SetHouseCounter(int water, int gas, int electricity)
        {
            if (_counterLogic.GetAll().Exists(c => c.IdOwner == (string)TempData.Peek("passport")))
            {
                _counterLogic.Delete((string)TempData.Peek("passport"));
            }

            _counterLogic.Add(new FloatCounter((string)TempData.Peek("passport"), water, gas, electricity));
            TempData["water"]       = water;
            TempData["gas"]         = gas;
            TempData["electricity"] = electricity;
            return(RedirectToAction("JilezInfo", new { passport = (string)TempData.Peek("passport") }));
        }