Esempio n. 1
0
 public ActionResult CreateVehicle(FormCollection frm)
 {
     try
     {
         if (Session["logindetails"] == null)
         {
             Session.Abandon();
             return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
         }
         USP_GetUserDetails_Result logindetails = new USP_GetUserDetails_Result();
         if (Session["logindetails"] != null)
         {
             logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
         }
         usp_VehicleMasterGetByID_Result vehicle = new usp_VehicleMasterGetByID_Result();
         TryUpdateModel(vehicle);
         string result = Convert.ToString(InventoryEntities.usp_VehicleMasterInsertUpate(0, vehicle.VehicleNumber, logindetails.Company_Id,
                                                                                         logindetails.Branch_Id, DateTime.Now, logindetails.USer_Id, 0, null, vehicle.status).SingleOrDefault());
         if (result == "Duplicate Vehicle")
         {
             ModelState.AddModelError("Error", "Vehicle already exists");
             return(View());
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index"));
     }
 }
Esempio n. 2
0
        public USP_GetUserDetails_Result CheckLoginStatus(string mobileno = "", string username = "", string pwd = "")
        {
            //string   pwd="";
            USP_GetUserDetails_Result userdetails = InventoryEntities.USP_GetUserDetails(username, pwd, mobileno).FirstOrDefault();

            return(userdetails);
        }
Esempio n. 3
0
        public ActionResult CreateCylinderDetails(FormCollection frm)
        {
            try
            {
                usp_CylinderMasterGetByID_Result cylinder = new usp_CylinderMasterGetByID_Result();
                TryUpdateModel(cylinder);
                //bool b= int.TryParse(frm["WLCapacityUOMID"], out re);
                string barcode = cylinder.CylindeNumber.ToString() + cylinder.VendorID.ToString() + cylinder.VendorBranchID.ToString();


                logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
                object result = InventoryEntities.usp_CylinderMasterInsertUpdate(cylinder.CylindeNumber, barcode, cylinder.ManufacturerID,
                                                                                 cylinder.PurchaseDate, cylinder.InitialGasID, cylinder.WLCapacity,
                                                                                 cylinder.WLCapacityUOMID, cylinder.WorkingPressure, cylinder.WorkingPressureUOMID,
                                                                                 cylinder.TestDate, cylinder.NextTestDate, cylinder.ValveModelID,
                                                                                 cylinder.PresentStateID, cylinder.GasInUseID, cylinder.VendorBranchID,
                                                                                 cylinder.Size, cylinder.SizeUOMID, cylinder.CurrentLocationID, cylinder.CurrentCustomerBranchID, logindetails.Branch_Id, logindetails.Company_Id, logindetails.USer_Id, logindetails.USer_Id, cylinder.status);
                GenerateBarcode(barcode);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index"));
            }
        }
Esempio n. 4
0
        public ActionResult EditVehicle(FormCollection frm)
        {
            try
            {
                if (Session["logindetails"] == null)
                {
                    Session.Abandon();
                    return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
                }
                USP_GetUserDetails_Result logindetails = new USP_GetUserDetails_Result();
                if (Session["logindetails"] != null)
                {
                    logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
                }

                usp_VehicleMasterGetByID_Result vehicle = new usp_VehicleMasterGetByID_Result();
                TryUpdateModel(vehicle);
                string result = Convert.ToString(InventoryEntities.usp_VehicleMasterInsertUpate(vehicle.VehicleID, vehicle.VehicleNumber, logindetails.Company_Id,
                                                                                                logindetails.Branch_Id, DateTime.Now, 0, logindetails.USer_Id, DateTime.Now, vehicle.status));
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index"));
            }
        }
Esempio n. 5
0
 public ActionResult VehicleUserMappingDetails(FormCollection frm)
 {
     try {
         if (Session["logindetails"] == null)
         {
             Session.Abandon();
             return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
         }
         VehicleUserMapping vehicleUserMapping = new VehicleUserMapping();
         TryUpdateModel(vehicleUserMapping);
         logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
         string result = Convert.ToString(InventoryEntities.usp_VehicleUserMappingInsert(vehicleUserMapping.VehicleID, vehicleUserMapping.UserD, logindetails.Branch_Id, logindetails.Company_Id, logindetails.USer_Id).FirstOrDefault());
         if (result == "Vehicle Unavailable")
         {
             ModelState.AddModelError("Error", "Vehicle already assigned to the user for today");
             FillViewBag();
             return(View());
         }
         else
         {
             return(RedirectToAction("VehicleUserMappingDetails"));
         }
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Esempio n. 6
0
        private void FillViewBag()
        {
            logindetails = (USP_GetUserDetails_Result)Session["logindetails"];

            ViewBag.VehicleID = new SelectList(InventoryEntities.usp_VehicleMasterListGet(logindetails.Company_Id, logindetails.Branch_Id), "VehicleID", "VehicleNumber");
            ViewBag.UserD     = new SelectList(InventoryEntities.usp_tblUserMasterListGet(logindetails.Company_Id, logindetails.Branch_Id), "User_Id", "User_Name");
        }
        public ActionResult CheckLogin(login obj)
        {
            try
            {
                USP_GetUserDetails_Result userdetails = onlinetutor.USP_GetUserDetails(obj.loginID, obj.Password).FirstOrDefault();
                //return RedirectToAction("Index", "Category", new { area = "Admin" });
                return(Json(userdetails, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)

            {
                //   return Json(userdetails, JsonRequestBehavior.AllowGet);
                return(Content("2"));
            }
        }
        public USP_GetUserDetails_Result CheckLoginStatus(string mobileno = "", string username = "", string pwd = "")
        {
            //string   pwd="";
            USP_GetUserDetails_Result userdetails = new USP_GetUserDetails_Result();

            try
            {
                Err.ErrorLog("CheckLoginStatus called");
                userdetails = InventoryEntities.USP_GetUserDetails(username, pwd, mobileno).FirstOrDefault();
                Err.ErrorLog("CheckLoginStatus called end");
                return(userdetails);
            }
            catch (Exception ex)
            {
                Err.ErrorLog("CheckLoginStatus Error:" + ex.Message);
                return(userdetails);
            }
        }
Esempio n. 9
0
        public ActionResult Index(FormCollection frm)
        {
            try
            {
                string result = string.Empty;
                logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
                if (frm["barcodevalues"].ToString() != "")
                {
                    result = Convert.ToString(InventoryEntities.usp_tblCylinderFillInsert(frm["barcodevalues"].ToString(), logindetails.USer_Id, logindetails.Branch_Id, logindetails.Company_Id));
                }
                return(View());
            }


            catch {
                return(View());
            }
        }
Esempio n. 10
0
        //   [OutputCache(Duration =1000)]
        public ActionResult GetCylinderList()
        {
            if (Session["logindetails"] == null)
            {
                Session.Abandon();
                return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
            }
            List <usp_CylinderMasterGet_Result> cylinderlist = new List <usp_CylinderMasterGet_Result>();

            logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
            try
            {
                cylinderlist = InventoryEntities.usp_CylinderMasterGet(logindetails.Branch_Id, logindetails.Company_Id).ToList();
                return(Json(cylinderlist, JsonRequestBehavior.AllowGet));
            }

            catch (Exception ex)
            {
                return(View());
            }
        }
Esempio n. 11
0
        public ActionResult ReportCylinderAgeAnalysis(FormCollection frm)
        {
            try
            {
                if (Session["logindetails"] == null)
                {
                    Session.Abandon();
                    return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
                }
                //      USP_GetUserDetails_Result logindetails;
                logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
                CylinderRecieveDeliver cylinderRecieveDeliver = new CylinderRecieveDeliver();
                TryUpdateModel(cylinderRecieveDeliver);
                //for cylinder count location wise
                ReportViewer reportview = new ReportViewer();
                reportview.ProcessingMode      = ProcessingMode.Local;
                reportview.SizeToReportContent = true;



                List <usp_CylinderAgeAnalysisReport_Result> CylinderList = new List <usp_CylinderAgeAnalysisReport_Result>();

                CylinderList = InventoryEntities.usp_CylinderAgeAnalysisReport(cylinderRecieveDeliver.StartDate, cylinderRecieveDeliver.EndDate, logindetails.Branch_Id, logindetails.Company_Id).ToList();
                reportview.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\CylinderAgeAnalysisReport.rdlc";
                reportview.ShowToolBar            = true;
                reportview.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", CylinderList));


                ViewBag.CylinderDetails = reportview;



                return(View());
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Esempio n. 12
0
 public ActionResult EditVehicle(int VehicleID)
 {
     try {
         if (Session["logindetails"] == null)
         {
             Session.Abandon();
             return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
         }
         USP_GetUserDetails_Result logindetails = new USP_GetUserDetails_Result();
         if (Session["logindetails"] != null)
         {
             logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
         }
         usp_VehicleMasterGetByID_Result vehicle = new usp_VehicleMasterGetByID_Result();
         vehicle = InventoryEntities.usp_VehicleMasterGetByID(logindetails.Company_Id, logindetails.Branch_Id, VehicleID).SingleOrDefault();
         return(View(vehicle));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index"));
     }
 }
Esempio n. 13
0
 public ActionResult Index(LoginDetails login)
 {
     try
     {
         TryUpdateModel(login);
         string username = Request["username"];
         string password = Request["password"];
         //USP_GetUserDetails_Result logindetails= InventoryEntities.USP_GetUserDetails(login.UserName, login.Password, login.Phone).FirstOrDefault();
         USP_GetUserDetails_Result logindetails = InventoryEntities.USP_GetUserDetails(username, password, "").FirstOrDefault();
         // return View();
         if (logindetails.USer_Id == 0)
         {
             ModelState.AddModelError("Error", "Invalid User name or Password. Please try again.");
             return(View());
         }
         Session["logindetails"] = logindetails;
         return(RedirectToAction("ReportCylinderDashboard", "CylinderDetails", new { area = "CylinderDetails" }));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index"));
     }
 }
Esempio n. 14
0
 public ActionResult GetVehicleList()
 {
     try
     {
         if (Session["logindetails"] == null)
         {
             Session.Abandon();
             return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
         }
         USP_GetUserDetails_Result logindetails = new USP_GetUserDetails_Result();
         if (Session["logindetails"] != null)
         {
             logindetails = (USP_GetUserDetails_Result)Session["logindetails"];
         }
         List <usp_VehicleMasterGet_Result> users = new List <usp_VehicleMasterGet_Result>();
         users = InventoryEntities.usp_VehicleMasterGet(logindetails.Company_Id, logindetails.Branch_Id).ToList();
         return(Json(users, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Esempio n. 15
0
        public ActionResult ReportMobileWarningMessages()
        {
            try
            {
                if (Session["logindetails"] == null)
                {
                    Session.Abandon();
                    return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
                }
                //   USP_GetUserDetails_Result logindetails;
                logindetails = (USP_GetUserDetails_Result)Session["logindetails"];

                ReportViewer reportview = new ReportViewer();
                reportview.ProcessingMode      = ProcessingMode.Local;
                reportview.SizeToReportContent = true;



                List <usp_MobileWarningMsgreportGet_Result> CylinderList = new List <usp_MobileWarningMsgreportGet_Result>();

                CylinderList = InventoryEntities.usp_MobileWarningMsgreportGet(DateTime.Now.AddDays(-7), DateTime.Now, logindetails.Branch_Id, logindetails.Company_Id).ToList();
                reportview.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\MobileWarningMessages.rdlc";
                reportview.ShowToolBar            = true;
                reportview.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", CylinderList));


                ViewBag.CylinderDetails = reportview;



                return(View());
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Esempio n. 16
0
        public ActionResult ReportCylinderDashboard()
        {
            try
            {
                if (Session["logindetails"] == null)
                {
                    Session.Abandon();
                    return(RedirectToAction("Index", "UserLogin", new { area = "Login" }));
                }
                //  USP_GetUserDetails_Result logindetails;
                logindetails = (USP_GetUserDetails_Result)Session["logindetails"];

                //for cylinder count location wise
                ReportViewer reportview = new ReportViewer();
                reportview.ProcessingMode      = ProcessingMode.Local;
                reportview.SizeToReportContent = true;

                List <usp_CylinderCount_Result> CylinderListCount = new List <usp_CylinderCount_Result>();

                CylinderListCount = InventoryEntities.usp_CylinderCount(logindetails.Branch_Id, logindetails.Company_Id).ToList();
                reportview.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\CylinderCount.rdlc";
                reportview.ShowToolBar            = false;
                reportview.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", CylinderListCount));

                List <usp_CylinderCountPState_Result> CylinderCountPState = new List <usp_CylinderCountPState_Result>();

                CylinderCountPState = InventoryEntities.usp_CylinderCountPState(logindetails.Branch_Id, logindetails.Company_Id).ToList();
                //reportviewPstate.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\CylinderCountPState.rdlc";

                reportview.LocalReport.DataSources.Add(new ReportDataSource("DataSet3", CylinderCountPState));

                List <usp_CylinderCountGasInUse_Result> CylinderCountGasInUse = new List <usp_CylinderCountGasInUse_Result>();

                CylinderCountGasInUse = InventoryEntities.usp_CylinderCountGasInUse(logindetails.Branch_Id, logindetails.Company_Id).ToList();
                //reportviewPstate.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\CylinderCountPState.rdlc";

                reportview.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", CylinderCountGasInUse));

                ViewBag.CylinderDetails = reportview;



                //cylinder count Pstatewise
                //ReportViewer reportviewPstate = new ReportViewer();
                //reportview.ProcessingMode = ProcessingMode.Local;
                //reportview.SizeToReportContent = true;


                //ViewBag.reportviewPstate = reportviewPstate;

                //end


                ReportViewer reportview1 = new ReportViewer();
                reportview1.ProcessingMode      = ProcessingMode.Local;
                reportview1.SizeToReportContent = true;

                List <usp_CylinderMasterGet_Result> CylinderList = new List <usp_CylinderMasterGet_Result>();



                CylinderList = InventoryEntities.usp_CylinderMasterGet(logindetails.Branch_Id, logindetails.Company_Id).ToList();
                reportview1.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Reports\CylinderDetailLocation.rdlc";
                //locationname
                List <ReportParameter> parameters = new List <ReportParameter>();
                ReportParameter        param      = new ReportParameter();
                param.Name = "locationname";
                //parameters.Add(param);
                reportview1.LocalReport.SetParameters(param);
                reportview1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", CylinderList));
                return(View());
            }
            catch (Exception ex)
            {
                return(View());
            }
        }