Ejemplo n.º 1
0
        public static TaiLieuThuTuc getFromReader(IDataReader rd)
        {
            TaiLieuThuTuc Item = new TaiLieuThuTuc();

            if (rd.FieldExists("TLTT_ID"))
            {
                Item.ID = (Int32)(rd["TLTT_ID"]);
            }
            if (rd.FieldExists("TLTT_Ten"))
            {
                Item.Ten = (String)(rd["TLTT_Ten"]);
            }
            if (rd.FieldExists("TLTT_CID"))
            {
                Item.CID = (Guid)(rd["TLTT_CID"]);
            }
            if (rd.FieldExists("TLTT_PID"))
            {
                Item.PID = (Guid)(rd["TLTT_PID"]);
            }
            if (rd.FieldExists("TLTT_RowId"))
            {
                Item.RowId = (Guid)(rd["TLTT_RowId"]);
            }
            if (rd.FieldExists("TLTT_Kieu"))
            {
                Item.Kieu = (Int32)(rd["TLTT_Kieu"]);
            }
            if (rd.FieldExists("TLTT_SoLuong"))
            {
                Item.SoLuong = (Int32)(rd["TLTT_SoLuong"]);
            }
            return(Item);
        }
Ejemplo n.º 2
0
        public static TaiLieuThuTuc SelectById(Int32 TLTT_ID)
        {
            TaiLieuThuTuc Item = new TaiLieuThuTuc();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("TLTT_ID", TLTT_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblTaiLieuThuTuc_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Ejemplo n.º 3
0
        public static TaiLieuThuTuc Insert(TaiLieuThuTuc Inserted)
        {
            TaiLieuThuTuc Item = new TaiLieuThuTuc();

            SqlParameter[] obj = new SqlParameter[6];
            obj[0] = new SqlParameter("TLTT_Ten", Inserted.Ten);
            obj[1] = new SqlParameter("TLTT_CID", Inserted.CID);
            obj[2] = new SqlParameter("TLTT_PID", Inserted.PID);
            obj[3] = new SqlParameter("TLTT_RowId", Inserted.RowId);
            obj[4] = new SqlParameter("TLTT_Kieu", Inserted.Kieu);
            obj[5] = new SqlParameter("TLTT_SoLuong", Inserted.SoLuong);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblTaiLieuThuTuc_Insert_InsertNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }