Esempio n. 1
0
 public void btnSave_Click(object sender, EventArgs e)
 {
     User user = new User();
     string msg = "";
     if (user.HasUserByUserName(this.txtUserName.Text))
     {
         msg = msg + Site.TooltipUserExist;
     }
     if (msg != "")
     {
         MessageBox.ShowSuccessTip(this, msg);
     }
     else
     {
         user.UserName = this.txtUserName.Text;
         user.Password = AccountsPrincipal.EncryptPassword(this.txtPassword.Text);
         user.NickName = user.UserName;
         user.TrueName = this.txtTrueName.Text;
         user.Sex = "1";
         user.Phone = this.txtPhone.Text.Trim();
         user.Email = this.txtEmail.Text;
         user.EmployeeID = 0;
         user.Activity = true;
         user.UserType = this.radbtnlistUserType.SelectedValue;
         user.Style = 1;
         user.User_dateCreate = DateTime.Now;
         user.User_iCreator = base.CurrentUser.UserID;
         user.User_dateValid = DateTime.Now;
         user.User_cLang = "zh-CN";
         int num = user.Create();
         if (num == -100)
         {
             MessageBox.ShowSuccessTip(this, Site.TooltipUserExist);
         }
         else
         {
             UsersExp exp = new UsersExp();
             UsersExpModel model = new UsersExpModel {
                 UserID = num,
                 LastAccessTime = new DateTime?(DateTime.Now),
                 LastLoginTime = DateTime.Now,
                 LastPostTime = new DateTime?(DateTime.Now)
             };
             exp.AddUsersExp(model);
             LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, string.Format("添加用户:【{0}】", this.txtUserName.Text), this);
             base.Response.Redirect("RoleAssignment.aspx?UserID=" + num);
         }
     }
 }
Esempio n. 2
0
 private void ShowInfo(int ID)
 {
     AccountsPrincipal existingPrincipal = new AccountsPrincipal(ID);
     User user = new User(existingPrincipal);
     UsersExpModel usersExpModel = new UsersExp().GetUsersExpModel(ID);
     if ((user != null) && (usersExpModel != null))
     {
         this.lblUserName.Text = user.UserName;
         this.lblTrueName.Text = user.TrueName;
         this.lblPhone.Text = user.Phone;
         this.lblNickName.Text = user.NickName;
         this.lblEmail.Text = user.Email;
         this.lblAblums.Text = usersExpModel.AblumsCount.ToString();
         this.lblFans.Text = usersExpModel.FansCount.ToString();
         this.lblFav.Text = usersExpModel.FavouritesCount.ToString();
         this.lblFellows.Text = usersExpModel.FellowCount.ToString();
         this.lblProducts.Text = usersExpModel.ProductsCount.ToString();
         this.lblSex.Text = (!string.IsNullOrWhiteSpace(user.Sex) && (user.Sex.Trim() == "0")) ? "女" : "男";
         this.lblActivity.Text = user.Activity ? "正常使用" : "已经冻结";
         this.lblCreTime.Text = user.User_dateCreate.ToString("yyyy-MM-dd HH:mm:ss");
     }
     if (usersExpModel != null)
     {
         Regions regions = new Regions();
         this.imageGra.ImageUrl = string.Format("/Upload/User/Gravatar/{0}.jpg", usersExpModel.UserID);
         string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(usersExpModel.Address, 0));
         if (regionNameByRID.Contains("北京北京"))
         {
             regionNameByRID = regionNameByRID.Replace("北京北京", "北京");
         }
         else if (regionNameByRID.Contains("上海上海"))
         {
             regionNameByRID = regionNameByRID.Replace("上海上海", "上海");
         }
         else if (regionNameByRID.Contains("重庆重庆"))
         {
             regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆");
         }
         else if (regionNameByRID.Contains("天津天津"))
         {
             regionNameByRID = regionNameByRID.Replace("天津天津", "天津");
         }
         this.lblAddress.Text = string.IsNullOrEmpty(usersExpModel.Address) ? "暂未设置" : regionNameByRID;
         this.lblPoints.Text = usersExpModel.Points.ToString();
         this.lblLoginDate.Text = usersExpModel.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss");
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session[Globals.SESSIONKEY_SUPPLIER] != null)
     {
         User user = (User) this.Session[Globals.SESSIONKEY_SUPPLIER];
         LogHelp.AddUserLog(user.UserName, user.UserType, "退出系统", this);
         UsersExp exp = new UsersExp();
         UsersExpModel usersExpModel = new UsersExpModel();
         usersExpModel = exp.GetUsersExpModel(user.UserID);
         if (usersExpModel != null)
         {
             usersExpModel.LastAccessIP = base.Request.UserHostAddress;
             usersExpModel.LastLoginTime = DateTime.Now;
             exp.UpdateUsersExp(usersExpModel);
         }
     }
     FormsAuthentication.SignOut();
     this.Session.Clear();
     this.Session.Abandon();
     base.Response.Clear();
     base.Response.Redirect(PageBaseSupplier.DefaultLoginSupplier);
     base.Response.End();
 }
