Ejemplo n.º 1
0
        private void DoBatchSave()
        {
            IList <string> entStrList = RequestData.GetList <string>("data");

            if (entStrList != null && entStrList.Count > 0)
            {
                SysUser user = null;
                Dictionary <string, object> dic = null;
                foreach (string str in entStrList)
                {
                    dic = FromJson(str) as Dictionary <string, object>;
                    if (dic != null)
                    {
                        user = SysUser.FindAllByPrimaryKeys(dic["UserID"]).FirstOrDefault <SysUser>();

                        if (user != null && user.Wage + "" != dic["Wage"] + "")
                        {
                            user.Wage = dic["Wage"] == null ? null : (decimal?)Convert.ToDecimal(dic["Wage"]);
                            user.DoUpdate();
                        }
                    }
                }
            }
        }