Пример #1
0
        private void DoBatchSave()
        {
            IList <string> entStrList = RequestData.GetList <string>("data");

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

                        if (user != null && user.Wage + "" != dic["Wage"] + "")
                        {
                            user.Bonus  = dic.ContainsKey("Bonus") && (dic["Bonus"] + "") != "" ? (decimal?)Convert.ToDecimal(dic["Bonus"]) : null;
                            user.Total  = dic.ContainsKey("Total") && (dic["Total"] + "") != "" ? (decimal?)Convert.ToDecimal(dic["Total"]) : null;
                            user.Remark = dic.ContainsKey("Remark") ? dic["Remark"] + "" : "";
                            user.DoUpdate();
                        }
                    }
                }
            }
        }
Пример #2
0
        private void DoBatchDelete()
        {
            IList <object> idList = RequestData.GetList <object>("IdList");

            if (idList != null && idList.Count > 0)
            {
                UserWage.DoBatchDelete(idList.ToArray());
            }
        }