public static object GetCurrentProfile(string propertyName) { var user = Employee.CurrentUserName; ProfileBase objProfile = ProfileBase.Create(user); return(objProfile.GetPropertyValue(propertyName)); }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string BayiID = curProfile.GetPropertyValue("BayiID").ToString(); if (Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelYonetici" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelTeknik" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "TemsilciYonetici" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "DeveloperUser" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "Muhasebe") //if ile vdm personel yönetici yetkisi için roles dan kontrol edip -1 göndermek lazım. { if (BayiID == null || BayiID == "" || BayiID == "130" || BayiID == "140") { BayiID = "-1"; } } var list = db.S_AktivasyonAraRaporu(Convert.ToInt32(BayiID)).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list.ToList(); EmployeesGrid.DataBind(); } else { EmployeesGrid.DataSource = null; EmployeesGrid.DataBind(); } }
public override void Update() { _BaslangicTarihi = OwnerPage.BaslangicTarihi; _BitisTarihi = OwnerPage.BitisTarihi; ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string BayiID = curProfile.GetPropertyValue("BayiID").ToString(); if (Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelYonetici") { if (BayiID == null || BayiID == "" || BayiID == "130" || BayiID == "140") //if ile yönetici yetkisi roles dan kontrol edip -1 göndermek lazım. { BayiID = "-1"; } } var listPivot = db.S_HedefSatisDurumuPivot(Convert.ToInt32(BayiID), _BaslangicTarihi, _BitisTarihi).ToList(); if (listPivot.Count > 0) { PivotGrid.DataSource = listPivot; PivotGrid.DataBind(); } else { PivotGrid.DataSource = null; PivotGrid.DataBind(); } }
private void UserData() { DataSet ds = new DataSet(); string str = Convert.ToString(Request.QueryString["id"]); Database.ExecuteQuery(String.Format("select UserName, EMail from vw_aspnet_MembershipUsers where UserId='{0}'", str), ref ds, null); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { UserName.Text = ds.Tables[0].Rows[0]["UserName"].ToString();; Email.Text = ds.Tables[0].Rows[0]["EMail"].ToString(); ProfileBase pb = ProfileBase.Create(UserName.Text, false); UserClass uc = (UserClass)pb.GetPropertyValue("UserData"); UserLastName.Text = uc.LastName; UserFirstName.Text = uc.FirstName; UserSecondName.Text = uc.SecondName; UserPosition.Text = uc.Position; tbPassportSeries.Text = uc.PassportSeries; tbPassportNumber.Text = uc.PassportNumber; foreach (ListItem li in BranchDDL.Items) { if (li.Value == uc.BranchId.ToString()) { li.Selected = true; } } } }
protected void BindGrid() { var urun = db.S_Urunler().ToList(); if (urun.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UrunID"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = urun; } var tip = db.S_Tip(6).ToList(); if (tip.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["Onay"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = tip; } ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); var list = db.S_Siparislerim(Convert.ToInt32(bayiid)).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
public static List <String> GetFullNamesFromDept(string dept) { List <String> currentdep = new List <String>(); var users = Membership.GetAllUsers(); foreach (MembershipUser u in users) { ProfileBase profile = ProfileBase.Create(u.UserName); if (profile.GetPropertyValue("department").ToString() == dept) { currentdep.Add(profile.GetPropertyValue("fullname").ToString()); } } return(currentdep); }
private static ProfileEntity GetProfileFromDataStore(string userName) { // We can save a hit to the database by retrieving the profile from session once it has been initially retrieved from the data store. ProfileEntity profile = GetProfileFromSession(userName); if (profile != null) { // We found a profile, so no need to go to the data store. return(profile); } // No profile in session. Get from data store and then store in session. ProfileBase p = ProfileBase.Create(userName, Util.IsAuthenticated); ProfileEntity pe = new ProfileEntity(); pe.UserName = userName; bool showMediaObjectMetadata; if (Boolean.TryParse(p.GetPropertyValue(Constants.SHOW_METADATA_PROFILE_NAME).ToString(), out showMediaObjectMetadata)) { pe.ShowMediaObjectMetadata = showMediaObjectMetadata; } int userAlbumId; if (Int32.TryParse(p.GetPropertyValue(Constants.USER_ALBUM_ID_PROFILE_NAME).ToString(), out userAlbumId)) { pe.UserAlbumId = userAlbumId; } bool enableUserAlbum; if (Boolean.TryParse(p.GetPropertyValue(Constants.ENABLE_USER_ALBUM_PROFILE_NAME).ToString(), out enableUserAlbum)) { pe.EnableUserAlbum = enableUserAlbum; } // Save to session for quicker access next time. SaveProfileToSession(pe); return(pe); }
public override int SaveChanges(string args) { int sonucId = 0; var callbackArgs = DemoUtils.DeserializeCallbackArgs(args);//resimleri ekledikten sonra ne olduysa hep edit olarak geliyor artık. resim eklemesemde edit olarak geliyor işin kötüsü. //sanırım bir yerleri değiştirdim bu upload controllerini eklerken. yada js dosyasında bir değişiklik yaptım. if (callbackArgs[0] == "New") { ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); bool Mnp = Convert.ToBoolean(int.Parse(RbMnp.SelectedItem.Value.ToString())); int tipId9 = -1; if (Mnp) { tipId9 = 24; //Faturasız Mnp //Faturasız Mnp } else { tipId9 = 23; //Yeni Aktivasyon //Faturasız Hat } Guid guid; guid = (Guid)Membership.GetUser().ProviderUserKey; var sonuc = db.I_Aktivasyon(Convert.ToInt32(bayiid), guid, TxtAdi.Text, TxtSoyadi.Text, Convert.ToDecimal(TxtTCKN.Text), TxtAnneKizlikSoyadi.Text, TxtAdresTextBox.Text, Convert.ToInt32(CmbSehir.SelectedItem != null ? CmbSehir.SelectedItem.Value : -1), Convert.ToInt32(CmbIlce.SelectedItem != null ? CmbIlce.SelectedItem.Value : -1), Convert.ToInt32(TxtPostaKoduTextBox.Text), TxtEmailTextBox.Text, TxtSabitTelTextBox.Text, TxtCepTelTextBox.Text, TxtSimSeriNo.Text, Convert.ToInt32(CmbHattinTarifesi.SelectedItem.Value), TxtAciklama.Text, Mnp, tipId9, null).ToList(); sonucId = (int)sonuc.First().ID; db.I_AktivasyonEvrak(Session["HatSozlesmesiDosyaAdi"].ToString(), 1, 31, sonucId); db.I_AktivasyonEvrak(Session["KimlikFotokopisiDosyaAdi"].ToString(), 1, 32, sonucId); db.I_AktivasyonEvrak(Session["EvraklarDosyaAdi"].ToString(), 1, 33, sonucId); } else if (callbackArgs[0] == "Edit") { int id = Convert.ToInt32(callbackArgs[1]); //bu satıra update sp gelecek. sonucId = id; } Session["HatSozlesmesiDosyaAdi"] = ""; Session["KimlikFotokopisiDosyaAdi"] = ""; Session["EvraklarDosyaAdi"] = ""; return(sonucId); }
public ActionResult UpdateMember(string username) { RegisterModel updateModel = new RegisterModel(); ProfileBase profile = ProfileBase.Create(username); updateModel.UserName = profile.GetPropertyValue("UserName").ToString(); updateModel.Surname = profile.GetPropertyValue("Surname").ToString();; updateModel.Name = profile.GetPropertyValue("Name").ToString(); updateModel.Patronymic = profile.GetPropertyValue("Patronymic").ToString(); updateModel.Email = profile.GetPropertyValue("Email").ToString(); MembershipUser user = Membership.GetUser(username); updateModel.Password = user.GetPassword(username); updateModel.ConfirmPassword = updateModel.Password; return(View(updateModel)); }
public static string DisplayName(this ProfileBase profile) { try { return(profile.GetPropertyValue("DisplayName").ToString()); } catch (Exception) { return(profile.FirstName() + " " + profile.LastName()); } }
public static string FirstName(this ProfileBase profile) { try { return(profile.GetPropertyValue("FirstName").ToString()); } catch (Exception) { return(string.Empty); } }
public static T GetProperty <T>(this ProfileBase profile, string property) { object value = profile.GetPropertyValue(property); if (value == null) { return(default(T)); } return((T)value); }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string adet = e.NewValues["Adet"].ToString(); string urunid = e.NewValues["UrunID"].ToString(); ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); db.I_Siparislerim(Convert.ToInt32(bayiid), Convert.ToInt32(urunid), Convert.ToInt32(adet)); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); var list = db.S_AktivasyonVodafoneNet(-1, Convert.ToInt32(bayiid)).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
public static UserInfoModel GetUserByName(string username) { ProfileBase objProfile = ProfileBase.Create(username); var email = Membership.GetUser(username).Email; var roleid = CH.GetAllData <EmployeeRole>(w => w.AccountName == username).Select(s => s.RoleID).FirstOrDefault(); var gender = objProfile.GetPropertyValue("Gender") as string; var displayName = objProfile.GetPropertyValue("DisplayName") as string; var mobile = objProfile.GetPropertyValue("Mobile") as string; int con = 0; Int32.TryParse(objProfile.GetPropertyValue("Contact").ToString(), out con); var contact = con; var departmentid = objProfile.GetPropertyValue("DepartmentID") as int?; var startDate = objProfile.GetPropertyValue("StartDate") as string; DateTime date; DateTime.TryParse(startDate, out date); var userinfo = new UserInfoModel() { RoleID = roleid.Value, Email = email, Contact = contact, StartDate = date, Mobile = mobile, Gender = gender, DisplayName = displayName, DepartmentID = departmentid, UserName = username }; return(userinfo); }
public ActionResult Details(string name) { if (Employee.IsEqualToCurrentUserName(name)) { return(RedirectToAction("UpdateProfile", "account", new { name = name })); } var membershipuser = Membership.GetUser(name); var um = new UserInfoModel(); um.UserName = membershipuser.UserName; um.Email = membershipuser.Email; ProfileBase objProfile = ProfileBase.Create(membershipuser.UserName); DateTime b; object data = null; data = objProfile.GetPropertyValue("BirthDay"); DateTime.TryParse(data.ToString(), out b); um.BirthDay = b; int contact = 0; Int32.TryParse(objProfile.GetPropertyValue("Contact").ToString(), out contact); um.Contact = contact; um.Mobile = objProfile.GetPropertyValue("Mobile") as string; um.Gender = objProfile.GetPropertyValue("Gender") as string; um.DisplayName = objProfile.GetPropertyValue("DisplayName") as string; int roleid; data = objProfile.GetPropertyValue("RoleLevelID"); Int32.TryParse(data.ToString(), out roleid); um.RoleID = roleid; return(View(um)); }
public static ConfigurationModel Initialize(ProfileBase profile) { ConfigurationModel model = new ConfigurationModel(); model.PhoneNumber = (string)profile.GetPropertyValue("PhoneNumber"); model.ReplyToMailbox = (bool)profile.GetPropertyValue("ReplyToMailbox"); model.SmtpServerName = (string)profile.GetPropertyValue("SmtpServerName"); model.SmtpServerPort = (int?)profile.GetPropertyValue("SmtpServerPort"); model.SmtpUserName = (string)profile.GetPropertyValue("SmtpUserName"); model.SmtpPassword = (string)profile.GetPropertyValue("SmtpPassword"); model.UseSmtpSsl = (bool)profile.GetPropertyValue("UseSmtpSsl"); model.AccountSid = (string)profile.GetPropertyValue("AccountSid"); model.AuthToken = (string)profile.GetPropertyValue("AuthToken"); return(model); }
public UserInfoModel getUserInfo(string username) { MembershipUser user = System.Web.Security.Membership.GetUser(username); ProfileBase profile = ProfileBase.Create(username); UserInfoModel info = new UserInfoModel(); info.userName = username; info.phone = profile.GetPropertyValue("PhoneNumber").ToString(); info.email = user.Email; return(info); }
public string Login(UserIdentity user) { string loginToken = string.Empty; char seperator = '/'; if (Membership.ValidateUser(user.userName, user.password)) { ProfileBase pUser = ProfileBase.Create(user.userName); loginToken = Team12CustomStringEncoder(user.userName, user.password); return(loginToken + seperator + pUser.GetPropertyValue("department") + seperator + Roles.GetRolesForUser(user.userName).First()); } loginToken = "Invalid"; return(loginToken); }
public static List <MembershipUser> GetListOfMembershipUsersByDept(string dept) { List <MembershipUser> userList = GetListOfMembershipUsers(); foreach (MembershipUser u in userList) { ProfileBase user = ProfileBase.Create(u.UserName); if ((string)user.GetPropertyValue("department") != dept) { userList.Remove(u); } } return(userList); }
public override void Update() { var employee = Membership.GetAllUsers().Cast <MembershipUser>().Where(c => c.ProviderUserKey.ToString() == SelectedItemGuid.ToString()).FirstOrDefault(); if (employee == null) { return; } ProfileBase curProfile = ProfileBase.Create(employee.UserName); string resimadi = curProfile.GetPropertyValue("ResimAdi").ToString(); EmployeeImage.ImageUrl = "../../Images/UploadPersonel/" + resimadi; DetailsHeaderHeadLine.HeaderText = string.Format("{0} {1}", curProfile.GetPropertyValue("Ismi").ToString(), curProfile.GetPropertyValue("Soyismi").ToString()); DetailsHeaderHeadLine.ContentText = employee.UserName; DetailsAddressText.InnerHtml = curProfile.GetPropertyValue("BayiKodu").ToString(); DetailsPhoneText.InnerHtml = curProfile.GetPropertyValue("CepNumarasi").ToString(); DetailsEmailText.InnerHtml = employee.Email; //// EditImage.JSProperties["cpEmployeeID"] = list.First().ID; //// DetailsHeaderHeadLine.NavigateUrl = string.Format("javascript:ShowEmployeeEditForm('{0}')", list.First().ID); }
public static string GetUserName(String fullname, String dept) { List <MembershipUser> users = GetUsersFromDept(dept); foreach (MembershipUser u in users) { ProfileBase p = ProfileBase.Create(u.UserName); if (p.GetPropertyValue("fullname").ToString() == fullname) { return(u.UserName); } } return(null); }
public static string GetSecurityConditionForTable(string userName, TableInfo tableInfo) { List <string> conditions = new List <string>(); bool b = true; ProfileBase profile = ProfileBase.Create(userName); foreach (var p in Properties) { if (!p.IsSecurity) { continue; } foreach (ColumnInfo ci in tableInfo.Columns) { if (ci.ColumnName != p.Name) // !p.Type.FullName.StartsWith("System.Int")) { continue; } object val = profile.GetPropertyValue(p.Name); if (val == null) { continue; } string s; if (p.Type.IsArray) { if (((Array)val).Length == 0) { continue; } s = string.Join(",", ((Array)val).Cast <object>().Select(o1 => o1.ToString()).ToArray()); } else if (val.ToString() == "0")//TODO: Default value { continue; } else { s = val.ToString(); } //if (b) // b = false; //else // s += " AND "; conditions.Add(tableInfo.FullName + "." + ci.ColumnName + "=" + s); } } return(string.Join(" AND ", conditions.ToArray())); }
public static string GetEmailAddressByName(string name) { List <MembershipUser> userList = GetListOfMembershipUsers(); foreach (MembershipUser u in userList) { ProfileBase user = ProfileBase.Create(u.UserName); if (user.GetPropertyValue("fullname").ToString() == name) { return(u.Email); } } //If error! Send to this email. So we can catch the error by the string after the "+" sign. return("*****@*****.**"); }
public static List <string> GetAllUserEmailAddressListForDept(string depid) { List <string> deptuseremails = new List <string>(); List <MembershipUser> userList = GetListOfMembershipUsers(); foreach (MembershipUser u in userList) { ProfileBase user = ProfileBase.Create(u.UserName); if ((string)user.GetPropertyValue("department") == depid) { deptuseremails.Add(u.Email); } } return(deptuseremails); }
public static double?EmployeeDuration(this Member item) { ProfileBase objProfile = ProfileBase.Create(item.Name); object StartDate; DateTime startdate; StartDate = objProfile.GetPropertyValue("StartDate"); DateTime.TryParse(StartDate.ToString(), out startdate); if (startdate.Year != 1) { var months = (DateTime.Now - startdate).Days / 30; return(months); } return(null); }
public static string GetUserEmailAddress(string fullname) { List <string> clerkemails = new List <string>(); List <MembershipUser> userList = GetListOfMembershipUsers(); foreach (MembershipUser u in userList) { ProfileBase p = ProfileBase.Create(u.UserName); if (p.GetPropertyValue("fullname").ToString() == fullname) { return(u.Email); } } //in case user is not found... return("*****@*****.**"); }
public override int SaveChanges(string args) { int sonucId = 0; var callbackArgs = DemoUtils.DeserializeCallbackArgs(args);//resimleri ekledikten sonra ne olduysa hep edit olarak geliyor artık. resim eklemesemde edit olarak geliyor işin kötüsü. //sanırım bir yerleri değiştirdim bu upload controllerini eklerken. yada js dosyasında bir değişiklik yaptım. if (callbackArgs[0] == "New") { ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); Guid guid; guid = (Guid)Membership.GetUser().ProviderUserKey; var sonuc = db.I_Aktivasyon(Convert.ToInt32(bayiid), guid, TxtAdi.Text, TxtSoyadi.Text, Convert.ToDecimal(TxtTCKN.Text), "", "", -1, -1, -1, "", TxtSabitTelTextBox.Text, TxtCepTelTextBox.Text, "", -1, TxtAciklama.Text, false, 28, null).ToList(); sonucId = (int)sonuc.First().ID; db.I_AktivasyonEvrak(Session["HatSozlesmesiDosyaAdi"].ToString(), 1, 39, sonucId); db.I_AktivasyonEvrak(Session["KimlikFotokopisiDosyaAdi"].ToString(), 1, 32, sonucId); db.I_AktivasyonEvrak(Session["EvraklarDosyaAdi"].ToString(), 1, 33, sonucId); } else if (callbackArgs[0] == "Edit") { int id = Convert.ToInt32(callbackArgs[1]); //bu satıra update sp gelecek. sonucId = id; } Session["HatSozlesmesiDosyaAdi"] = ""; Session["KimlikFotokopisiDosyaAdi"] = ""; Session["EvraklarDosyaAdi"] = ""; return(sonucId); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String username = Request.Params["username"]; if (username == null) { eroareCuRedirectare("Link invalid!"); } else { //src-ul imaginii de profil: string fn = "~/profil_images/" + username + "_profil.jpg"; string fn2 = Server.MapPath("profil_images") + "/" + username + "_profil.jpg"; if (File.Exists(fn2)) { img_profil.Src = fn; } //end // astea pot fi adaugate, daca e necesar sa le punem pe pagina de profil (stalker-oriented :)) ) //LabelLastLoginDateInfo.Text = Profile.LastActivityDate.ToString(); //LabelRegisterDateInfo.Text = Profile.RegisterDate.ToString(); //emailul nu e in profile, e in baza de date GETProfil.SelectCommand = "SELECT dbo.GetProfilePropertyValue('NumeONG', PropertyNames, PropertyValuesString) AS NumeONG, dbo.GetProfilePropertyValue('DescriereActivitate', PropertyNames, PropertyValuesString) AS Descriere, dbo.GetProfilePropertyValue('Profil', PropertyNames, PropertyValuesString) AS Profil, dbo.GetProfilePropertyValue('TipONG', PropertyNames, PropertyValuesString) AS TipONG, aspnet_Users.username AS username from aspnet_Profile, aspnet_Users where aspnet_Users.UserId = aspnet_Profile.UserId and aspnet_Users.UserName = '******';"; ProfileBase profile = ProfileBase.Create(username, true); LabelNumeONG.Text = profile.GetPropertyValue("NumeONG").ToString(); inputEmail.Text = Membership.GetUser(username).Email; userName.Text = username; tipONG.Text = profile.GetPropertyValue("TipONG").ToString(); anCamp.Text = profile.GetPropertyValue("AnInfiintare").ToString(); profilCamp.Text = profile.GetPropertyValue("Profil").ToString(); nrCamp.Text = profile.GetPropertyValue("NrInregistrare").ToString(); descriere.Text = profile.GetPropertyValue("DescriereActivitate").ToString(); // vreau sa completez formul cu ce era in Profile // daca sunt chiar pe profilul meu, da-mi si linkul de editare if (HttpContext.Current.User.Identity.IsAuthenticated && Profile.UserName == username) { HyperLink hl = (LoginView1.FindControl("HyperLink1") as HyperLink); hl.NavigateUrl = "~/EditareProfil.aspx?username="******"SELECT Proiecte.nume, Proiecte.id_proiect FROM [Proiecte] WHERE CAST(cod_user AS VARCHAR(50)) = '" + Membership.GetUser(username).ProviderUserKey + "'"; SqlDataSourceProiecteParticipant.SelectCommand = "SELECT Proiecte.nume, Proiecte.id_proiect FROM User_are_Colaboratori INNER JOIN Proiecte ON User_are_Colaboratori.cod_proiect = Proiecte.id_proiect WHERE CAST(User_are_Colaboratori.cod_user AS VARCHAR(50)) = '" + Membership.GetUser(username).ProviderUserKey + "' AND stare='activ'"; } } }
public static List <MembershipUser> GetUsersFromDept(string dept) { List <MembershipUser> currentdepusers = new List <MembershipUser>(); var users = Membership.GetAllUsers(); foreach (MembershipUser u in users) { ProfileBase profile = ProfileBase.Create(u.UserName); if (profile.GetPropertyValue("department").ToString() == dept) { currentdepusers.Add(u); } } return(currentdepusers); }