public JsonResult GetAllDepartmentEmployeeName() { try { List <GetAllDepartmentEmployeeNameModel> _list = new List <GetAllDepartmentEmployeeNameModel>(); var _objDepartmentEmployeeRegistration = _DbWorkPermitSystemEntities.tbl_DepartmentEmployeeRegistration.ToList(); foreach (var item in _objDepartmentEmployeeRegistration) { GetAllDepartmentEmployeeNameModel _class = new GetAllDepartmentEmployeeNameModel(); var _objDepartmentMasterModel = _DbWorkPermitSystemEntities.tbl_DepartmentMaster.Where(p => p.DepartmentID == item.EmployeeDepartmentID).FirstOrDefault(); var _objDesignationMasterModel = _DbWorkPermitSystemEntities.tbl_DesignationMaster.Where(p => p.DesignationID == item.EmployeeDesignationID).FirstOrDefault(); _class.EmployeeSrNo = item.EmployeeSrNo; _class.EmployeeTokenNo = item.EmployeeTokenNo; _class.EmployeeName = item.EmployeeName; _class.EmployeeDepartmentID = item.EmployeeDepartmentID; _class.EmployeeDesignationID = item.EmployeeDesignationID; _class.EmployeeDepartmentName = _objDepartmentMasterModel.DepartmentName; _class.EmployeeDesignationName = _objDesignationMasterModel.DesignationName; _list.Add(_class); } return(Json(_list, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ResultModel _objResult = new ResultModel(); _objResult.success = 0; _objResult.msg = ex.ToString(); return(Json(_objResult, JsonRequestBehavior.AllowGet)); } }
public async void GetAllDepartmentEmployeeName() { try { string Url = StatusModel.Url + "GetAllDepartmentEmployeeName"; WebHelpper _objHelper = new WebHelpper(); GetAllDepartmentEmployeeNameModel _objGetAllDepartmentEmployeeNameModel = new GetAllDepartmentEmployeeNameModel(); var request = await _objHelper.MakeGetRequest(Url); ResultGetAllDepartmentEmployeeNameModel = JsonConvert.DeserializeObject <List <GetAllDepartmentEmployeeNameModel> >(request); AllDepartmentEmployeeName = new string[ResultGetAllDepartmentEmployeeNameModel.Count + 1]; int i = 1; AllDepartmentEmployeeName[0] = "--Select Department Employee Name--"; foreach (var item in ResultGetAllDepartmentEmployeeNameModel) { AllDepartmentEmployeeName[i] = item.EmployeeName; i++; } ArrayAdapter _adapterAllDepartmentEmployeeName = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, AllDepartmentEmployeeName); txt_EmployeeName.Adapter = _adapterAllDepartmentEmployeeName; } catch (Exception e) { string ErrorMsg = e.ToString(); Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show(); } }
public JsonResult GetDepartmentEmployeeInformationByTokenNo(GetAllDepartmentEmployeeNameModel collection) { try { GetAllDepartmentEmployeeNameModel _list = new GetAllDepartmentEmployeeNameModel(); var DepartmentEmployeeRegistration = _DbWorkPermitSystemEntities.tbl_DepartmentEmployeeRegistration.Where(p => p.EmployeeTokenNo == collection.EmployeeTokenNo).FirstOrDefault(); var _objDesignationMaster = _DbWorkPermitSystemEntities.tbl_DesignationMaster.Where(p => p.DesignationID == DepartmentEmployeeRegistration.EmployeeDesignationID).FirstOrDefault(); var _objDepartmentMaster = _DbWorkPermitSystemEntities.tbl_DepartmentMaster.Where(p => p.DepartmentID == DepartmentEmployeeRegistration.EmployeeDepartmentID).FirstOrDefault(); _list.EmployeeSrNo = DepartmentEmployeeRegistration.EmployeeSrNo; _list.EmployeeTokenNo = DepartmentEmployeeRegistration.EmployeeTokenNo; _list.EmployeeName = DepartmentEmployeeRegistration.EmployeeName; _list.EmployeeDepartmentID = DepartmentEmployeeRegistration.EmployeeDepartmentID; _list.EmployeeDesignationID = DepartmentEmployeeRegistration.EmployeeDesignationID; _list.EmployeeDepartmentName = _objDepartmentMaster.DepartmentName; _list.EmployeeDesignationName = _objDesignationMaster.DesignationName; return(Json(_list, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ResultModel _objResult = new ResultModel(); _objResult.success = 0; _objResult.msg = ex.ToString(); return(Json(_objResult, JsonRequestBehavior.AllowGet)); } }
public async void GetAllEmployeeDepartmentInfoByTokenNo() { try { progressDialog = ProgressDialog.Show(this, Android.Text.Html.FromHtml("<font color='#EC407A'> Please wait...</font>"), Android.Text.Html.FromHtml("<font color='#EC407A'> Checking User Info...</font>"), true); string Url = StatusModel.Url + "GetDepartmentEmployeeInformationByTokenNo"; WebHelpper _objHelper = new WebHelpper(); GetAllDepartmentEmployeeNameModel _objGetAllDepartmentEmployeeNameModel = new GetAllDepartmentEmployeeNameModel(); _objGetAllDepartmentEmployeeNameModel.EmployeeTokenNo = StatusModel.LoginUserName; var PostString = JsonConvert.SerializeObject(_objGetAllDepartmentEmployeeNameModel); var request = await _objHelper.MakePostRequest(Url, PostString, true); GetAllDepartmentEmployeeNameModel ResultGetAllDepartmentEmployeeNameModel = JsonConvert.DeserializeObject <GetAllDepartmentEmployeeNameModel>(request); lblTokenNo.Text = ResultGetAllDepartmentEmployeeNameModel.EmployeeTokenNo; lblEmployeeName.Text = ResultGetAllDepartmentEmployeeNameModel.EmployeeName; lblDepartment.Text = ResultGetAllDepartmentEmployeeNameModel.EmployeeDepartmentName; StatusModel.EmployeeDesignationName = ResultGetAllDepartmentEmployeeNameModel.EmployeeDesignationName; string Url1 = StatusModel.Url + "GetProcessRequestByUser"; WebHelpper _objHelper1 = new WebHelpper(); var PostString1 = JsonConvert.SerializeObject(ResultGetAllDepartmentEmployeeNameModel); var request1 = await _objHelper.MakePostRequest(Url1, PostString1, true); ResultListProcessRequestByDepartmentEmployeeModel = JsonConvert.DeserializeObject <List <ListProcessRequestByDepartmentEmployeeModel> >(request1); mListView.Adapter = new RPItemListForDeptEmployeeAdapter(this, ResultListProcessRequestByDepartmentEmployeeModel); progressDialog.Hide(); } catch (Exception e) { progressDialog.Hide(); string ErrorMsg = e.ToString(); Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show(); } }
public JsonResult GetProcessRequestByUser(GetAllDepartmentEmployeeNameModel collection) { try { List <ListProcessRequestByDepartmentEmployeeModel> _objListRequestProcessModel = new List <ListProcessRequestByDepartmentEmployeeModel>(); var _objAllRequestProcessModel = _DbWorkPermitSystemEntities.tbl_RequestProcess.ToList(); foreach (var item in _objAllRequestProcessModel) { if (collection.EmployeeDesignationName == "Activity Owner" && item.EmployeeDepartmentID == collection.EmployeeDepartmentID) { ListProcessRequestByDepartmentEmployeeModel _class = new ListProcessRequestByDepartmentEmployeeModel(); var _objDepartmentEmployeeRegistration = _DbWorkPermitSystemEntities.tbl_DepartmentEmployeeRegistration.Where(p => p.EmployeeSrNo == item.EmployeeId).FirstOrDefault(); _class.RequestProcessSrNo = item.RequestProcessSrNo; _class.EmployeeTokenNo = _objDepartmentEmployeeRegistration.EmployeeTokenNo; _class.EmployeeName = _objDepartmentEmployeeRegistration.EmployeeName; _class.VisitStartTime = Convert.ToDateTime(item.VisitStartTime); _class.VisitEndTime = Convert.ToDateTime(item.VisitEndTime); _class.RequestStatus = item.ActivityOwnerStatus; _objListRequestProcessModel.Add(_class); } else if (collection.EmployeeDesignationName == "Area Owner" && item.EmployeeDepartmentID == collection.EmployeeDepartmentID && item.ActivityOwnerStatus == "Accepted") { ListProcessRequestByDepartmentEmployeeModel _class = new ListProcessRequestByDepartmentEmployeeModel(); var _objDepartmentEmployeeRegistration = _DbWorkPermitSystemEntities.tbl_DepartmentEmployeeRegistration.Where(p => p.EmployeeSrNo == item.EmployeeId).FirstOrDefault(); _class.RequestProcessSrNo = item.RequestProcessSrNo; _class.EmployeeTokenNo = _objDepartmentEmployeeRegistration.EmployeeTokenNo; _class.EmployeeName = _objDepartmentEmployeeRegistration.EmployeeName; _class.VisitStartTime = Convert.ToDateTime(item.VisitStartTime); _class.VisitEndTime = Convert.ToDateTime(item.VisitEndTime); _class.RequestStatus = item.AreaOwnerStatus; _objListRequestProcessModel.Add(_class); } else if (collection.EmployeeDesignationName == "Safety" && item.ActivityOwnerStatus == "Accepted" && item.AreaOwnerStatus == "Accepted") { ListProcessRequestByDepartmentEmployeeModel _class = new ListProcessRequestByDepartmentEmployeeModel(); var _objDepartmentEmployeeRegistration = _DbWorkPermitSystemEntities.tbl_DepartmentEmployeeRegistration.Where(p => p.EmployeeSrNo == item.EmployeeId).FirstOrDefault(); _class.RequestProcessSrNo = item.RequestProcessSrNo; _class.EmployeeTokenNo = _objDepartmentEmployeeRegistration.EmployeeTokenNo; _class.EmployeeName = _objDepartmentEmployeeRegistration.EmployeeName; _class.VisitStartTime = Convert.ToDateTime(item.VisitStartTime); _class.VisitEndTime = Convert.ToDateTime(item.VisitEndTime); _class.RequestStatus = item.SafetyStatus; _objListRequestProcessModel.Add(_class); } } return(Json(_objListRequestProcessModel, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ResultModel _objResult = new ResultModel(); _objResult.success = 0; _objResult.msg = ex.ToString(); return(Json(_objResult, JsonRequestBehavior.AllowGet)); } }