Esempio n. 4
0
 public string GetUserName(string prefixText, int limit)
 {
     if (string.IsNullOrWhiteSpace(prefixText))
     {
         return string.Empty;
     }
     string strUName = this.HtmlEncode(prefixText);
     DataSet userName = new UsersExp().GetUserName(strUName, limit);
     JsonArray array = new JsonArray();
     if (userName.Tables[0].Rows.Count > 0)
     {
         for (int i = 0; i < userName.Tables[0].Rows.Count; i++)
         {
             string tmpStr = userName.Tables[0].Rows[i]["UserName"].ToString();
             if (this.CheckHtmlCode(ref tmpStr, prefixText))
             {
                 JsonObject obj2 = new JsonObject();
                 obj2.Accumulate("name", tmpStr);
                 array.Add(obj2);
             }
         }
     }
     return array.ToString();
 }
Esempio n. 5
0
 public PartialViewResult UserInfo(int id)
 {
     UsersExp exp = new UsersExp();
     UsersExpModel usersModel = new UsersExpModel();
     usersModel = exp.GetUsersModel(id);
     if (usersModel == null)
     {
         return base.PartialView();
     }
     return this.PartialView("_UserInfo", usersModel);
 }
Esempio n. 6
0
 public bool AddEx(Maticsoft.Model.Pay.BalanceDrawRequest model)
 {
     decimal userBalance = new UsersExp().GetUserBalance(model.UserID);
     return this.dal.AddEx(model, userBalance);
 }
