Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
 public IHttpActionResult SaveOperatorNotifications(OperatorNotifications operatorNotifications)
 {
     try
     {
         var result = new OperatorBO().SaveOperatorNotifications(operatorNotifications);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Ejemplo n.º 4
0
 public IHttpActionResult IsOperatorValid(string operatorId)
 {
     try
     {
         int IsOperatorExists = new OperatorBO().IsOperatorValid(operatorId);
         return(Ok(IsOperatorExists));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Ejemplo n.º 5
0
 public IHttpActionResult ChangePassword(OperatorPasssword operatorPasssword)
 {
     try
     {
         var result = new OperatorBO().UpdateOperatorPassword(operatorPasssword);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(Ok(false));
     }
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 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));
     }
 }
Ejemplo n.º 9
0
 public IHttpActionResult OperatorList()
 {
     try
     {
         var result = new OperatorBO().GetOperatorList();
         if (result != null)
         {
             return(Ok(result));
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Ejemplo n.º 10
0
 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));
     }
 }
Ejemplo n.º 11
0
        public IHttpActionResult OperatorList()
        {
            try
            {
                var operatorList = new OperatorBO().GetList();

                if (operatorList != null)
                {
                    return(Ok(operatorList));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Ejemplo n.º 12
0
 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));
     }
 }
Ejemplo n.º 13
0
 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));
     }
 }
Ejemplo n.º 14
0
        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());
            }
        }
Ejemplo n.º 15
0
 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));
     }
 }
Ejemplo n.º 16
0
 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));
     }
 }
Ejemplo n.º 17
0
        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));
            }
        }
Ejemplo n.º 18
0
        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));
            }
        }
Ejemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BookRequest b = BookRequestDAO.FindBookRequestByID((long)28);

        Response.Write(GetBidJson(b, OperatorBO.GetLoggedinOperator()));
    }