Example #1
0
        public ActionResult Edit(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
            {
                var tblpm = condb.configuration_tblpmcheckpoint.Where(m => m.pmcpID == id && m.Isdeleted == 0).FirstOrDefault();
                if (tblpm == null)
                {
                    return(HttpNotFound());
                }
                PmCheckPoint pm = new PmCheckPoint();
                pm.pmCheckPoint = tblpm;
                ViewBag.plant   = new SelectList(condb.tblplants.ToList().Where(p => p.IsDeleted == 0), "PlantID", "PlantName", tblpm.PlantID).ToList();
                ViewBag.shop    = new SelectList(condb.tblshops.ToList().Where(d => d.IsDeleted == 0), "ShopId", "ShopName", tblpm.ShopID).ToList();
                ViewBag.cell    = new SelectList(condb.tblcells.ToList().Where(d => d.IsDeleted == 0), "CellID", "CellName", tblpm.CellID).ToList();
                return(View(pm));
            }
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            int    UserID   = Convert.ToInt32(Session["UserId"]);
            String Username = Session["Username"].ToString();
            //Getting all the details of that particular id in PMCheckPoint table
            configuration_tblpmcheckpoint tblmc = condb.configuration_tblpmcheckpoint.Find(id);

            using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
            {
                //Getting all the details of that particular id in PMCheckList table
                var data = condb.configuration_tblpmcheckpoint.Where(m => m.pmcpID == id && m.Isdeleted == 0).ToList();
                foreach (var row in data)
                {
                    //deleting the perticular row of that id in tblPMCheckList table
                    row.Isdeleted = 1;
                    condb.SaveChanges();
                }
                //And deleting the row present in tblPMCheckPoint table
            }
            tblmc.Isdeleted = 1;
            condb.SaveChanges();
            TempData["toaster_success"] = "Data Deleted successfully";
            return(RedirectToAction("Index"));
        }
        public ActionResult EditSensorGroup(sensormodel tblmc)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username   = Session["Username"].ToString();
            int    UserID     = Convert.ToInt32(Session["UserID"]);
            string sensorName = tblmc.sensorgroup.SensorGroupName.ToString();
            int    sid        = tblmc.sensorgroup.SID;

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                var doesThisPlantExist = db.configuration_tblsensorgroup.Where(m => m.IsDeleted == 0 && m.SensorGroupName == sensorName && m.SID != sid).ToList();
                if (doesThisPlantExist.Count == 0)
                {
                    var sensor = db.configuration_tblsensorgroup.Find(tblmc.sensorgroup.SID);
                    sensor.SensorDesc      = tblmc.sensorgroup.SensorDesc;
                    sensor.SensorGroupName = sensorName;
                    sensor.ModifiedBy      = ViewBag.roleid;
                    sensor.ModifiedOn      = DateTime.Now;
                    db.Entry(sensor).State = EntityState.Modified;
                    db.SaveChanges();
                    TempData["toaster_success"] = "Data Updated successfully";
                    return(RedirectToAction("IndexSensorGroup"));
                }
                else
                {
                    TempData["toaster_warning"] = "This Record Already Exists";
                    return(View(tblmc));
                }
            }
        }
        public string Fetchsensor(int MID)
        {
            string res = "";
            List <cbmparametermodel> cbmlist = new List <cbmparametermodel>();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                var sensordata = (from sensor in db.configurationtblmachinesensors
                                  where sensor.MachineId == MID
                                  select sensor.Sid).Distinct().ToList();
                foreach (var sensordatarow in sensordata)
                {
                    var sensormasterdata = (from sensormaster in db.configurationtblsensormasters
                                            where sensormaster.Sid == sensordatarow
                                            select new
                    {
                        Value = sensormaster.SMID,
                        Text = sensormaster.SensorDesc
                    }).ToList();

                    foreach (var item in sensormasterdata)
                    {
                        cbmparametermodel obj = new cbmparametermodel();
                        obj.Value = item.Value;
                        obj.Text  = item.Text;
                        cbmlist.Add(obj);
                    }
                }
                res = JsonConvert.SerializeObject(cbmlist);
                return(res);
            }
        }
        //Update IsDeleted = 1 to mark it as Deleted Role.
        public ActionResult Delete(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }

            int UserID1 = Convert.ToInt32(Session["UserID"].ToString());

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                tblmodule tblModule = db.tblmodules.Find(id);
                tblModule.IsDeleted       = 1;
                tblModule.ModifiedBy      = UserID1;
                tblModule.ModifiedOn      = System.DateTime.Now;
                db.Entry(tblModule).State = EntityState.Modified;
                db.SaveChanges();

                //Updating in module helper
                int ID = Convert.ToInt32(tblModule.ModuleId);
                tblrolemodulelink module = db.tblrolemodulelinks.Where(m => m.ModuleID == ID).FirstOrDefault();
                module.IsDeleted       = 1;
                module.ModifiedBy      = UserID1;
                module.ModifiedOn      = System.DateTime.Now;
                db.Entry(module).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
        }
        public ActionResult EditSensorMaster(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                configurationtblsensormaster tblmc = db.configurationtblsensormasters.Find(id);
                if (tblmc == null)
                {
                    return(HttpNotFound());
                }
                ViewBag.Unit            = new SelectList(db.tblunits.Where(m => m.IsDeleted == 0), "U_id", "Unit", tblmc.Unitid).ToList();
                ViewBag.SensorGroupName = new SelectList(db.configuration_tblsensorgroup.ToList().Where(m => m.IsDeleted == 0), "SID", "SensorGroupName", tblmc.Sid).ToList();
                ViewBag.SensorDataLink  = new SelectList(db.configurationtblsensordatalinks.Where(m => m.IsDeleted == 0 && m.IsSensor == 1), "ParameterTypeID", "parametername", tblmc.parametertypeid).ToList();
                SensorMaster sd = new SensorMaster();
                sd.sensormaster = tblmc;
                return(View(sd));
            }
        }
