public int InsertHingeDirection(HingeDirection pHingeDirection)
 {
     try
     {
         return(_AD.InsertHingeDirection(pHingeDirection));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public bool UpdateHingeDirection(HingeDirection pHingeDirection)
 {
     try
     {
         _AD.UpdateHingeDirection(pHingeDirection);
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public int InsertHingeDirection(HingeDirection pHingeDirection)
        {
            string sql = @"[spInsertHingeDirection] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pHingeDirection.Direction, pHingeDirection.Status.Id,
                                pHingeDirection.CreatorUser, pHingeDirection.ModificationUser);
            try
            {
                return(_MB.EjecutarSQL(_CN, sql));
            }
            catch (Exception err)
            {
                throw err;
            }
        }
        public void UpdateHingeDirection(HingeDirection pHingeDirection)
        {
            string sql = @"[spUpdateHingeDirection] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pHingeDirection.Id, pHingeDirection.Direction, pHingeDirection.Status.Id,
                                pHingeDirection.ModificationUser);
            try
            {
                _MB.EjecutarSQL(_CN, sql);
            }
            catch (Exception err)
            {
                throw err;
            }
        }
        public HingeDirection GetHingeDirectionById(int Id)
        {
            HingeDirection hinged = new HingeDirection();
            string         sql    = @"[spGetHingeDirection] '{0}' ";

            sql = string.Format(sql, Id);

            try
            {
                DataSet ds = new DataSet();
                ds = _MB.CreaDS(ds, "HingeDirection", sql, _CN);
                if (ds.Tables["HingeDirection"].Rows.Count > 0)
                {
                    foreach (DataRow item in ds.Tables["HingeDirection"].Rows)
                    {
                        hinged = new HingeDirection()
                        {
                            Id     = int.Parse(item["Id"].ToString()),
                            Status = new Status()
                            {
                                Id = int.Parse(item["IdStatus"].ToString()), Description = item["DescripStatus"].ToString()
                            },
                            Direction        = item["Direction"].ToString(),
                            CreationDate     = (item["CreationDate"].ToString() != "") ? DateTime.Parse(item["CreationDate"].ToString()) : DateTime.Parse("01/01/1900"),
                            ModificationDate = (item["ModificationDate"].ToString() != "") ? DateTime.Parse(item["ModificationDate"].ToString()) : DateTime.Parse("01/01/1900"),
                            CreatorUser      = int.Parse(item["CreatorUser"].ToString()),
                            ModificationUser = int.Parse(item["ModificationUser"].ToString()),
                        };
                    }
                }
                return(hinged);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #6
0
 /**
  * This is the constructor for the Door class.
  * It accepts the two corners that define the door, along with the ID, the corner that represents the hinge and the direction of the hinge.
  * Left and Right are interchangeable.
  */
 public Door(uint id, Corner left, Corner right, Corner hinge, HingeDirection direction)
     : base(id, left, right)
 {
     this.Hinge = hinge;
     this.Direction = direction;
 }