Ejemplo n.º 1
0
 /// <summary>
 /// ɾ������
 /// </summary>
 /// <param name="ID">D_Saver��ID</param>
 /// <returns>"0101"��ʾ�ɹ���"0"��ʾʧ��</returns>
 public static string Delete(long ID)
 {
     DataBase db = new DataBase();
     DataBaseVisitor visitor = new DAL.Search.SearchDal();
     bool bSuc = false;
     int nEffectRows = 0;
     SqlParameter[] prams ={
         db.MakeInParam("@ID", SqlDbType.BigInt,8,ID),
     };
     try
     {
         bSuc = db.TransactSql(visitor, "Delete", prams, out nEffectRows);
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
     finally
     {
         db.Dispose();
     }
     if (bSuc && nEffectRows > 0)
         return "0101";
     else
         return "0";
 }
Ejemplo n.º 2
0
 /// <summary>
 /// �޸�������Ϣ
 /// </summary>
 /// <param name="Item">model</param>
 /// <returns></returns>
 public static string Update(Model.Search.C_SelectModel Item)
 {
     DataBase db = new DataBase();
     DataBaseVisitor visitor = new DAL.Search.SearchDal();
     bool bSuc = false;
     int nEffectRows = 0;
     SqlParameter[] prams ={
         db.MakeInParam("@As", SqlDbType.VarChar,50, Item.As),
         db.MakeInParam("@Show", SqlDbType.Bit,4, Item.Show),
         db.MakeInParam("@Place", SqlDbType.BigInt,8, Item.Place),
         db.MakeInParam("@ID", SqlDbType.BigInt,50, Item.ID),
     };
     try
     {
         bSuc = db.TransactSql(visitor, "Update", prams, out nEffectRows);
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
     finally
     {
         db.Dispose();
     }
     if (bSuc && nEffectRows > 0)
         return "0101";
     else
         return "0";
 }
Ejemplo n.º 3
0
 /// <summary>
 /// ��ѯȫ��������Ŀ
 /// </summary>
 /// <returns></returns>
 public static DataSet Select_Select()
 {
     DataBase db = new DataBase();
     DataBaseVisitor visitor = new DAL.Search.SearchDal();
     DataSet ds = new DataSet();
     try
     {
         ds = db.ReturnDataSet(visitor, "Select_V_C_Select", "V_C_Select");
     }
     catch (Exception ex)
     { throw new Exception(ex.Message); }
     finally
     {
         db.Dispose();
     }
     return ds;
 }