Esempio n. 1
0
 public static void Populate(BLibraryPro.Member Member, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_MEMBER.MEMBER_CODE,
                     M_MEMBER.TYPE_CODE,
                     M_MEMBER.FNAME,
                     M_MEMBER.MNAME,
                     M_MEMBER.LNAME,
                     M_MEMBER.CITY_CODE,
                     M_MEMBER.REGISTERED_BY,
                     M_MEMBER.REGISTERED_DATE,
                     M_MEMBER.ACTIVE_FLAG,
                     M_MEMBER.REASON_FOR_INACTIVE,
                     M_MEMBER.INACTIVE_DATE,
                     M_MEMBER.INACTIVATED_BY
                     FROM M_MEMBER
                     where MEMBER_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         Member.MemberCode = new_code;
         Member.TypeCode = odr["TYPE_CODE"].ToString();
         Member.FirstName = odr["FNAME"].ToString();
         Member.MiddleName = odr["MNAME"].ToString();
         Member.LastName = odr["LNAME"].ToString();
         Member.CityCode = odr["CITY_CODE"].ToString();
         Member.RegisteredBy = odr["REGISTERED_BY"].ToString();
         Member.RegisteredDate = Convert.ToDateTime(odr["REGISTERED_DATE"].ToString());
         Member.ActiveFlag = odr["ACTIVE_FLAG"].ToString();
         Member.InactiveReason = odr["REASON_FOR_INACTIVE"].ToString();
         Member.InactivedDate = Convert.ToDateTime(odr["INACTIVE_DATE"].ToString());
         Member.InactivatedBy = odr["INACTIVATED_BY"].ToString();
     }
 }
Esempio n. 2
0
 public static void Populate(BLibraryPro.BookLot BookLot, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_BOOK_LOT.BOOK_LOT_NO,
                     M_BOOK_LOT.BOOK_CODE,
                     M_BOOK_LOT.EDITION_CODE,
                     M_BOOK_LOT.YEAR_OF_PUBLICATION,
                     M_BOOK_LOT.ISBN,
                     M_BOOK_LOT.PRICE,
                     M_BOOK_LOT.NO_OF_PAGES,
                     M_BOOK_LOT.SOURCE_TYPE_CODE,
                     M_BOOK_LOT.RECEIVED_ON,
                     M_BOOK_LOT.NO_OF_BOOKS
                     FROM M_BOOK_LOT
                     where BOOK_LOT_NO = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         BookLot.BookLotNo = Convert.ToInt32(new_code);
         BookLot.BookCode = Convert.ToInt32(odr["BOOK_CODE"].ToString());
         BookLot.EditionCode = odr["EDITION_CODE"].ToString();
         BookLot.YearOfPublication = Convert.ToInt32(odr["YEAR_OF_PUBLICATION"].ToString());
         BookLot.ISBN = odr["ISBN"].ToString();
         BookLot.Price = float.Parse(odr["PRICE"].ToString());
         BookLot.NoOfPage = Convert.ToInt32(odr["NO_OF_PAGES"].ToString());
         BookLot.SourceTypeCode = odr["SOURCE_TYPE_CODE"].ToString();
         BookLot.ReceivedOn = Convert.ToDateTime(odr["RECEIVED_ON"].ToString());
         BookLot.NoOfBooks = Convert.ToInt32(odr["NO_OF_BOOKS"].ToString());
     }
 }
Esempio n. 3
0
        public static string GetNewID(string ruleName)
        {
            //
               DataAccess da = new DataAccess();
               OracleDataReader odr;
               decimal org_new_id= 0;
               string new_val = "";
               odr = da.ExecuteReader("select * from auto_num where rule_name = '"+ruleName+"'", CommandType.Text);
               if (odr.Read())
               {
               string prefix = odr["PRE_FIX"].ToString();
               string old_val = odr["CUR_VALUE"].ToString();
               string pad_char = odr["PAD_CHAR"].ToString();
               int len = Convert.ToInt32(odr["LENGTH"]);
               string pad_val="";

               for (int i = 0; i < len - prefix.Length-old_val.Length; i++)
               {
                   pad_val += pad_char;
               }
               org_new_id = Convert.ToDecimal(odr["CUR_VALUE"]);
               new_val = prefix + pad_val + org_new_id.ToString();
               //update to new
               odr.Close();
               da.ExecuteNonQuery("update auto_num set cur_value = cur_value+1 where rule_name = '" + ruleName + "' ", CommandType.Text);
               }
               return new_val;
        }
