Пример #1
0
 public object InsertSJData(sj_line model)
 {
     try
     {
         return(new QZDBRepository().InsertSJData(model));
     }
     catch (Exception ex)
     {
         Utils.Logger.Error(ex.Message);
         throw ex;
     }
 }
Пример #2
0
 public object InsertSJData(string sessionId, sj_line model)
 {
     try
     {
         return(new ForQZDBServices().InsertSJData(model));
     }
     catch (Exception ex)
     {
         throw new FaultException <CustomFaultMessage>(new CustomFaultMessage()
         {
             ErrorCode  = ex.HResult,
             Message    = ex.Message,
             StackTrace = ex.StackTrace
         }, ex.Message);
     }
 }
Пример #3
0
        public object InsertSJData(sj_line mode)
        {
            int    Serial;
            string strSqlNum = string.Format("select count(line) as LineNum from sj_line where paichan='{0}' ", mode.paichan);

            var datasetNum = SqlHelper.Query(DbProvider.LY_DBConnect, strSqlNum);

            if (datasetNum.Tables[0].Rows[0]["LineNum"].ToString() == null || datasetNum.Tables[0].Rows[0]["LineNum"].ToString() == "")
            {
                Serial = 0;
            }
            else
            {
                Serial = Convert.ToInt16(datasetNum.Tables[0].Rows[0]["LineNum"].ToString()) + 1;
            }

            string strSql = string.Format("insert into  sj_line(line,type,paichan,weightA,timeA,qk,serial) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", mode.line, mode.type, mode.paichan, mode.weightA, mode.timeA, mode.qk, Serial);

            var dataset = SqlHelper.ExecuteNonQuery(DbProvider.LY_DBConnect, strSql);

            return(dataset);
        }