Esempio n. 7
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string userName = this.txtUserName.Text.Trim();
     string password = this.txtPassword.Text.Trim();
     if (userName.Length == 0)
     {
         MessageBox.ShowServerBusyTip(this, "用户名不能为空!");
     }
     else
     {
         User user = new User();
         if (user.HasUserByUserName(userName))
         {
             MessageBox.ShowServerBusyTip(this, Site.TooltipUserExist);
         }
         else if (password.Length == 0)
         {
             MessageBox.ShowServerBusyTip(this, "密码不能为空!");
         }
         else if (password.Length > 0x10)
         {
             MessageBox.ShowServerBusyTip(this, "密码不能超过16个字符!");
         }
         else
         {
             string name = this.txtName.Text.Trim();
             if (name.Length == 0)
             {
                 MessageBox.ShowServerBusyTip(this, "企业名称不能为空!");
             }
             else if (name.Length > 100)
             {
                 MessageBox.ShowServerBusyTip(this, "企业名称请控制在1~100字符!");
             }
             else if (this.bll.Exists(name))
             {
                 MessageBox.ShowServerBusyTip(this, "该企业名称已经被注册,请更换企业名称再操作!");
             }
             else
             {
                 int enterpriseID = 0;
                 try
                 {
                     Maticsoft.Model.Ms.Enterprise model = new Maticsoft.Model.Ms.Enterprise {
                         Name = name,
                         Introduction = this.txtIntroduction.Text,
                         RegisteredCapital = new int?(Globals.SafeInt(this.txtRegisteredCapital.Text, 0)),
                         TelPhone = this.txtTelPhone.Text,
                         CellPhone = this.txtCellPhone.Text,
                         ContactMail = this.txtContactMail.Text,
                         RegionID = new int?(this.RegionID.Region_iID),
                         Address = this.txtAddress.Text,
                         Remark = this.txtRemark.Text,
                         Contact = this.txtContact.Text,
                         UserName = this.txtUserName.Text
                     };
                     string text = this.txtEstablishedDate.Text;
                     if (PageValidate.IsDateTime(text))
                     {
                         model.EstablishedDate = new DateTime?(Globals.SafeDateTime(text, DateTime.Now));
                     }
                     else
                     {
                         model.EstablishedDate = null;
                     }
                     model.EstablishedCity = new int?(this.RegionEstablishedCity.Region_iID);
                     model.LOGO = this.txtLOGO.Text;
                     model.Fax = this.txtFax.Text;
                     model.PostCode = this.txtPostCode.Text;
                     model.HomePage = this.txtHomePage.Text;
                     model.ArtiPerson = this.txtArtiPerson.Text;
                     model.EnteRank = new int?(Globals.SafeInt(this.dropEnteRank.SelectedValue, 0));
                     model.EnteClassID = new int?(Globals.SafeInt(this.dropEnteClassID.SelectedValue, 0));
                     model.CompanyType = new int?(Globals.SafeInt(this.dropCompanyType.SelectedValue, 0));
                     model.BusinessLicense = this.txtBusinessLicense.Text;
                     model.TaxNumber = this.txtTaxNumber.Text;
                     model.AccountBank = this.txtAccountBank.Text;
                     model.AccountInfo = this.txtAccountInfo.Text;
                     model.ServicePhone = this.txtServicePhone.Text;
                     model.QQ = this.txtQQ.Text;
                     model.MSN = this.txtMSN.Text;
                     model.Status = new int?(Globals.SafeInt(this.radlStatus.SelectedValue, 0));
                     model.CreatedDate = new DateTime?(DateTime.Now);
                     model.CreatedUserID = new int?(base.CurrentUser.UserID);
                     model.UpdatedDate = new DateTime?(DateTime.Now);
                     model.UpdatedUserID = new int?(base.CurrentUser.UserID);
                     model.Balance = Globals.SafeDecimal(this.txtBalance.Text, (decimal) 0M);
                     model.AgentID = Globals.SafeInt(this.txtAgentID.Text, 0);
                     enterpriseID = this.bll.Add(model);
                     if (enterpriseID > 0)
                     {
                         user.UserName = userName;
                         user.NickName = this.txtName.Text;
                         user.Password = AccountsPrincipal.EncryptPassword(password);
                         user.TrueName = "";
                         user.Sex = "1";
                         user.Phone = this.txtCellPhone.Text;
                         user.Email = this.txtContactMail.Text;
                         user.EmployeeID = 0;
                         user.DepartmentID = enterpriseID.ToString();
                         user.Activity = true;
                         user.UserType = "EE";
                         user.Style = 1;
                         user.User_dateCreate = DateTime.Now;
                         user.User_iCreator = base.CurrentUser.UserID;
                         user.User_dateValid = DateTime.Now;
                         user.User_cLang = "zh-CN";
                         int userID = user.Create();
                         if (userID == -100)
                         {
                             this.bll.Delete(enterpriseID);
                             MessageBox.ShowServerBusyTip(this, Site.TooltipUserExist);
                         }
                         else
                         {
                             UsersExp exp = new UsersExp {
                                 UserID = userID,
                                 BirthdayVisible = 0,
                                 BirthdayIndexVisible = false,
                                 ConstellationVisible = 0,
                                 ConstellationIndexVisible = false,
                                 NativePlaceVisible = 0,
                                 NativePlaceIndexVisible = false,
                                 RegionId = 0,
                                 AddressVisible = 0,
                                 AddressIndexVisible = false,
                                 BodilyFormVisible = 0,
                                 BodilyFormIndexVisible = false,
                                 BloodTypeVisible = 0,
                                 BloodTypeIndexVisible = false,
                                 MarriagedVisible = 0,
                                 MarriagedIndexVisible = false,
                                 PersonalStatusVisible = 0,
                                 PersonalStatusIndexVisible = false,
                                 LastAccessIP = "",
                                 LastAccessTime = new DateTime?(DateTime.Now),
                                 LastLoginTime = DateTime.Now,
                                 LastPostTime = new DateTime?(DateTime.Now)
                             };
                             if (exp.AddUsersExp(exp))
                             {
                                 MessageBox.ShowSuccessTip(this, "添加成功!", "List.aspx");
                             }
                             else
                             {
                                 user.UserID = userID;
                                 user.Delete();
                                 exp.DeleteUsersExp(userID);
                                 this.bll.Delete(enterpriseID);
                                 MessageBox.ShowFailTip(this, "添加失败!");
                             }
                         }
                     }
                     else
                     {
                         this.bll.Delete(enterpriseID);
                         MessageBox.ShowFailTip(this, "添加失败!");
                     }
                 }
                 catch (Exception exception)
                 {
                     this.bll.Delete(enterpriseID);
                     throw exception;
                 }
             }
         }
     }
 }
Esempio n. 8
0
 public bool UpdateStatus(Maticsoft.Model.Pay.RechargeRequest reModel)
 {
     decimal userBalance = new UsersExp().GetUserBalance(reModel.UserId);
     return this.dal.UpdateStatus(reModel, userBalance);
 }