private void UpdateUserBase()
 {
     int id = 1;
     IUserBaseService cs = new UserBaseService();
     var data            = cs.GetUserBaseById(id);
     var result          = cs.UpdateSingleUserBase(data);
 }
Beispiel #2
0
        /// <summary>
        /// 获取用户全称
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        protected string GetUserFullName(object userId)
        {
            UserBase ub = UserBaseService.GetModelByUserId(Convert.ToInt32(userId));

            if (ub != null)
            {
                return(ub.fullName);
            }
            return("");
        }
Beispiel #3
0
        public CommandHandlingService(IServiceProvider services)
        {
            _commands        = services.GetRequiredService <CommandService>();
            _discord         = services.GetRequiredService <DiscordSocketClient>();
            _services        = services;
            _userBaseService = services.GetRequiredService <UserBaseService>();

            // Hook CommandExecuted to handle post-command-execution logic.
            _commands.CommandExecuted += CommandExecutedAsync;
            // Hook MessageReceived so we can process each message to see
            // if it qualifies as a command.
            _discord.MessageReceived += MessageReceivedAsync;
        }
        private void AddUserBase()
        {
            UserBaseModel data = new UserBaseModel();

            data.UserCode   = "test";
            data.Password   = "******";
            data.UserName   = "******";
            data.DeptID     = 2;
            data.CompanyID  = 1;
            data.AreaCode   = "test";
            data.Status     = 1;
            data.UserType   = 1;
            data.IsLocked   = true;
            data.CreateID   = 1;
            data.CreateName = "test";
            data.CreateTime = DateTime.Now;
            IUserBaseService cs = new UserBaseService();
            var result          = cs.InsertSingleUserBase(data);
        }
Beispiel #5
0
        /// <summary>
        /// 获取子级信息
        /// </summary>
        private void GetMoreAreaInfo()
        {
            StringBuilder sb     = new StringBuilder();
            string        areaId = CRequest.GetString("areaId");
            DataSet       ds     = UserBaseService.GetList("regCode = '" + areaId + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (dr["fullName"].ToString().Length > 12)
                    {
                        sb.Append("<li style=\"float:left; width:18%; line-height:35px; text-align:center; padding:5px; margin-bottom:5px; border:1px #eee solid;\"><a href=\"/comDetail_client_" + dr["userId"] + "_1.html\" title=\"" + dr["fullName"] + "\">" + dr["fullName"].ToString().Substring(0, 12) + "</a></li> ");
                    }
                    else
                    {
                        sb.Append("<li style=\"float:left; width:18%; line-height:35px; text-align:center; padding:5px; margin-bottom:5px; border:1px #eee solid;\"><a href=\"/comDetail_client_" + dr["userId"] + "_1.html\" title=\"" + dr["fullName"] + "\">" + dr["fullName"] + "</a></li> ");
                    }
                }
                sb.Append("<li style=\"float:left; width:18%; line-height:35px; text-align:center; padding:5px; margin-bottom:5px; border:1px #eee solid;\"><a href='javascript:collapseInfo(" + areaId + ")'>收起 <<</a></li> ");
            }
            Response.Write(sb.ToString());
        }
Beispiel #6
0
        /// <summary>
        /// 控件行命令事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void repInfo_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName.Equals("del"))
            {
                int id = Convert.ToInt32(e.CommandArgument);
                IndexUserService.Delete(id);
                sp.InitBindData(repInfo, pager1, "IndexUser", "id", sear());
            }
            if (e.CommandName.Equals("mod"))
            {
                IndexUser nt = IndexUserService.GetModel(Convert.ToInt32(e.CommandArgument));
                if (nt != null)
                {
                    Label lblOrder = e.Item.FindControl("lblOrder") as Label;
                    lblOrder.Visible = false;
                    TextBox txtOrderNum = e.Item.FindControl("txtOrderNum") as TextBox;
                    txtOrderNum.Visible = true;

                    Label lblFullName = e.Item.FindControl("lblFullName") as Label;
                    lblFullName.Visible = false;
                    TextBox txtFullName = e.Item.FindControl("txtFullName") as TextBox;
                    txtFullName.Visible = true;


                    LinkButton lbtnMod = e.Item.FindControl("lbtnMod") as LinkButton;
                    lbtnMod.Visible = false;
                    LinkButton lbtnSave = e.Item.FindControl("lbtnSave") as LinkButton;
                    lbtnSave.Visible = true;
                }
                else
                {
                    Label lblName = e.Item.FindControl("lblName") as Label;
                    lblName.Visible = false;
                    TextBox txtName = e.Item.FindControl("txtModName") as TextBox;
                    txtName.Visible = true;
                    LinkButton lbtnMod = e.Item.FindControl("lbtnMod") as LinkButton;
                    lbtnMod.Visible = false;
                    LinkButton lbtnSave = e.Item.FindControl("lbtnSave") as LinkButton;
                    lbtnSave.Visible = true;
                }
            }
            if (e.CommandName.Equals("save"))
            {
                TextBox txtOrderNum = e.Item.FindControl("txtOrderNum") as TextBox;
                string  orderNum    = txtOrderNum.Text.Trim();
                if (orderNum.Length != 0)
                {
                    if (!RegExp.IsNumeric(orderNum))
                    {
                        ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('顺序号输入有误!');", true);
                        return;
                    }
                }
                TextBox txtFullName = e.Item.FindControl("txtFullName") as TextBox;
                string  fullName    = txtFullName.Text.Trim();
                if (fullName.Length == 0)
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('名称不能为空!');", true);
                    return;
                }



                IndexUser nt = IndexUserService.GetModel(Convert.ToInt32(e.CommandArgument));
                if (nt != null)
                {
                    if (txtOrderNum.Text.Trim() != "")
                    {
                        nt.infoType = Convert.ToInt32(txtOrderNum.Text.Trim());
                    }
                    nt.id = Convert.ToInt32(e.CommandArgument);
                    int num = IndexUserService.Update(nt.id, nt.infoType);
                    if (num > 0)
                    {
                        ///更新基本信息全称和用户表全称

                        UserBase ub = UserBaseService.GetModelByUserId(nt.userId);
                        if (ub != null)
                        {
                            UserBaseService.UpdateFullName(ub.id, fullName);
                            UserInfo user = UserInfoService.GetModel(ub.userId);
                            if (user != null)
                            {
                                user.comName = fullName;
                                UserInfoService.UpdateComName(user);
                            }
                        }
                        ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('保存成功!');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('保存失败!');", true);
                    }
                }
                sp.InitBindData(this.repInfo, pager1, "IndexUser", "id", sear());
            }
        }
 private void DeleteUserBase()
 {
     int id = 1;
     IUserBaseService cs = new UserBaseService();
     var result          = cs.DeleteSingleUserBase(id);
 }