Пример #1
0
 public int InsertTopRail(TopRail pTopRail)
 {
     try
     {
         return(_AD.InsertTopRail(pTopRail));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #2
0
 public bool UpdateTopRail(TopRail pTopRail)
 {
     try
     {
         _AD.UpdateTopRail(pTopRail);
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #3
0
        public int InsertTopRail(TopRail pTopRail)
        {
            string sql = @"[spInsertTopRail] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pTopRail.Description, pTopRail.Status.Id,
                                pTopRail.CreatorUser, pTopRail.ModificationUser);
            try
            {
                return(_MB.EjecutarSQL(_CN, sql));
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Пример #4
0
        public void UpdateTopRail(TopRail pTopRail)
        {
            string sql = @"[spUpdateTopRail] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pTopRail.Id, pTopRail.Description, pTopRail.Status.Id,
                                pTopRail.ModificationUser);
            try
            {
                _MB.EjecutarSQL(_CN, sql);
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Пример #5
0
        public TopRail GetTopRailById(int Id)
        {
            TopRail toprail = new TopRail();
            string  sql     = @"[spGetTopRail] '{0}' ";

            sql = string.Format(sql, Id);

            try
            {
                DataSet ds = new DataSet();
                ds = _MB.CreaDS(ds, "TopRail", sql, _CN);
                if (ds.Tables["TopRail"].Rows.Count > 0)
                {
                    foreach (DataRow item in ds.Tables["TopRail"].Rows)
                    {
                        toprail = new TopRail()
                        {
                            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(toprail);
            }
            catch (Exception)
            {
                throw;
            }
        }