예제 #1
0
 //从数据行中读取数据到TrainPlanMin中
 public static void TuiQinTimeLogFromDB(TuiQinTimeLog Log, DataRow dr)
 {
     Log.strGroupGUID      = dr["strGroupGUID"].ToString();
     Log.dtOldArriveTime   = TFParse.DBToDateTime(dr["dtOldArriveTime"], DateTime.Parse("1899-01-01"));
     Log.dtNewArriveTime   = TFParse.DBToDateTime(dr["dtNewArriveTime"], DateTime.Parse("1899-01-01"));
     Log.strDutyUserNumber = dr["strDutyUserNumber"].ToString(); //FieldByName('strDutyUserNumber').AsString;
     Log.strDutyUserName   = dr["strDubyUserName"].ToString();   //FieldByName('strDubyUserName').AsString;
     Log.dtCreateTime      = TFParse.DBToDateTime(dr["dtCreateTime"], DateTime.Parse("1899-01-01"));
 }
예제 #2
0
        public static void Save(TuiQinTimeLog Log)
        {
            string strSql = @"insert into Tab_Plan_ModifyLastArriveTime_Log (strGroupGUID,nType,dtOldArriveTime,dtNewArriveTime,strDutyUserNumber,strDubyUserName,dtCreateTime) 
            values (@strGroupGUID,@nType,@dtOldArriveTime,@dtNewArriveTime,@strDutyUserNumber,@strDubyUserName,@dtCreateTime)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("strGroupGUID", Log.strGroupGUID),
                new SqlParameter("nType", Log.nType),
                new SqlParameter("dtOldArriveTime", Log.dtOldArriveTime),
                new SqlParameter("dtNewArriveTime", Log.dtNewArriveTime),
                new SqlParameter("strDutyUserNumber", Log.strDutyUserNumber),
                new SqlParameter("strDubyUserName", Log.strDutyUserName),
                new SqlParameter("dtCreateTime", Log.dtCreateTime)
            };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams);
        }