コード例 #1
0
 public int InsertMaterialxBottomRail(MaterialxBottomRail pMaterialxBottomRail)
 {
     try
     {
         return(_AD.InsertMaterialxBottomRail(pMaterialxBottomRail));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #2
0
 public bool UpdateMaterialxBottomRail(MaterialxBottomRail pMaterialxBottomRail)
 {
     try
     {
         _AD.UpdateMaterialxBottomRail(pMaterialxBottomRail);
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #3
0
        public void UpdateMaterialxBottomRail(MaterialxBottomRail pMaterialxBottomRail)
        {
            string sql = @"[spUpdateMaterialxBottomRail] '{0}', '{1}', '{2}', '{3}', '{4}'";

            sql = string.Format(sql, pMaterialxBottomRail.Id, pMaterialxBottomRail.Material.Id, pMaterialxBottomRail.BottomRail.Id, pMaterialxBottomRail.Status.Id,
                                pMaterialxBottomRail.ModificationUser);
            try
            {
                _MB.EjecutarSQL(_CN, sql);
            }
            catch (Exception err)
            {
                throw err;
            }
        }
コード例 #4
0
        public int InsertMaterialxBottomRail(MaterialxBottomRail pMaterialxBottomRail)
        {
            string sql = @"[spInsertMaterialxBottomRail] '{0}', '{1}', '{2}', '{3}', '{4}'";

            sql = string.Format(sql, pMaterialxBottomRail.Material.Id, pMaterialxBottomRail.BottomRail.Id, pMaterialxBottomRail.Status.Id,
                                pMaterialxBottomRail.CreatorUser, pMaterialxBottomRail.ModificationUser);
            try
            {
                return(_MB.EjecutarSQL(_CN, sql));
            }
            catch (Exception err)
            {
                throw err;
            }
        }
コード例 #5
0
        public MaterialxBottomRail GetMaterialxBottomRailById(int Id)
        {
            MaterialxBottomRail matrail = new MaterialxBottomRail();
            string sql = @"[spGetMaterialxBottomRail] '{0}' ";

            sql = string.Format(sql, Id);

            try
            {
                DataSet ds = new DataSet();
                ds = _MB.CreaDS(ds, "MaterialxBottomRail", sql, _CN);
                if (ds.Tables["MaterialxBottomRail"].Rows.Count > 0)
                {
                    foreach (DataRow item in ds.Tables["MaterialxBottomRail"].Rows)
                    {
                        matrail = new MaterialxBottomRail()
                        {
                            Id       = int.Parse(item["Id"].ToString()),
                            Material = new Material()
                            {
                                Id = int.Parse(item["IdMaterial"].ToString()), Description = item["DescripMaterial"].ToString(),
                            },
                            BottomRail = new BottomRail()
                            {
                                Id = int.Parse(item["IdBottomRail"].ToString()), Description = item["DescripBottomRail"].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(matrail);
            }
            catch (Exception)
            {
                throw;
            }
        }