Ejemplo n.º 1
0
    private string Edit()
    {
        string  res = "更新失败";
        DataSet ds  = SqlHelper.GetFiledNameAndComment("users");

        if (ds != null)
        {
            Dictionary <string, string> dict = new Dictionary <string, string>();
            string[] exceptedField           = new string[] { "passWord", "userId", "department", "departmentId", "companyId", "nativePlace", "post" };
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                if (!exceptedField.Contains <string>(row["field"].ToString()))
                {
                    dict.Add(row["field"].ToString(), Request.Form[row["field"].ToString()]);
                }
            }
            //dict.Add("departmentId", Request.Form["department"]);
            string id = Request.Form["userId"];

            res = UserInfoManage.UpdateInfos(dict, id);
        }

        return(res);
    }