示例#1
0
 public static List <Hanger> GetHangers()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Hangers.ToList());
     }
 }
示例#2
0
 public static bool UpdateProfile(int UID, UserMaster update)
 {
     try
     {
         if (UID > 0)
         {
             using (DBContextDataContext db = new DBContextDataContext())
             {
                 List <UserMaster> profile = db.UserMasters.Where(x => x.UID == UID).ToList();
                 foreach (UserMaster row in profile)
                 {
                     row.FirstName        = update.FirstName;
                     row.LastName         = update.LastName;
                     row.Age              = update.Age;
                     row.Gender           = update.Gender;
                     row.DoB              = update.DoB;
                     row.ContactNumber    = update.ContactNumber;
                     row.AltContactNumber = update.AltContactNumber;
                     row.EMail            = update.EMail;
                 }
                 db.SubmitChanges();
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     { return(false); }
 }
示例#3
0
 public static List <Plane> GetPlanes()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Planes.ToList());
     }
 }
 public static bool RegisterUser(Cts_User_Master userDetails)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         try
         {
             var check = db.Cts_User_Masters.Where(x => x.um_userId == userDetails.um_userId).ToList();
             if (check.Count == 0)
             {
                 db.Cts_User_Masters.InsertOnSubmit(userDetails);
                 db.SubmitChanges();
                 if (userDetails.um_id > 0)
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
             else
             {
                 return(false);
             }
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
 public static bool UpdateProfile(int umId, Cts_User_Master update)
 {
     try
     {
         if (umId > 0)
         {
             using (DBContextDataContext db = new DBContextDataContext())
             {
                 List <Cts_User_Master> profile = db.Cts_User_Masters.Where(x => x.um_id == umId).ToList();
                 foreach (Cts_User_Master row in profile)
                 {
                     row.um_firstName  = update.um_firstName;
                     row.um_lastName   = update.um_lastName;
                     row.um_contact    = update.um_contact;
                     row.um_PerAddress = update.um_PerAddress;
                     row.um_CorAddress = update.um_CorAddress;
                     row.um_emailId    = update.um_emailId;
                 }
                 db.SubmitChanges();
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     { return(false); }
 }
 public static List <Cts_User_Master> UserProfile(int userid)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_User_Masters.Where(x => x.um_id == userid).ToList());
     }
 }
示例#7
0
 public static List <UserMaster> GetPilots()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.UserMasters.ToList());
     }
 }
 public static List <Cts_BranchMaster> GetWarehouse()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_BranchMasters.Where(x => x.bm_branchName != null).ToList());
     }
 }
        public static bool EditManager(int id, string add, string add1, string city, string state, long code)
        {
            try
            {
                using (DBContextDataContext db = new DBContextDataContext())
                {
                    List <Hanger> hanger = db.Hangers.Where(x => x.Hanger_ID == id).ToList();

                    foreach (Hanger hng in hanger)
                    {
                        hng.Manager_Address_Line_1 = add;
                        hng.Manager_Address_Line_2 = add1;
                        hng.City     = city;
                        hng.State    = state;
                        hng.Zip_Code = code;
                    }
                    db.SubmitChanges();
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
 public static List <Cts_Package> UserPackageUpdateStatus()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_Packages.Where(x => x.pk_isActive == true && x.pk_Package_Status != "Delivered").ToList());
     }
 }
示例#11
0
 public static List <Plane> Getplane(int id)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Planes.Where(x => x.Plane_ID == id).ToList());
     }
 }
示例#12
0
 public static List <hangerallot> Gethang()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.hangerallots.ToList());
     }
 }
 public static List <Cts_Package> PackageStatus()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_Packages.Where(x => x.pk_Package_Status != "Delivered").ToList());
     }
 }
 public static List <Cts_Package> UserPackageStatus()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_Packages.Where(x => x.pk_isActive == null).ToList());
     }
 }
示例#15
0
 public static List <UserMaster> GetPendingList()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.UserMasters.Where(x => x.IsActive == null).ToList());
     }
 }
示例#16
0
 public static List <Cts_User_Master> ValidateUser(string userid, string password)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_User_Masters.Where(x => x.um_userId == userid && x.um_password == password).ToList());
     }
 }