Esempio n. 4
0
 public static void Populate(BLibraryPro.Edition edition, string new_code)
 {
     DataAccess da = new DataAccess();
        string sql = @"SELECT M_EDITION.EDITION_CODE,
                       M_EDITION.EDITION_DESC,
                       M_EDITION.REMARKS
                     FROM M_EDITION
                     where EDITION_CODE = '" + new_code + "'";
        OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
        if (odr.Read())
        {
        edition.EditionCode = new_code;
        edition.EditionDesc = odr["EDITION_DESC"].ToString();
        edition.Remarks = odr["REMARKS"].ToString();
        }
 }
Esempio n. 5
0
 public static void Populate(BLibraryPro.CardType cardType, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_MEMBER_CARD_TYPES.CARD_TYPE,
                       M_MEMBER_CARD_TYPES.TYPE_DESC,
                       M_MEMBER_CARD_TYPES.NO_OF_BOOKS_ALLOWED
                     FROM M_MEMBER_CARD_TYPES
                     where CARD_TYPE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         cardType.CardTypeCode = new_code;
         cardType.TypeDesc = odr["TYPE_DESC"].ToString();
         cardType.BooksAllowed = Convert.ToInt32(odr["NO_OF_BOOKS_ALLOWED"]);
     }
 }
Esempio n. 6
0
 public static void Populate(BLibraryPro.BookSource source, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_BOOK_SOURCE.SOURCE_TYPE_CODE,
                       M_BOOK_SOURCE.SOURCE_DESC,
                       M_BOOK_SOURCE.REMARKS
                     FROM M_BOOK_SOURCE
                     where SOURCE_TYPE_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         source.SourceTypeCode = new_code;
         source.SourceDesc = odr["SOURCE_DESC"].ToString();
         source.remarks = odr["REMARKS"].ToString();
     }
 }
Esempio n. 7
0
 public static void Populate(BLibraryPro.Category category, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_BOOK_CATEGORY.CATEGORY_CODE,
                       M_BOOK_CATEGORY.CATEGORY_DESC,
                       M_BOOK_CATEGORY.REMARKS
                     FROM M_BOOK_CATEGORY
                     where category_code = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         category.CategoryCode = new_code;
         category.CategoryDesc = odr["CATEGORY_DESC"].ToString();
         category.remarks = odr["REMARKS"].ToString();
     }
 }
Esempio n. 8
0
 public static void Populate(BLibraryPro.Publication publication, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_PUBLICATION.PUBLICATION_CODE,
                       M_PUBLICATION.PUBLICATION_DESC,
                       M_PUBLICATION.COUNTRY_CODE,
                       M_PUBLICATION.ESTABLISHED_DATE
                     FROM M_PUBLICATION
                     where publication_code = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         //publication.PublicationCode = new_code;
         publication.PublicationDesc = odr["PUBLICATION_DESC"].ToString();
         publication.CountryCode = odr["COUNTRY_CODE"].ToString();
         publication.EstDate = Convert.ToDateTime(odr["ESTABLISHED_DATE"].ToString());
     }
 }
Esempio n. 9
0
 public static void Populate(BLibraryPro.MemberType MemberType, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_LIBRARY_MEMBER_TYPE.TYPE_CODE,
                       M_LIBRARY_MEMBER_TYPE.TYPE_DESC,
                       M_LIBRARY_MEMBER_TYPE.ACTIVE_FLAG,
                       M_LIBRARY_MEMBER_TYPE.REASON_FOR_INACTIVE
                     FROM M_LIBRARY_MEMBER_TYPE
                     where TYPE_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         MemberType.MemberTypeCode = new_code;
         MemberType.TypeDesc = odr["TYPE_DESC"].ToString();
         MemberType.ActiveFlag = odr["ACTIVE_FLAG"].ToString();
         MemberType.Reason = odr["REASON_FOR_INACTIVE"].ToString();
     }
 }
