Esempio n. 1
0
 private void eShowInfo(string estrid)
 {
     Maticsoft.BLL.NewPort.Table_user   bll   = new Maticsoft.BLL.NewPort.Table_user();
     Maticsoft.Model.NewPort.Table_user model = bll.GetModel(estrid);
     this.lbl_account.Text          = model.user_id;
     this.lbl_address.Text          = model.user_contacterInfo;
     this.lbl_name.Text             = model.user_name;
     this.lbl_owner.Text            = model.user_liablePerson;
     this.lbl_pwd.Text              = model.user_password;
     this.DDLPlanType.SelectedValue = model.user_dept;
 }
Esempio n. 2
0
        protected void btneSubmit_Click(object sender, EventArgs e)
        {
            Maticsoft.Model.NewPort.Table_user model = new Maticsoft.Model.NewPort.Table_user();
            model.user_id            = lbl_account.Text;
            model.user_contacterInfo = lbl_address.Text;
            model.user_name          = lbl_name.Text;
            model.user_liablePerson  = lbl_owner.Text;
            model.user_password      = lbl_pwd.Text;
            model.user_dept          = DDLPlanType.SelectedValue;

            Maticsoft.BLL.NewPort.Table_user bll = new Maticsoft.BLL.NewPort.Table_user();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "User_Management.aspx");
        }
Esempio n. 3
0
 protected void btneSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         Maticsoft.Model.NewPort.Table_user model = new Maticsoft.Model.NewPort.Table_user();
         model.user_id            = txtAccount.Text;
         model.user_name          = txtName.Text;
         model.user_dept          = ddlDepart.SelectedValue;
         model.user_liablePerson  = txtPerson.Text;
         model.user_contacterInfo = txtConnect.Text;
         model.user_password      = txtPwd.Text;
         Maticsoft.BLL.NewPort.Table_user bll = new Maticsoft.BLL.NewPort.Table_user();
         bll.Add(model);
         Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "User_Management.aspx");
     }
     catch (Exception e2)
     {
         Maticsoft.Common.MessageBox.ShowAndRedirect(this, "填写错误,请重新确认后再提交!", "UserAdd.aspx");
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.NewPort.Table_user model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Table_user set ");
            strSql.Append("user_name=@user_name,");
            strSql.Append("user_dept=@user_dept,");
            strSql.Append("user_liablePerson=@user_liablePerson,");
            strSql.Append("user_contacterInfo=@user_contacterInfo,");
            strSql.Append("user_authority=@user_authority,");
            strSql.Append("user_password=@user_password");
            strSql.Append(" where user_id=@user_id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@user_name",          SqlDbType.NVarChar, 20),
                new SqlParameter("@user_dept",          SqlDbType.NVarChar, 20),
                new SqlParameter("@user_liablePerson",  SqlDbType.NVarChar, 20),
                new SqlParameter("@user_contacterInfo", SqlDbType.VarChar,  20),
                new SqlParameter("@user_authority",     SqlDbType.Int,       4),
                new SqlParameter("@user_password",      SqlDbType.VarChar,  20),
                new SqlParameter("@user_id",            SqlDbType.Char, 8)
            };
            parameters[0].Value = model.user_name;
            parameters[1].Value = model.user_dept;
            parameters[2].Value = model.user_liablePerson;
            parameters[3].Value = model.user_contacterInfo;
            parameters[4].Value = model.user_authority;
            parameters[5].Value = model.user_password;
            parameters[6].Value = model.user_id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.NewPort.Table_user model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Table_user(");
            strSql.Append("user_id,user_name,user_dept,user_liablePerson,user_contacterInfo,user_authority,user_password)");
            strSql.Append(" values (");
            strSql.Append("@user_id,@user_name,@user_dept,@user_liablePerson,@user_contacterInfo,@user_authority,@user_password)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@user_id",            SqlDbType.Char,      8),
                new SqlParameter("@user_name",          SqlDbType.NVarChar, 20),
                new SqlParameter("@user_dept",          SqlDbType.NVarChar, 20),
                new SqlParameter("@user_liablePerson",  SqlDbType.NVarChar, 20),
                new SqlParameter("@user_contacterInfo", SqlDbType.VarChar,  20),
                new SqlParameter("@user_authority",     SqlDbType.Int,       4),
                new SqlParameter("@user_password",      SqlDbType.VarChar, 20)
            };
            parameters[0].Value = model.user_id;
            parameters[1].Value = model.user_name;
            parameters[2].Value = model.user_dept;
            parameters[3].Value = model.user_liablePerson;
            parameters[4].Value = model.user_contacterInfo;
            parameters[5].Value = model.user_authority;
            parameters[6].Value = model.user_password;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 6
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.NewPort.Table_user DataRowToModel(DataRow row)
 {
     Maticsoft.Model.NewPort.Table_user model = new Maticsoft.Model.NewPort.Table_user();
     if (row != null)
     {
         if (row["user_id"] != null)
         {
             model.user_id = row["user_id"].ToString();
         }
         if (row["user_name"] != null)
         {
             model.user_name = row["user_name"].ToString();
         }
         if (row["user_dept"] != null)
         {
             model.user_dept = row["user_dept"].ToString();
         }
         if (row["user_liablePerson"] != null)
         {
             model.user_liablePerson = row["user_liablePerson"].ToString();
         }
         if (row["user_contacterInfo"] != null)
         {
             model.user_contacterInfo = row["user_contacterInfo"].ToString();
         }
         if (row["user_authority"] != null && row["user_authority"].ToString() != "")
         {
             model.user_authority = int.Parse(row["user_authority"].ToString());
         }
         if (row["user_password"] != null)
         {
             model.user_password = row["user_password"].ToString();
         }
     }
     return(model);
 }
Esempio n. 7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.NewPort.Table_user GetModel(string user_id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 user_id,user_name,user_dept,user_liablePerson,user_contacterInfo,user_authority,user_password from Table_user ");
            strSql.Append(" where user_id=@user_id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@user_id", SqlDbType.Char, 8)
            };
            parameters[0].Value = user_id;

            Maticsoft.Model.NewPort.Table_user model = new Maticsoft.Model.NewPort.Table_user();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }