public IHttpActionResult UpdateOperator(string mobileNo, Operator OPerator) { try { var operatorBO = new OperatorBO(); var operatorObj = operatorBO.GetOperator(new Operator { MobileNo = mobileNo }); if (operatorObj != null) { operatorObj.OperatorName = OPerator.OperatorName; operatorObj.Password = OPerator.Password; var result = operatorBO.SaveOperator(operatorObj); if (result) { return(Ok(UTILITY.SUCCESSMSG)); } else { return(BadRequest()); } } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult SaveOperator(Operator OPerator) { try { OPerator.CreatedBy = UTILITY.DEFAULTUSER; OPerator.ModifiedBy = UTILITY.DEFAULTUSER; if (OPerator.AddressList != null && OPerator.AddressList.Count > 0) { OPerator.AddressList.ForEach(x => { x.AddressLinkId = OPerator.OperatorID; x.AddressType = "Operator"; x.CreatedBy = UTILITY.DEFAULTUSER; x.CreatedOn = DateTime.Now; x.ModifiedBy = UTILITY.DEFAULTUSER; x.ModifiedOn = DateTime.Now; x.IsActive = true; }); } var result = new OperatorBO().SaveOperator(OPerator); if (result) { return(Ok(UTILITY.SUCCESSMSG)); } else { return(BadRequest()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult SaveOperatorNotifications(OperatorNotifications operatorNotifications) { try { var result = new OperatorBO().SaveOperatorNotifications(operatorNotifications); return(Ok(result)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult IsOperatorValid(string operatorId) { try { int IsOperatorExists = new OperatorBO().IsOperatorValid(operatorId); return(Ok(IsOperatorExists)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult ChangePassword(OperatorPasssword operatorPasssword) { try { var result = new OperatorBO().UpdateOperatorPassword(operatorPasssword); return(Ok(result)); } catch (Exception ex) { return(Ok(false)); } }
public static ICriteria GetCriteriaForEmptyLegs(NameValueCollection pars) { ICriteria cr = NHibernateHelper.GetCurrentSession().CreateCriteria(typeof(EmptyLeg)); if (!HttpContext.Current.User.IsInRole("Admin") && !HttpContext.Current.User.IsInRole("Operators")) { cr.Add(Restrictions.IsNull("AcceptedOffer")); } Operator o = OperatorBO.GetLoggedinOperator(); if (o != null) { cr.CreateCriteria("Aircraft").Add(Restrictions.Eq("Vendor", o)); } if (pars.Get("operator") != null) { cr.CreateCriteria("Aircraft").CreateCriteria("Vendor").Add(Restrictions.Like("CompanyName", pars.Get("operator"), MatchMode.Anywhere)); } if (pars.Get("source") != null) { cr.CreateCriteria("Source") .Add(Restrictions.Disjunction() .Add(Restrictions.Like("AirfieldName", pars.Get("source"), MatchMode.Anywhere)) .Add(Restrictions.Eq("ICAOCODE", pars.Get("source"))) .Add(Restrictions.Eq("City", pars.Get("source"))) ); } if (pars.Get("destination") != null) { cr.CreateCriteria("Destination") .Add(Restrictions.Disjunction() .Add(Restrictions.Like("AirfieldName", pars.Get("destination"), MatchMode.Anywhere)) .Add(Restrictions.Eq("ICAOCODE", pars.Get("destination"))) .Add(Restrictions.Eq("City", pars.Get("destination"))) ); } if (pars.Get("status") != null) { cr.Add(Restrictions.Eq("Status", Int32.Parse(pars.Get("status")))); } else { cr.Add(Restrictions.Eq("Status", 1)); } cr.AddOrder(new Order("PostedOn", false)); return(cr); }
public static ICriteria GetCriteriaForFixedPriceCharters(NameValueCollection pars) { ICriteria cr = NHibernateHelper.GetCurrentSession().CreateCriteria(typeof(FixedPriceCharter)); Operator o = OperatorBO.GetLoggedinOperator(); if (o != null) { cr.CreateCriteria("Aircraft").Add(Restrictions.Eq("Vendor", o)); } if (pars.Get("operator") != null) { cr.CreateCriteria("Aircraft").CreateCriteria("Vendor").Add(Restrictions.Like("CompanyName", pars.Get("operator"), MatchMode.Anywhere)); } if (pars.Get("source") != null) { cr.CreateCriteria("Source") .Add(Restrictions.Disjunction() .Add(Restrictions.Like("AirfieldName", pars.Get("source"), MatchMode.Anywhere)) .Add(Restrictions.Eq("ICAOCODE", pars.Get("source"))) .Add(Restrictions.Eq("City", pars.Get("source"))) ); } if (pars.Get("destination") != null) { cr.CreateCriteria("Destination") .Add(Restrictions.Disjunction() .Add(Restrictions.Like("AirfieldName", pars.Get("destination"), MatchMode.Anywhere)) .Add(Restrictions.Eq("ICAOCODE", pars.Get("destination"))) .Add(Restrictions.Eq("City", pars.Get("destination"))) ); } if (pars.Get("status") != null) { cr.Add(Restrictions.Eq("Status", Int32.Parse(pars.Get("status")))); } else { cr.Add(Restrictions.Eq("Status", 1)); } cr.AddOrder(new Order("PostedOn", false)); return(cr); }
public IHttpActionResult OperatorInfo(string operatorID) { try { var OPerator = new OperatorBO().GetOperatorDetails(operatorID); if (OPerator != null) { return(Ok(OPerator)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult OperatorList() { try { var result = new OperatorBO().GetOperatorList(); if (result != null) { return(Ok(result)); } else { return(BadRequest()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult DetachOperatorwisedrivervehicleattachedlist(OperatorWiseDriverVehicleAttachedTodayList operatorWiseDriverVehicleAttachedTodayList) { try { var result = new OperatorBO().DetachOperatorwisedrivervehicleattachedlist(operatorWiseDriverVehicleAttachedTodayList); if (result == true) { return(Ok(new { Status = UTILITY.SUCCESSMESSAGE })); } else { return(Ok(new { Status = UTILITY.FAILEDMESSAGE })); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult OperatorList() { try { var operatorList = new OperatorBO().GetList(); if (operatorList != null) { return(Ok(operatorList)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult OperatorWiseDriverVehicleAttachedTodayList() { try { var MOBILENO = HttpContext.Current.Request.Headers["MOBILENO"]; var driverList = new OperatorBO().GetOperatorWiseDriverVehicleAttachedTodayList(MOBILENO); if (driverList != null) { return(Ok(new { Status = UTILITY.SUCCESSMESSAGE, driverList })); } else { return(Ok(new { Status = UTILITY.FAILEDMESSAGE })); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult OperatorWisebankList() { try { var MOBILENO = HttpContext.Current.Request.Headers["MOBILENO"]; var driverList = new OperatorBO().GetOperatorWiseBankList(MOBILENO); if (driverList != null) { return(Ok(driverList)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult Forgotpassword(string MobileNo) { ForgotPassword forgotPassword = new ForgotPassword(); //var MobileNo = HttpContext.Current.Request.Headers["MOBILENO"]; var OPerator = new OperatorBO().GetOperator(new Operator { MobileNo = MobileNo }); if (OPerator != null) { OPerator.Password = forgotPassword.NewPassword; new OperatorBO().SaveOperator(OPerator); return(Ok("Password updated...!")); } else { return(NotFound()); } }
public IHttpActionResult DeleteOperator(string operatorID) { try { var result = new OperatorBO().DeleteOperator(new Operator { OperatorID = operatorID }); if (result) { return(Ok(UTILITY.DELETEMSG)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult OperatorDetails(string mobileNo) { try { var operatorBO = new OperatorBO(); var operatorObj = operatorBO.GetOperator(new Operator { MobileNo = mobileNo }); if (operatorObj != null) { return(Ok(operatorObj)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult LookUpData() { try { var lookupList = new LookUpBO().GetList(); var genderOptions = lookupList.Where(x => x.LookupCategory == "Gender").ToList(); var maritalOptions = lookupList.Where(x => x.LookupCategory == "MaritalStatus").ToList(); var attachments = lookupList.Where(x => x.LookupCategory == "DriverAttachments").ToList(); var OperatorList = new OperatorBO().GetOperatorList(); return(Ok(new { genderOptions = genderOptions, maritalOptions = maritalOptions, attachments = attachments, OperatorList = OperatorList })); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult CheckMobile(string mobile) { try { bool result = false; // var mobile = HttpContext.Current.Request.Headers["MOBILENO"]; var operatorList = new OperatorBO().GetList(); if (operatorList != null) { result = operatorList.Where(x => x.MobileNo == mobile).ToList().Count() > 0; return(Ok(result)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
protected void Page_Load(object sender, EventArgs e) { BookRequest b = BookRequestDAO.FindBookRequestByID((long)28); Response.Write(GetBidJson(b, OperatorBO.GetLoggedinOperator())); }