示例#1
0
        public int Create(Person person)
        {
            int Id = (int)SqlMap.Insert("InsertPerson", person);

            SqlMap.CommitTransaction();

            return(Id);
        }
示例#2
0
 public void Insert(T entity)
 {
     using (DbConnection conn = _DataBase.CreateConnection())
     {
         conn.ConnectionString = _strConn;
         SqlMap <T> .Insert(entity, conn, _DataBase);
     }
 }
示例#3
0
 /// <summary>
 /// 不明账款缴存
 /// </summary>
 /// <param name="jdInfo"></param>
 /// <returns></returns>
 public bool AddUnKownJG_Deposit(UnknowBill jdInfo)
 {
     try
     {
         SqlMap.Insert("AddUnKownJG_Deposit", jdInfo);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 插入报文信息
 /// </summary>
 /// <param name="mi"></param>
 /// <returns></returns>
 public static bool AddJG_MessageInfo(JG_MessageInfo mi)
 {
     try
     {
         SqlMap.Insert("AddJG_MessageInfo", mi);
         return(true);
     }
     catch (Exception e)
     {
         //return false;
         throw e;
     }
 }
 /// <summary>
 /// 新增Payment
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static bool insertPaymentInfo(JG_PaymentInfo p)
 {
     try
     {
         SqlMap.Insert("insertPaymentInfo", p);
         return(true);
     }
     catch (Exception e)
     {
         //return false;
         throw e;
     }
 }
示例#6
0
        public static bool AddMenuItem(MenuItem mi, out string e)
        {
            bool result = true;

            try
            {
                SqlMap.Insert("InsertMenuItem", mi);
                e = null;
            }
            catch (Exception ex)
            {
                result = false;
                e      = ex.Message;
            }
            return(result);
        }
示例#7
0
 public void Insert(ICollection <T> entities)
 {
     using (DbConnection conn = _DataBase.CreateConnection())
     {
         conn.ConnectionString = _strConn;
         //  conn.Open();
         if (conn.GetType() == typeof(SqlConnection))
         {
             SqlMap <T> .SqlBulkInsert(entities, (SqlConnection)conn);
         }
         else
         {
             SqlMap <T> .Insert(entities, conn, _DataBase);
         }
     }
 }
示例#8
0
 /// <summary>
 /// 2013-07-26
 /// 添加班级信息
 /// </summary>
 /// <param name="calssses">班级实体</param>
 public void AddClaases(Calsses calssses)
 {
     SqlMap.Insert("InsertClasses", calssses);
 }
 public static bool ProtocolSave(JG_SpvProtocol jG_SpvProtocol)
 {
     SqlMap.Insert("InsertSpvProtocol", jG_SpvProtocol);
     return(true);
 }