Example #7
0
        public ActionResult Create(PlantModel tblp)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username  = Session["Username"].ToString();
            string plantName = tblp.Plant.PlantName.ToString();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                var doesThisPlantExist = db.tblplants.Where(m => m.IsDeleted == 0 && m.PlantName == plantName).ToList();
                if (doesThisPlantExist.Count == 0)
                {
                    tblp.Plant.CreatedBy = 1;
                    tblp.Plant.CreatedOn = DateTime.Now;
                    tblp.Plant.IsDeleted = 0;
                    db.tblplants.Add(tblp.Plant);
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
                else
                {
                    Session["Error"] = "Plant Name" + " " + tblp.Plant.PlantName + " already Exists.";
                    return(View(tblp));
                }
            }
        }
        //Get Method
        public ActionResult EditSensorDataLink(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                configurationtblsensordatalink tblmc = db.configurationtblsensordatalinks.Find(id);
                if (tblmc == null)
                {
                    return(HttpNotFound());
                }
                ViewBag.FrequencyUnit = new SelectList(db.tblunits.Where(m => m.IsDeleted == 0), "U_id", "Unit", tblmc.LogFreqUnitID).ToList();
                ViewBag.Unit          = new SelectList(db.tblunits.Where(m => m.IsDeleted == 0), "U_id", "Unit", tblmc.LogFreqUnitID).ToList();
                ViewBag.Axis          = new SelectList(db.tbl_axisdet.Where(m => m.IsDeleted == 0), "AxisDetID", "AxisID", tblmc.AxisID).ToList();
                SensorDataLink sd = new SensorDataLink();
                sd.sensordatalink = tblmc;
                return(View(sd));
            }
        }
        public string UpdateDat(string UserName, string Password, string DisplayName, int RoleID1, int RoleID2, int userid)
        {
            string res           = "";
            var    doesThisExist = condb.tblusers.Where(m => m.IsDeleted == 0 && m.UserName == UserName && m.Password == Password && m.DisplayName == DisplayName && m.UserID != userid && m.PrimaryRole == RoleID1 && m.SecondaryRole == RoleID2).ToList();

            if (doesThisExist.Count == 0)
            {
                using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
                {
                    var UserData = condb.tblusers.Find(userid);

                    UserData.UserName           = UserName;
                    UserData.Password           = Password;
                    UserData.DisplayName        = DisplayName;
                    UserData.PrimaryRole        = RoleID1;
                    UserData.ModifiedBy         = userid;
                    UserData.SecondaryRole      = RoleID2;
                    UserData.ModifiedOn         = DateTime.Now;
                    condb.Entry(UserData).State = EntityState.Modified;
                    condb.SaveChanges();
                    res = "Success";
                }
            }
            return(res);
        }
        public ActionResult Delete(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();
            int    UserID1  = id;
            int    UserID   = Convert.ToInt32(Session["UserId"]);

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                var tblpm = db.configuration_tblsensorgroup.Where(m => m.SID == id).FirstOrDefault();
                //tblpmchecklist tblpm = db.tblpmchecklists.Find(id);
                tblpm.IsDeleted       = 1;
                tblpm.ModifiedBy      = UserID;
                tblpm.ModifiedOn      = DateTime.Now;
                db.Entry(tblpm).State = EntityState.Modified;
                db.SaveChanges();
                TempData["toaster_success"] = "Data Deleted successfully";
                return(RedirectToAction("IndexSensorGroup"));
            }
        }
        public ActionResult CreateShops(ShopModel shop)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            //shop name validation
            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                string shopname           = shop.Shops.ShopName.ToString();
                var    doesThisShopExists = db.tblshops.Where(m => m.IsDeleted == 0 && m.PlantID == shop.Shops.PlantID && m.ShopName == shopname).ToList();
                if (doesThisShopExists.Count == 0)
                {
                    shop.Shops.CreatedBy = 1;
                    shop.Shops.CreatedOn = DateTime.Now;
                    shop.Shops.IsDeleted = 0;
                    db.tblshops.Add(shop.Shops);
                    db.SaveChanges();
                }
                else
                {
                    ViewBag.PlantID  = new SelectList(db.tblplants.Where(m => m.IsDeleted == 0), "PlantID", "PlantName", shop.Shops.PlantID).ToList();
                    Session["Error"] = "Shop Name: " + shop.Shops.ShopName + " already exists for this Plant :" + db.tblplants.Where(m => m.PlantID == shop.Shops.PlantID && m.IsDeleted == 0).Select(m => m.PlantDisplayName).FirstOrDefault();
                    return(View(shop));
                }
                return(RedirectToAction("ShopList"));
            }
        }
        public ActionResult Create(RolesModel tblrole)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username      = Session["Username"].ToString();
            var    DuplicateRole = db.tblroles.Where(m => m.IsDeleted == 0 && m.RoleName == tblrole.Role.RoleName).FirstOrDefault();

            if (DuplicateRole == null)
            {
                //  Update Role data with other required fields.
                int UserID = Convert.ToInt32(Session["UserId"]);
                tblrole.Role.CreatedBy = UserID;
                tblrole.Role.CreatedOn = System.DateTime.Now;
                tblrole.Role.IsDeleted = 0;

                using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
                {
                    db.tblroles.Add(tblrole.Role);
                    db.SaveChanges();
                }
            }
            else
            {
                Session["Error"] = "Duplicate Role : " + tblrole.Role.RoleName;
                return(View(tblrole));
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Create(ShiftMethodModel objtblshiftMethod)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }

            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username        = Session["Username"].ToString();
            int    UserID          = Convert.ToInt32(Session["UserId"]);
            string var_shiftmethod = objtblshiftMethod.ShiftMethod.ShiftMethodName;

            using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
            {
                var does_shiftmethod_name_Exists = condb.tblshiftmethods.Where(m => m.IsDeleted == 0 && m.ShiftMethodName == var_shiftmethod).ToList();
                if (does_shiftmethod_name_Exists.Count == 0)
                {
                    objtblshiftMethod.ShiftMethod.CreatedBy = UserID;
                    objtblshiftMethod.ShiftMethod.IsDeleted = 0;
                    objtblshiftMethod.ShiftMethod.CreatedOn = DateTime.Now;
                    condb.tblshiftmethods.Add(objtblshiftMethod.ShiftMethod);
                    condb.SaveChanges();
                }
                else
                {
                    TempData["Error"] = "Shift Method Exists.";
                    return(View(objtblshiftMethod));
                }
                TempData["toaster_success"] = "Data Saved successfully";
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Edit(int id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
            {
                var pmd   = condb.configuration_tblpmchecklist.Where(m => m.pmcid == id).Select(m => m.pmcpID).FirstOrDefault();
                var tblpm = condb.configuration_tblpmchecklist.Where(m => m.pmcid == id).FirstOrDefault();

                var tbl = condb.configuration_tblpmchecklist.Where(m => m.pmcid == id || m.pmcpID == pmd && m.Isdeleted == 0).ToList();
                if (tbl == null)
                {
                    return(HttpNotFound());
                }
                List <PmCheckList> obj = new List <PmCheckList>();
                foreach (var item in tbl)
                {
                    PmCheckList pm1 = new PmCheckList();
                    ViewBag.plant            = new SelectList(condb.tblplants.ToList().Where(p => p.IsDeleted == 0), "PlantID", "PlantName", item.PlantID).ToList();
                    ViewBag.shop             = new SelectList(condb.tblshops.ToList().Where(d => d.IsDeleted == 0), "ShopId", "ShopName", item.ShopID).ToList();
                    ViewBag.cell             = new SelectList(condb.tblcells.ToList().Where(d => d.IsDeleted == 0), "CellID", "CellName", item.CellID).ToList();
                    ViewBag.TypeOfCheckPoint = new SelectList(condb.configuration_tblpmcheckpoint.ToList().Where(d => d.Isdeleted == 0), "pmcpID", "TypeOfCheckPoint", item.pmcpID).ToList();
                    pm1.pmchecklist          = item;
                    obj.Add(pm1);
                }
                return(View(obj));
            }
        }
        public string update1(int plant, int shop, int cell, string value, string frequency, int pmcpid, int pmcid, string checklist, string How)
        {
            string res = "";

            using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
            {
                var tblpc = condb.configuration_tblpmchecklist.Find(pmcid);

                tblpc.Isdeleted          = 0;
                tblpc.PlantID            = plant;
                tblpc.ShopID             = shop;
                tblpc.CellID             = cell;
                tblpc.pmcpID             = pmcpid;
                tblpc.Value              = value;
                tblpc.How                = How;
                tblpc.Frequency          = frequency;
                tblpc.CheckList          = checklist;
                tblpc.ModifiedBy         = 1;
                tblpc.ModifiedOn         = DateTime.Now;
                condb.Entry(tblpc).State = EntityState.Modified;
                condb.SaveChanges();
                res = "Success";
                return(res);
            }
        }
        public string DeleteOperatorDetails(int id)
        {
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();
            int    UserID   = Convert.ToInt32(Session["UserID"]);

            //ViewBag.IsConfigMenu = 0;


            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                tblOperatorLoginDetail obj = db.tblOperatorLoginDetails.Find(id);
                obj.isDeleted       = 1;
                db.Entry(obj).State = EntityState.Modified;
                db.SaveChanges();
            }

            var mac = db.tblOperatorMachineDetails.Where(m => m.operatorLoginId == id).ToList();

            if (mac.Count != 0)
            {
                foreach (var ec in mac)
                {
                    ec.isDeleted = 1;
                    db.SaveChanges();
                }
            }
            return("Deleted");
        }
        public ActionResult EditOperatorLogin(int Id)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }

            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username = Session["Username"].ToString();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                tblOperatorLoginDetail operatorLoginDetail = db.tblOperatorLoginDetails.Find(Id);
                if (operatorLoginDetail == null)
                {
                    return(HttpNotFound());
                }

                ViewBag.Roles          = new SelectList(db.tblroles.Where(m => m.IsDeleted == 0 && (m.Role_ID == 6 || m.Role_ID == 9)), "Role_ID", "RoleName", operatorLoginDetail.roleId).ToList();
                ViewBag.machineDetails = new SelectList(db.tblmachinedetails.Where(m => m.IsDeleted == 0), "MachineID", "MachineName").ToList();
                ViewBag.mac            = String.Join(",", db.tblOperatorMachineDetails.Where(m => m.isDeleted == 0 && m.operatorLoginId == operatorLoginDetail.operatorLoginId).Select(m => m.machineId).ToList());
                OperatorLogin op = new OperatorLogin();
                op.operatorLogin = operatorLoginDetail;
                return(View(op));
            }
        }
        public ActionResult CreateSensorGroup(sensormodel tblp)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            String Username   = Session["Username"].ToString();
            string sensorName = tblp.sensorgroup.SensorGroupName.ToString();

            using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
            {
                var doesThisExist = db.configuration_tblsensorgroup.Where(m => m.IsDeleted == 0 && m.SensorGroupName == sensorName).ToList();
                if (doesThisExist.Count == 0)
                {
                    tblp.sensorgroup.CreatedBy = ViewBag.roleid;
                    tblp.sensorgroup.CreatedOn = DateTime.Now;
                    tblp.sensorgroup.IsDeleted = 0;
                    db.configuration_tblsensorgroup.Add(tblp.sensorgroup);
                    db.SaveChanges();
                    TempData["toaster_success"] = "Data Saved successfully";
                    return(RedirectToAction("IndexSensorGroup"));
                }
                else
                {
                    TempData["toaster_warning"] = "This Record Already Exists";
                    return(View(tblp));
                }
            }
        }
 //public JsonResult FetchMachine(int SID)
 //{
 //    using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
 //    {
 //        var SensorData = (from row in db.configuration_tblSensorgroup
 //                        where row.IsDeleted == 0 && row.SID == SID
 //                        select new { Value = row.SID, Text = row.SensorGroupName }).ToList();
 //        return Json(SensorData, JsonRequestBehavior.AllowGet);
 //    }
 //}
 public JsonResult GetmachinesensorById(int Id)
 {
     using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
     {
         var Data = db.configurationtblmachinesensors.Where(m => m.MSID == Id).Select(m => new { ipaddress = m.IPAddress, portno = m.PortNo });
         return(Json(Data, JsonRequestBehavior.AllowGet));
     }
 }
 //Getting all the values stored in database
 public JsonResult GetSensorById(int Id)
 {
     using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
     {
         var Data = db.configurationtblsensordatalinks.Where(m => m.ParameterTypeID == Id).Select(m => new { paramname = m.ParameterName, paramdesc = m.ParameterDesc, isaxis = m.IsAxis, issensor = m.IsSensor, lsl = m.LSL, usl = m.USL, logfreq = m.LogFrequency, element = m.Element, subelement = m.SubElement, deterioration = m.Deterioration });
         return(Json(Data, JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult GetSensorById(int Id)
 {
     using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
     {
         var Data = db.configuration_tblsensorgroup.Where(m => m.SID == Id).Select(m => new { sensorname = m.SensorGroupName, sensordesc = m.SensorDesc });
         return(Json(Data, JsonRequestBehavior.AllowGet));
     }
 }
        public JsonResult Operatordata(int Id)
        {
            ViewBag.id = Id;
            i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1();
            var Data = db.tbloperatordetails.Where(m => m.isDeleted == 0 && m.OPID == Id).Select(m => new { OPID = m.OPID, Dept = m.Dept, OperatorName = m.OperatorName, OperatorID = m.OperatorID });

            return(Json(Data, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetpartsManagementdata(int Id)
        {
            ViewBag.id = Id;
            i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1();
            var Data = db.tblparts.Where(m => m.IsDeleted == 0 && m.PartID == Id).Select(m => new { Pid = m.PartID, partname = m.FGCode, Operationum = m.OperationNo, StdMinorLoss = m.IdealCycleTime, IdealCycleTime = m.IdealCycleTime, UnitDesc = m.UnitDesc, pid = Id });

            return(Json(Data, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetModuleById(int Id)
        {
            i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1();

            var Data = db.tblmodules.Where(m => m.ModuleId == Id).Select(m => new { Module = m.Module, ModuleDesc = m.ModuleDesc, ModuleDisplay = m.ModuleDispName });

            return(Json(Data, JsonRequestBehavior.AllowGet));
        }
Example #25
0
 public JsonResult GetcheckpointById(int Id)
 {
     using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
     {
         var Data = condb.configuration_tblpmcheckpoint.Where(m => m.CellID == Id).Select(m => new { pmcpid = m.pmcpID, plant = m.PlantID, shop = m.ShopID, cell = m.CellID, typeofcheckpoint = m.TypeofCheckpoint, frequency = m.frequency, value = m.Value, checklist = m.CheckList, how = m.How });
         return(Json(Data, JsonRequestBehavior.AllowGet));
     }
 }
 public ActionResult CreateOperatorLogin()
 {
     using (i_facility_shaktiEntities1 db = new i_facility_shaktiEntities1())
     {
         ViewBag.Roles          = new SelectList(db.tblroles.Where(m => m.IsDeleted == 0 && (m.Role_ID == 6 || m.Role_ID == 9)), "Role_ID", "RoleName").ToList();
         ViewBag.machineDetails = new SelectList(db.tblmachinedetails.Where(m => m.IsDeleted == 0), "MachineID", "MachineName").ToList();
         return(View());
     }
 }
Example #27
0
 public JsonResult FetchMachine(int CID)
 {
     using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
     {
         var MachineData = (from row in condb.tblmachinedetails
                            where row.IsDeleted == 0 && row.CellID == CID
                            select new { Value = row.MachineID, cell = row.CellID, Text = row.MachineDisplayName }).ToList();
         return(Json(MachineData, JsonRequestBehavior.AllowGet));
     }
 }
Example #28
0
 public JsonResult FetchCell(int SID)
 {
     using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
     {
         var CellData = (from row in condb.tblcells
                         where row.IsDeleted == 0 && row.ShopID == SID
                         select new { Value = row.CellID, Text = row.CelldisplayName }).ToList();
         return(Json(CellData, JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult FetchCheckPoint(int CID)
 {
     using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
     {
         var checkPointData = (from row in condb.configuration_tblpmcheckpoint
                               where row.Isdeleted == 0 && row.CellID == CID
                               select new { Value = row.pmcpID, Text = row.TypeofCheckpoint }).ToList();
         return(Json(checkPointData, JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult FetchShop(int PID)
 {
     using (i_facility_shaktiEntities1 condb = new i_facility_shaktiEntities1())
     {
         var checkPointData = (from row in condb.tblshops
                               where row.IsDeleted == 0 && row.PlantID == PID
                               select new { Value = row.ShopID, Text = row.ShopName }).ToList();
         return(Json(checkPointData, JsonRequestBehavior.AllowGet));
     }
 }