示例#17
0
 public static List <UserMaster> ValidatePilot(string userid, string password)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.UserMasters.Where(x => x.UserName == userid && x.Password == password).ToList());
     }
 }
示例#18
0
 public static bool UpdateProfile(int UID, UserMaster update)
 {
     try
     {
         if (UID > 0)
         {
             using (DBContextDataContext db = new DBContextDataContext())
             {
                 List <UserMaster> profile = db.UserMasters.Where(x => x.UID == UID).ToList();
                 foreach (UserMaster row in profile)
                 {
                     row.LicenseNumber = update.LicenseNumber;
                     row.AddressLine1  = update.AddressLine1;
                     row.AddressLine2  = update.AddressLine2;
                     row.City          = update.City;
                     row.State         = update.State;
                     row.ZipCode       = update.ZipCode;
                     row.SSN           = update.SSN;
                 }
                 db.SubmitChanges();
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     { return(false); }
 }
示例#19
0
 public static List <UserMaster> PilotProfile(string userid)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.UserMasters.Where(x => x.UserName == userid).ToList());
     }
 }
 public static List <Cts_Package> GetAllPackageDetails()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.Cts_Packages.ToList());
     }
 }
示例#21
0
 public static List <GetHangerStatusResult> GetHangerStatus()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         return(db.GetHangerStatus().ToList());
     }
 }
示例#22
0
 public static List <string> DisplayPlaneS()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         var res = db.Planes.Select(s => s.Plane_ID + "-" + s.Owner_ID).ToList();
         return(res);
     }
 }
示例#23
0
 public static List <string> DisplayHangers()
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         var res = db.Hangers.Select(s => s.Hanger_ID + "-" + s.Manager_ID).ToList();
         return(res);
     }
 }
示例#24
0
 public static List <Hanger> ManageHangers()
 {
     //try
     //{
     using (DBContextDataContext db = new DBContextDataContext())
     {
         var man = db.Hangers;
         return(man.ToList());
     }
 }
示例#25
0
 public static List <Cts_Package> GetPackage(int cid)
 {
     try
     {
         using (DBContextDataContext db = new DBContextDataContext())
         {
             return(db.Cts_Packages.Where(x => x.pk_consignment_id == cid).ToList());
         }
     }
     catch (Exception ex)
     {
         return(new List <Cts_Package>());
     }
 }
示例#26
0
 public static List <Cts_Package> GetPackageId()
 {
     try
     {
         using (DBContextDataContext db = new DBContextDataContext())
         {
             return(db.Cts_Packages.Where(x => x.pk_isActive == null).ToList());
         }
     }
     catch (Exception ex)
     {
         return(new List <Cts_Package>());
     }
 }
示例#27
0
 public static List <Plane> ManagePlanes()
 {
     //try
     //{
     using (DBContextDataContext db = new DBContextDataContext())
     {
         var man = db.Planes;
         return(man.ToList());
     }
     //}
     //catch(Exception ex)
     //{
     //   return
     //}
 }
示例#28
0
 public static bool allotplanes(hangerallot rea)
 {
     if (rea.allotdetails != null)
     {
         using (DBContextDataContext db = new DBContextDataContext())
         {
             db.hangerallots.InsertOnSubmit(rea);
             db.SubmitChanges();
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
示例#29
0
 public static bool ApproveUsers(int UID, bool status)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         try
         {
             var user = db.UserMasters.Where(x => x.UID == UID).FirstOrDefault();
             user.IsActive = status;
             db.SubmitChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
 public static List <Cts_User_Master> GetPendingList(int roleId)
 {
     using (DBContextDataContext db = new DBContextDataContext())
     {
         if (roleId == 1)
         {
             return(db.Cts_User_Masters.Where(x => x.um_isActive == null && x.um_RoleId == 2).ToList());
         }
         else if (roleId == 2)
         {
             return(db.Cts_User_Masters.Where(x => x.um_isActive == null && x.um_RoleId != 2).ToList());
         }
         else
         {
             return(db.Cts_User_Masters.Where(x => x.um_isActive == null && x.um_RoleId == 4).ToList());
         }
     }
 }