public static ClsReturnValues delCargoType(int cargoTypeID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelCargoType(cargoTypeID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delLocation(int locationID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelLocation(locationID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delForms(int formID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelForms(formID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delMenuIcons(int menuIconID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelMenuIcons(menuIconID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delActiveSessions(Guid sessionID, int userID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelUserSession(sessionID, userID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delRegister(int tdoRegisterID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelRegister(tdoRegisterID).FirstOrDefault(); } return lst; }
public static ClsReturnValues changePassword(int userID, string oldPassword, string newPassword) { newPassword = Security.Encrypt(newPassword); oldPassword = Security.Encrypt(oldPassword); ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspChangePassword(userID, oldPassword, newPassword).FirstOrDefault(); } return lst; }
public static ClsReturnValues setCargoType(ClsCargoType item) { ClsReturnValues obj = new ClsReturnValues(); try { using (var db = new tdoEntities()) { obj = db.uspAddEditCargoType(item.cargoTypeID, item.cargoTypeName,item.createdByID,item.sessionID).FirstOrDefault(); } } catch (Exception ex) { obj.Response = ex.Message; obj.IsSuccess = false; obj.ID = 0; } return obj; }
public static ClsReturnValues setRegister(ClsRegister obj) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditRegister(obj.tdoRegisterID,obj.jobNumber,obj.dateReceived,obj.expiryDate,obj.status,obj.cargoTypeID,obj.fileRef,obj.destinationID, obj.terminalID,obj.containerNo,obj.returnTerminal,obj.truckID,obj.tdoReceiptDate,obj.schDelDate,obj.loadingTime,obj.dispatchTime, obj.remarks,obj.createdByID,obj.sessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setForms(ClsForms obj) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditForms(obj.formID,obj.menuItemID,obj.formName,obj.formDescription,obj.createdByID, obj.sessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delTruck(int truckID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelTruck(truckID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setUserSessionHistory(ClsUserSessionHistory item) { ClsReturnValues obj = new ClsReturnValues(); try { using (var db = new tdoEntities()) { obj = db.uspAddEditUserSessionHistory(item.sessionID, item.userID, item.logoutDate, item.isActive, item.deviceType, item.deviceName, item.browser).FirstOrDefault(); } } catch (Exception ex) { obj.Response = ex.Message; obj.IsSuccess = false; obj.ID = 0; } return obj; }
public static ClsReturnValues setUsersGroup(ClsUserGroups obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditUserGroups(obj.userGroupID, obj.groupName, obj.description ?? "", obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues delUsersGroup(int usersGroupId) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspDelUsergroup(usersGroupId).FirstOrDefault(); } return lst; }
public static ClsReturnValues setTruckType(ClsTruckType obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditTruckType(obj.truckTypeID, obj.truckTypeName, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setUsers(ClsUsers obj) { //password encryption happens here obj.password = Security.Encrypt(obj.password); ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditUsers(obj.userID, obj.userGroupID, obj.userName, obj.password, obj.password, obj.passwordCanExpire, obj.passwordExpiryDate, obj.isLocked, obj.loginAttempts, obj.lastLoginDate, obj.theme, obj.resetPassword, obj.createdByID, obj.sessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setRegion(ClsRegion obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditRegion(obj.regionID, obj.regionName, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setTerminal(ClsTerminal obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditTerminal(obj.terminalID, obj.terminalName, obj.portID, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setMenus(ClsMenus obj) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditMenus(obj.menuID,obj.menuName,obj.menuDesc, obj.createdByID,obj.menuRanking, obj.sessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setPort(ClsPort obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditPort(obj.portID, obj.portName, obj.locationID, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public Tuple<ClsReturnValues, string, List<ClsUserDisplay>> authenticateUser(string UserName, string Password, string DeviceType, string DeviceName, string Browser) { string encryptedPassword = Security.Encrypt(Password); string token = ""; List<ClsUserDisplay> ud = new List<ClsUserDisplay>(); ClsReturnValues result = new ClsReturnValues(); ClsUsers userGroup = new ClsUsers(); using (tdoEntities db = new tdoEntities()) { result = db.uspUserAuthentication(UserName, encryptedPassword, DeviceType, DeviceName, Browser).FirstOrDefault(); userGroup = db.uspGetUsers().Where(p => p.userID == result.ID).FirstOrDefault(); if (result.IsSuccess == true) { ud = db.uspGetUserDisplay(result.ID).ToList<ClsUserDisplay>(); // Token issuer TokenIssuer issuer = new TokenIssuer(); // A client of the relying party app gets the token token = issuer.GetToken(result, ud.First().userGroupID); } } return new Tuple<ClsReturnValues, string, List<ClsUserDisplay>>(result, token, ud); }
public static ClsReturnValues resetPassword(int userID, string newPassword) { newPassword = Security.Encrypt(newPassword); ClsUsers U = Administration.getUsers().Where(p => p.userID == userID).ToList().FirstOrDefault(); string oldPassword = U.password; ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspChangePassword(userID, oldPassword, newPassword).FirstOrDefault(); } return lst; }
public static ClsReturnValues setDriver(ClsDriver obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditDriver(obj.driverID, obj.driverCode, obj.firstName, obj.middleName, obj.lastName, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setCity(ClsCity obj, Guid SessionID) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditCity(obj.cityID, obj.cityName, obj.cityCode, obj.stateID, obj.createdByID, SessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setAccessLevel(ClsAccessLevels obj) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditAccessLevels(obj.accessLevelID,obj.userGroupID,obj.formID,obj.canAdd,obj.canView,obj.canEdit,obj.canDelete,obj.canApprove,obj.createdByID,obj.sessionID).FirstOrDefault(); } return lst; }
public static ClsReturnValues setMenuIcons(ClsMenuIcons obj) { ClsReturnValues lst = new ClsReturnValues(); using (var db = new tdoEntities()) { lst = db.uspAddEditMenuIcons(obj.menuIconID, obj.menuID, obj.menuIconName).FirstOrDefault(); } return lst; }
public static ClsReturnValues setUserSessions(ClsUserSessions item) { ClsReturnValues obj = new ClsReturnValues(); try { using (var db = new tdoEntities()) { //uspAddEditUserSessions(Guid? sessionID, int? userID, bool? isActive, string deviceType, string deviceName, string browser, int? companyID); obj = db.uspAddEditUserSessions(item.sessionID, item.userID, item.isActive, item.deviceType, item.deviceName, item.browser).FirstOrDefault(); } } catch (Exception ex) { obj.Response = ex.Message; obj.IsSuccess = false; obj.ID = 0; } return obj; }