protected string GetIDFromEmailName(string name, string emailid, string[] conn) { string ide = ""; string[] m = new string[] { }; m = new string[] { }; string[] n = new string[] { }; n = new string[] { }; try { BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); mUserProfileHead user = new mUserProfileHead(); m = emailid.Split(','); n = name.Split('|'); for (int i = 0; i < emailid.Count(); i++) { user = db.mUserProfileHeads.Where(u => u.EmailID == emailid[i].ToString()).FirstOrDefault(); ide = Convert.ToString(user.ID); } } catch { } finally { } return(ide); }
/// <summary> /// Updatestatus Is Method To Update mUserProfileHead Table /// </summary> /// <param name="Updatestatus"></param> /// <returns></returns> /// public int UpdateUserProfile(mUserProfileHead User, string[] conn) { BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); ce.mUserProfileHeads.Attach(User); ce.ObjectStateManager.ChangeObjectState(User, EntityState.Modified); ce.SaveChanges(); return(Convert.ToInt32(User.ID)); }
protected string EmailGetEmailIDsByUserID(long UserID, string[] conn) { string result; BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); mUserProfileHead user = new mUserProfileHead(); user = db.mUserProfileHeads.Where(u => u.ID == UserID).FirstOrDefault(); result = user.EmailID; return(result); }
/// <summary> /// GetUserCreationList is providing List of User /// </summary> /// <returns></returns> /// public mUserProfileHead GetUserByID(long UserID, string[] conn) { BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); mUserProfileHead User = new mUserProfileHead(); User = (from p in ce.mUserProfileHeads where p.ID == UserID select p).FirstOrDefault(); ce.Detach(User); return(User); }
/// <summary> /// mUserProfileHead is the Method To Insert Record In Database /// </summary> /// <param name="status"></param> /// <returns></returns> public long InsertUserCreation(mUserProfileHead user, string[] conn) { BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); try { ce.mUserProfileHeads.AddObject(user); ce.SaveChanges(); return(user.ID); } catch { return(0); } }
protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e) { BrilliantWMS.UserCreationService.iUserCreationClient userClient = new BrilliantWMS.UserCreationService.iUserCreationClient(); try { CustomProfile profile = CustomProfile.GetProfile(); mUserProfileHead mUserProfile = new mUserProfileHead(); mUserProfile = userClient.GetUserByID(profile.Personal.UserID, profile.DBConnection._constr); if (mUserProfile != null) { mUserProfile.MobileNo = txtMobile.Text.Trim(); mUserProfile.PhoneNo = txtPhone.Text.Trim(); mUserProfile.EmailID = txtEmailID.Text.Trim(); mUserProfile.OtherID = txtOtherEmailID.Text.Trim(); mUserProfile.HighestQualification = txtHighestQualification.Text.Trim(); mUserProfile.InterestedIn = txtInstratedIn.Text.Trim(); mUserProfile.ProfileImg = (byte[])Session["ProfileImg"]; mUserProfile.DefaultAddress = UCAddress1.BillingSeq.Trim(); mUserProfile.LastModifiedBy = profile.Personal.UserID.ToString(); mUserProfile.LastModifiedDate = DateTime.Now; userClient.UpdateUserProfile(mUserProfile, profile.DBConnection._constr); UCAddress1.FinalSaveAddress(Address.ReferenceObjectName.User, profile.Personal.UserID); profile.Personal.ProfileImg = mUserProfile.ProfileImg; profile.Save(); WebMsgBox.MsgBox.Show("Profile updated successfully"); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "ProfileSetting", "pageSave"); } finally { userClient.Close(); } }