Ejemplo n.º 1
0
        /// <summary>
        /// Delete door
        /// </summary>
        /// <param name="creator">User login</param>
        /// <returns>OK or error from DB</returns>
        public string Delete(string creator)
        {
            string    result = "OK";
            DataTable dt     = null;

            try
            {
                ServiceReference1.WSACUSoapClient client = new ServiceReference1.WSACUSoapClient();
                DataSet ds = client.DoorSave("D", doorId, "", "", "", "", "", "", creator, DateTime.Now);
                dt     = ds.Tables[0];
                result = dt.Rows[0][0].ToString();

                return(result);
            }
            catch (Exception ex)
            {
                return(string.Format("Door class - Delete: {0}", ex.ToString()));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Update door info
        /// </summary>
        /// <param name="creator">User login</param>
        /// <returns>OK or error from DB</returns>
        public string Update(string creator)
        {
            string    result = "OK";
            DataTable dt     = null;

            try
            {
                ServiceReference1.WSACUSoapClient client = new ServiceReference1.WSACUSoapClient();
                DataSet ds = client.DoorSave("U", doorId, doorName, DeviceControl.DeviceId, readerNumber, inputNumber, outputNumber, relayNumber, creator, DateTime.Now);
                dt     = ds.Tables[0];
                result = dt.Rows[0][0].ToString();

                return(result);
            }
            catch (Exception ex)
            {
                return(string.Format("Door class - Update: {0}", ex.ToString()));
            }
        }