Ejemplo n.º 1
0
 public void commandUser(int objectId, int sensorId, int commandId)
 {
     try
     {
         CommandLogUserModel _obj = new CommandLogUserModel();
         _obj.CommandID = commandId;
         _obj.ObjectID  = objectId;
         _obj.SensorID  = sensorId;
         if (Session["admin"] != null)
         {
             _obj.UserID = 2;
         }
         if (Session["poweruser"] != null)
         {
             string   temp    = Session["poweruser"].ToString();
             string[] IdSplit = temp.Split(',');
             _obj.UserID = Convert.ToInt32(IdSplit[0]);
         }
         if (Session["user"] != null)
         {
             string   temp    = Session["user"].ToString();
             string[] IdSplit = temp.Split(',');
             _obj.UserID = Convert.ToInt32(IdSplit[0]);
         }
         obj.postCommandLogUser(_obj);
     }
     catch (Exception)
     { BindingClass.ExceptionAlertScriptManager(this.Page, this.GetType()); }
 }
Ejemplo n.º 2
0
 public bool postCommandLogUser(CommandLogUserModel _object)
 {
     SqlParameter[] parameters = new SqlParameter[]
     {
         new SqlParameter("@UserID", _object.UserID),
         new SqlParameter("@ObjectID", _object.ObjectID),
         new SqlParameter("@SensorID", _object.SensorID),
         new SqlParameter("@CommandID", _object.CommandID),
     };
     return(DBHelper.ExecuteNonQuery("uspPOST_CommandUserLog", CommandType.StoredProcedure, parameters));
 }
Ejemplo n.º 3
0
 public bool postCommandLogUser(CommandLogUserModel _object)
 {
     return(obj.postCommandLogUser(_object));
 }