示例#1
0
        public static bool Update(uaccountEntity item)
        {
            DataTable dt = DBAccess.DataAccess.Miou_GetDataSetBySql(DBAccess.LogUName, string.Format("select * from {0} where {1} = {2} ;", tableName, keyName, item.uid)).Tables[0];

            if (dt.Rows.Count == 1)
            {
                dt.Rows[0]["accountmony"] = item.accountmony;
                dt.Rows[0]["stopmoney"]   = item.stopmoney;
                return(DBAccess.DataAccess.Miou_UpdateDataSet("", tableName, "*", "1<>1", "", dt).StartsWith("000"));
            }
            else
            {
                return(true);
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public static uaccountEntity GetByKeyId(int id, ref string info)
        {
            try
            {
                uaccountEntity entity = new uaccountEntity();
                DataTable      dt     = DBAccess.DataAccess.Miou_GetDataSetBySql(DBAccess.LogUName, string.Format("select * from {0} where {1} = {2} ;", tableName, keyName, id)).Tables[0];
                var            list   = DBAccess.GetEntityList <uaccountEntity>(dt);
                if (list != null && list.Count > 0)
                {
                    entity = list[0];
                }

                return(entity);
            }
            catch (Exception ex)
            {
                info = ex.Message;
                return(new uaccountEntity());
            }
        }