public int InsertDoorStylexInsideEdgeProfile(DoorStyle pDoorStyle) { try { DoorStylexInsideEdgeProfile doorStylexInside = new DoorStylexInsideEdgeProfile(); foreach (var item in pDoorStyle.listInsideProfile) { doorStylexInside.CreationDate = DateTime.Now; doorStylexInside.ModificationDate = DateTime.Now; doorStylexInside.InsideEdgeProfile = new InsideEdgeProfile() { Id = item.Id }; doorStylexInside.DoorStyle = new DoorStyle() { Id = pDoorStyle.Id }; doorStylexInside.Status = new Status() { Id = pDoorStyle.Status.Id }; _AD.InsertDoorStylexInsideEdgeProfile(doorStylexInside); } return(1); } catch (Exception ex) { throw; } }
public int InsertDoorStyle(DoorStyle pDoorStyle) { try { return(_AD.InsertDoorStyle(pDoorStyle)); } catch (Exception ex) { throw; } }
public bool UpdateDoorStyle(DoorStyle pDoorStyle) { try { _AD.UpdateDoorStyle(pDoorStyle); return(true); } catch (Exception ex) { throw; } }
public int InsertDoorStyle(DoorStyle pDoorStyle) { string sql = @"[spInsertDoorStyle] '{0}', '{1}', '{2}', '{3}'"; sql = string.Format(sql, pDoorStyle.Description, pDoorStyle.Status.Id, pDoorStyle.CreatorUser, pDoorStyle.ModificationUser); try { return(_MB.EjecutarSQL(_CN, sql)); } catch (Exception err) { throw err; } }
public void UpdateDoorStyle(DoorStyle pDoorStyle) { string sql = @"[spUpdateDoorStyle] '{0}', '{1}', '{2}', '{3}'"; sql = string.Format(sql, pDoorStyle.Id, pDoorStyle.Description, pDoorStyle.Status.Id, pDoorStyle.ModificationUser); try { _MB.EjecutarSQL(_CN, sql); } catch (Exception err) { throw err; } }
public DoorStyle GetDoorStyleById(int Id) { DoorStyle doorStyle = new DoorStyle(); string sql = @"[spGetDoorStyle] '{0}' "; sql = string.Format(sql, Id); try { DataSet ds = new DataSet(); ds = _MB.CreaDS(ds, "DoorStyle", sql, _CN); if (ds.Tables["DoorStyle"].Rows.Count > 0) { foreach (DataRow item in ds.Tables["DoorStyle"].Rows) { doorStyle = new DoorStyle() { Id = int.Parse(item["Id"].ToString()), Status = new Status() { Id = int.Parse(item["IdStatus"].ToString()), Description = item["DescripStatus"].ToString() }, Description = item["Description"].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(doorStyle); } catch (Exception) { throw; } }