コード例 #1
0
        public IActionResult Details(int Id)
        {
            SecoundrySourceService ss = new SecoundrySourceService(_Context);
            var SecondryDetails       = ss.GetSecondaryLoads(Id);

            return(View(SecondryDetails));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(SecoundrySouresDataModelSim obj)
        {
            SecoundrySourceService ps = new SecoundrySourceService(_Context);
            bool tr = await ps.EditSecondarySource(obj);

            return(RedirectToAction(nameof(Index)));
        }
コード例 #3
0
        public IActionResult Edit(int Id)
        {
            SecoundrySourceService ps = new SecoundrySourceService(_Context);
            var sec = ps.MappingToSecoundrySourceDataModel(ps.GetSecoundrySourceFromDBByCode(Id));

            return(View(sec));
        }
コード例 #4
0
        public async Task <IActionResult> Delete(int Id)
        {
            SecoundrySourceService ps = new SecoundrySourceService(_Context);
            int  P_Id    = ps.GetPrimarySourceId(Id);
            bool deleted = await ps.Delete(Id);

            return(RedirectToAction("Index"));
        }
コード例 #5
0
        public IActionResult homeCreate(int Id)
        {
            FactoryService         fs = new FactoryService(_Context);
            SecoundrySourceService ss = new SecoundrySourceService(_Context);

            ViewBag.factories   = fs.GetAllFactoriesSimple();
            ViewBag.secondaries = ss.GetAllSecoundrySources();
            return(View());
        }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: mido5219/SmartPower
        public IActionResult Status()
        {
            ReportService          rs = new ReportService(_con);
            PrimarySourceSerivce   ps = new PrimarySourceSerivce(_con);
            SecoundrySourceService ss = new SecoundrySourceService(_con);

            ViewBag.primaries   = ps.GetAllPrimarySources();
            ViewBag.secondaries = ss.GetAllSecoundrySources();
            var model = rs.GetSourceStatus();

            return(View(model));
        }
コード例 #7
0
        public async Task <IActionResult> homeCreate(SecoundrySouresDataModelSim obj)
        {
            SecoundrySourceService ss = new SecoundrySourceService(_Context);

            var y = ss.GetSecondaryByName(obj.Name, obj.PS_Id);

            if (y != null)
            {
                FactoryService fs = new FactoryService(_Context);
                ViewBag.factories = fs.GetAllFactoriesSimple();
                ModelState.AddModelError("Name", "Name is already exist");
                return(View());
            }



            bool created = await ss.CreateSecoundrySourceAsync(obj);

            return(RedirectToAction("Index"));
        }
コード例 #8
0
        public IActionResult Index(int facid = -1, int primary = -1)
        {
            List <SecoundrySouresDataModelSim> allsec;
            FactoryService fs = new FactoryService(_Context);

            ViewBag.factories = fs.GetAllFactoriesSimple();
            SecoundrySourceService ss = new SecoundrySourceService(_Context);

            if (facid != -1)
            {
                allsec = ss.GetSpecificSecondary(facid, primary);
            }
            else
            {
                allsec = ss.GetAllSecoundrySources();
            }


            return(View(allsec));
        }
コード例 #9
0
        public List <secondarySource> GetAllSecondarySourcesbyfacId(int factoryid)  //type of distination
        {
            SecoundrySourceService ss = new SecoundrySourceService(_Context);

            return(ss.GetAllSecondarySourcesbyfacId(factoryid));
        }