Beispiel #1
0
 public int InsertHorizontalDivisions(HorizontalDivisions pHorizontalDivisions)
 {
     try
     {
         return(_AD.InsertHorizontalDivisions(pHorizontalDivisions));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #2
0
 public bool UpdateHorizontalDivisions(HorizontalDivisions pHorizontalDivisions)
 {
     try
     {
         _AD.UpdateHorizontalDivisions(pHorizontalDivisions);
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #3
0
        public int InsertHorizontalDivisions(HorizontalDivisions pHorizontalDivisions)
        {
            string sql = @"[spInsertHorizontalDivisions] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pHorizontalDivisions.Quantity, pHorizontalDivisions.Status.Id,
                                pHorizontalDivisions.CreatorUser, pHorizontalDivisions.ModificationUser);
            try
            {
                return(_MB.EjecutarSQL(_CN, sql));
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Beispiel #4
0
        public void UpdateHorizontalDivisions(HorizontalDivisions pHorizontalDivisions)
        {
            string sql = @"[spUpdateHorizontalDivisions] '{0}', '{1}', '{2}', '{3}'";

            sql = string.Format(sql, pHorizontalDivisions.Id, pHorizontalDivisions.Quantity, pHorizontalDivisions.Status.Id,
                                pHorizontalDivisions.ModificationUser);
            try
            {
                _MB.EjecutarSQL(_CN, sql);
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Beispiel #5
0
        public HorizontalDivisions GetHorizontalDivisionsById(int Id)
        {
            HorizontalDivisions hordiv = new HorizontalDivisions();
            string sql = @"[spGetHorizontalDivisions] '{0}' ";

            sql = string.Format(sql, Id);

            try
            {
                DataSet ds = new DataSet();
                ds = _MB.CreaDS(ds, "HorizontalDivisions", sql, _CN);
                if (ds.Tables["HorizontalDivisions"].Rows.Count > 0)
                {
                    foreach (DataRow item in ds.Tables["HorizontalDivisions"].Rows)
                    {
                        hordiv = new HorizontalDivisions()
                        {
                            Id       = int.Parse(item["Id"].ToString()),
                            Quantity = int.Parse(item["Quantity"].ToString()),
                            Status   = new Status()
                            {
                                Id = int.Parse(item["IdStatus"].ToString()), Description = item["DescripStatus"].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(hordiv);
            }
            catch (Exception)
            {
                throw;
            }
        }