public static Boolean UpdateRecord(UserREG usereg) { using (TransactionScope scope = new TransactionScope()) { Boolean bol = false; try { using (var context = new SycousCon()) { var UserRegToUpdate = context.UserREGs.Where(c => c.UserID == usereg.UserID); foreach (UserREG p in UserRegToUpdate) { if (usereg.Photo != null) { p.Photo = usereg.Photo; } if (usereg.FirstName != null) { p.FirstName = usereg.FirstName; } if (usereg.LastName != null) { p.LastName = usereg.LastName; } if (usereg.Email != null) { p.Email = usereg.Email; } if (usereg.Mobile != null) { p.Mobile = usereg.Mobile; } if (usereg.Phone != null) { p.Phone = usereg.Phone; } if (usereg.UserType == 0) { p.UserType = 0; p.ClientID = null; } if ((usereg.UserType == 1)&&(usereg.ClientID!= null)) { p.UserType = 1; p.ClientID = usereg.ClientID; } p.ModifyBy = usereg.ModifyBy; p.Modifydate = DateTime.Now; } context.SaveChanges(); context.AcceptAllChanges(); scope.Complete(); context.Dispose(); bol = true; } }// try catch (Exception ex) { throw; } return bol; }//UpdatePhoto }
public static String AddUserRegistration(UserREG usereg) { String user_id = String.Empty; using (TransactionScope scope = new TransactionScope()) { using (var context = new SycousCon()) { try { context.UserREGs.AddObject(usereg); context.SaveChanges(); scope.Complete(); context.AcceptAllChanges(); user_id = usereg.UserID.ToString(); } catch (Exception ex) { context.Dispose(); throw; } } } return user_id; }
public static UserREG EditUserRegistration(Int64 UserId) { UserREG reg = new UserREG(); try { using (var context = new SycousCon()) { reg = context.UserREGs.Single(s => s.UserID == UserId && s.DeleteStatus == 0 && s.UserType != 2); } } catch (Exception ex) { throw ex; } return reg; }
public static UserREG GetRecoverPasswordWithHintQuestion(UserREG objuser) { UserREG reg = new UserREG(); try { using (var context = new SycousCon()) { reg = context.UserREGs.Single(s => s.UserName.ToUpper().Trim() == objuser.UserName.ToUpper().Trim() && s.DeleteStatus == 0 && s.HintQuestion.ToUpper().Trim()== objuser.HintQuestion.ToUpper().Trim()); } } catch (Exception ex) { throw ex; } return reg; }
public static Boolean ChangedPassword(UserREG usereg) { using (TransactionScope scope = new TransactionScope()) { Boolean bol = false; try { using (var context = new SycousCon()) { var UserRegToUpdate = context.UserREGs.Where(c => c.UserID == usereg.UserID); foreach (UserREG p in UserRegToUpdate) { if (usereg.Password != null) { p.Password = usereg.Password; } p.ModifyBy = usereg.ModifyBy; p.Modifydate = DateTime.Now; } context.SaveChanges(); context.AcceptAllChanges(); scope.Complete(); context.Dispose(); bol = true; } }// try catch (Exception ex) { throw; } return bol; } }
public static Boolean CreateUserRegistration(UserREG usereg) { Boolean flag = false; using (TransactionScope scope = new TransactionScope()) { using (var context = new SycousCon()) { try { context.UserREGs.AddObject(usereg); context.SaveChanges(); scope.Complete(); context.AcceptAllChanges(); flag = true; } catch (Exception ex) { context.Dispose(); throw; } } } return flag; }
public String AddRecord(Object userReg) { String Id = String.Empty; UserRegister registration = (UserRegister)userReg; try { UserREG _user = new UserREG(); if (registration.UserName != null) { _user.UserName = registration.UserName.Trim(); } if (registration.FirstName != null) { _user.FirstName = registration.FirstName.Trim(); } if (registration.LastName != null) { _user.LastName = registration.LastName.Trim(); } if (registration.Password != null) { _user.Password = registration.Password.Trim(); } if (registration.Email != null) { _user.Email = registration.UserName.Trim(); } if (registration.Mobile != null) { _user.Mobile = registration.Mobile.Trim(); } if (registration.phone != null) { _user.Phone = registration.phone.Trim(); } if (registration.Photo != null) { _user.Photo = registration.Photo.Trim(); } if (registration.MemberShipId != null) { _user.MembershipID = registration.MemberShipId.ToString(); } if (registration.UserType) { _user.UserType = 1; } else { _user.UserType = 0; } if (registration.HintQut != null) { _user.HintQuestion = registration.HintQut; } if (registration.HintAns != null) { _user.HintAns = registration.HintAns; } if (registration.ClientID != null) { _user.ClientID = registration.ClientID; } _user.CreateDate = DateTime.Now; _user.CreateBy = registration.CreateBy; if (_user.UserName != null) { Id = DAL.DALUserReg.AddUserRegistration(_user); } } catch (Exception ex) { throw; } return Id; }
public bool UpdateRecord(Object userReg) { Boolean flag = false; UserRegister registration = (UserRegister)userReg; try { UserREG _registration = new UserREG(); _registration.UserID = Convert.ToInt64(registration.User_ID); if (registration.FirstName != null) { _registration.FirstName = registration.FirstName.Trim(); } if (registration.LastName != null) { _registration.LastName = registration.LastName.Trim(); } if (registration.Mobile != null) { _registration.Mobile = registration.Mobile.Trim(); } if (registration.phone != null) { _registration.Phone = registration.phone.Trim(); } if (registration.Photo != null) { _registration.Photo = registration.Photo.Trim(); } if (registration.UserType) { _registration.UserType = 1; } else { _registration.UserType = 0; } if (registration.ClientID != null) { _registration.ClientID = registration.ClientID; } _registration.Modifydate = DateTime.Now; _registration.ModifyBy = registration.ModifyBy; if (_registration.UserID != null) { flag = DAL.DALUserReg.UpdateRecord(_registration); } } catch (Exception ex) { throw; } return flag; }
Boolean IUpdate.UpdateRecord(Object ChangePasswordobj) { Boolean flag = false; UserChangePassword ChangePassword = (UserChangePassword)ChangePasswordobj; try { UserREG _registration = new UserREG(); _registration.UserID = Convert.ToInt64(ChangePassword.User_ID); if (ChangePassword.NewPassword != null) { _registration.Password = ChangePassword.NewPassword.Trim(); } if ((_registration.UserID != null)&&(_registration.Password != null)&&(!String.IsNullOrEmpty(_registration.Password))) { flag = DAL.DALUserReg.ChangedPassword(_registration); } } catch (Exception ex) { throw; } return flag; }
/// <summary> /// Create a new UserREG object. /// </summary> /// <param name="userID">Initial value of the UserID property.</param> /// <param name="iSApproved">Initial value of the ISApproved property.</param> /// <param name="iSBlock">Initial value of the ISBlock property.</param> /// <param name="status">Initial value of the Status property.</param> /// <param name="deleteStatus">Initial value of the DeleteStatus property.</param> /// <param name="userType">Initial value of the UserType property.</param> public static UserREG CreateUserREG(global::System.Int64 userID, global::System.Boolean iSApproved, global::System.Boolean iSBlock, global::System.Boolean status, global::System.Int32 deleteStatus, global::System.Int32 userType) { UserREG userREG = new UserREG(); userREG.UserID = userID; userREG.ISApproved = iSApproved; userREG.ISBlock = iSBlock; userREG.Status = status; userREG.DeleteStatus = deleteStatus; userREG.UserType = userType; return userREG; }
/// <summary> /// Deprecated Method for adding a new object to the UserREGs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUserREGs(UserREG userREG) { base.AddObject("UserREGs", userREG); }