Esempio n. 10
0
 public static void Populate(BLibraryPro.BookInventory BookInventory, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_BOOK_INVENTORY.BOOK_SN,
                     M_BOOK_INVENTORY.BOOK_LOT_NO,
                     M_BOOK_INVENTORY.BOOK_CODE,
                     M_BOOK_INVENTORY.ENTRY_DATE,
                     M_BOOK_INVENTORY.ENTERED_BY
                     FROM M_BOOK_INVENTORY
                     where BOOK_SN = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         BookInventory.BookSn = new_code;
         BookInventory.BookLotNo = Convert.ToInt32(odr["BOOK_LOT_NO"].ToString());
         BookInventory.BookCode = Convert.ToInt32(odr["BOOK_CODE"].ToString());
         BookInventory.EntryDate = Convert.ToDateTime(odr["ENTRY_DATE"].ToString());
         BookInventory.EntryBy = odr["ENTERED_BY"].ToString();
     }
 }
Esempio n. 11
0
 public static void Populate(BLibraryPro.Author Author, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_AUTHOR.AUTHOR_CODE,
                     M_AUTHOR.FNAME,
                     M_AUTHOR.MNANE,
                     M_AUTHOR.LNAME,
                     M_AUTHOR.COUNTRY_CODE
                     FROM M_AUTHOR
                     where AUTHOR_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         Author.AuthorCode = new_code;
         Author.FirstName = odr["FNAME"].ToString();
         Author.MiddleName = odr["MNANE"].ToString();
         Author.LastName = odr["LNAME"].ToString();
         Author.CountryCode = odr["COUNTRY_CODE"].ToString();
     }
 }
Esempio n. 12
0
 public static void Populate(BLibraryPro.FinePolicy FinePolicy, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_LIB_FINE_POLICY.FINE_CODE,
                       M_LIB_FINE_POLICY.FINE_DESC,
                       M_LIB_FINE_POLICY.FROM_DAYS,
                       M_LIB_FINE_POLICY.TO_DAYS,
                       M_LIB_FINE_POLICY.FINE_PER_DAY,
                       M_LIB_FINE_POLICY.ACTIVE_FLAG,
                       M_LIB_FINE_POLICY.REASON_FOR_INACTIVE
                     FROM M_LIB_FINE_POLICY
                     where FINE_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         FinePolicy.FinePolicyCode = Convert.ToInt32(new_code);
         FinePolicy.FinePolicyDesc = odr["FINE_DESC"].ToString();
         FinePolicy.FromDays = Convert.ToInt32(odr["FROM_DAYS"]);
         FinePolicy.ToDays = Convert.ToInt32(odr["TO_DAYS"]);
         FinePolicy.FinePerDay = float.Parse(odr["FINE_PER_DAY"].ToString());
         FinePolicy.ActiveFlag = odr["ACTIVE_FLAG"].ToString();
         FinePolicy.Reason = odr["REASON_FOR_INACTIVE"].ToString();
     }
 }
Esempio n. 13
0
 public static void Populate(BLibraryPro.Book Book, string new_code)
 {
     DataAccess da = new DataAccess();
     string sql = @"SELECT M_BOOK.BOOK_CODE,
                     M_BOOK.BOOK_DESC,
                     M_BOOK.PUBLICATION_CODE,
                     M_BOOK.CATEGORY_CODE,
                     M_BOOK.ACTIVE_FLAG,
                     M_BOOK.REASON_FOR_INACTIVE
                     FROM M_BOOK
                     where BOOK_CODE = '" + new_code + "'";
     OracleDataReader odr = da.ExecuteReader(sql, CommandType.Text);
     if (odr.Read())
     {
         Book.BookCode = Convert.ToInt32(new_code);
         Book.BookDesc = odr["BOOK_DESC"].ToString();
         Book.PublicationCode = odr["PUBLICATION_CODE"].ToString();
         Book.CategoryCode = odr["CATEGORY_CODE"].ToString();
         Book.ActiveFlag = odr["ACTIVE_FLAG"].ToString();
         Book.ReasonForInactive = odr["REASON_FOR_INACTIVE"].ToString();
     }
 }