Esempio n. 1
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int zhishidian2timusuoyinAdd(Entity.zhishidian2timusuoyin info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@ZhiShiDianId", SqlDbType.Int,       4, info.ZhiShiDianId),
         SqlDB.MakeInParam("@TiMuSuoYinId", SqlDbType.Int,       4, info.TiMuSuoYinId),
         SqlDB.MakeInParam("@gid",          SqlDbType.NVarChar, 50, info.gid),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "zhishidian2timusuoyinAdd", prams).ToString(), -1));
 }
Esempio n. 2
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="Id">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.zhishidian2timusuoyin zhishidian2timusuoyinEntityGet(int Id)
        {
            Entity.zhishidian2timusuoyin info = new Entity.zhishidian2timusuoyin();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [zhishidian2timusuoyin] WHERE Id = " + Id + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.Id           = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0);
                info.ZhiShiDianId = Basic.Utils.StrToInt(dt.Rows[0]["ZhiShiDianId"].ToString(), 0);
                info.TiMuSuoYinId = Basic.Utils.StrToInt(dt.Rows[0]["TiMuSuoYinId"].ToString(), 0);
                info.gid          = dt.Rows[0]["gid"].ToString();
            }
            return(info);
        }
Esempio n. 3
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool zhishidian2timusuoyinEdit(Entity.zhishidian2timusuoyin info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@Id",           SqlDbType.Int,       4, info.Id),
                SqlDB.MakeInParam("@ZhiShiDianId", SqlDbType.Int,       4, info.ZhiShiDianId),
                SqlDB.MakeInParam("@TiMuSuoYinId", SqlDbType.Int,       4, info.TiMuSuoYinId),
                SqlDB.MakeInParam("@gid",          SqlDbType.NVarChar, 50, info.gid),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "zhishidian2timusuoyinEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }