Ejemplo n.º 1
0
        private void initializeWishListDetails(int wishID)
        {
            DataTable ds = new DataTable();

            ds = wishRep.GetWishListID(wishID);
            CommonUIMethods.ClearControl(this);
            txtMembers.Text  = ds.Rows[0]["MemberID"].ToString();
            txtBookId.Text   = ds.Rows[0]["BookID"].ToString();
            txtBookName.Text = ds.Rows[0]["BookName"].ToString();
            if (ds.Rows[0]["AuthorName"].ToString() == "--Select--")
            {
                lstAuthor.SelectedIndex = 0;
            }
            else
            {
                lstAuthor.Text = ds.Rows[0]["AuthorName"].ToString();
            }
            chkBookGiven.Checked = bool.Parse(ds.Rows[0]["Status"].ToString());
            lblWishID.Text       = wishID.ToString();
            if (String.IsNullOrEmpty(ds.Rows[0]["GrantDate"].ToString()))
            {
                dateGrantBook.Text    = DateTime.Now.ToShortDateString();
                dateGrantBook.Checked = false;
            }
            else
            {
                dateGrantBook.Checked = true;
                dateGrantBook.Text    = ds.Rows[0]["GrantDate"].ToString();
            }
        }
Ejemplo n.º 2
0
        private void btnSeriesAdd_Click(object sender, EventArgs e)
        {
            String strSeries = lstSeries.Text;
            Series objSeries = new Series();
            Utils.CommonMethods cmMethod = new CommonMethods();
            if (bookRep.GetSeriesDetails(strSeries).Rows.Count > 0)
            {
                MessageBox.Show("Series already present");
                return;
            }

            objSeries.SeriesName = strSeries;
            bookRep.InsertSeries(objSeries);

            lstSeries.DataSource = cmMethod.InitializeList(bookRep.GetSeriesDetails());
            lstSeries.DisplayMember = "Seriesname";
            lstSeries.ValueMember = "SeriesId";            
            
            CommonUIMethods.setLstValue(lstSeries, strSeries);
            autoSeries.Clear();


            foreach (DataRowView dr in lstSeries.Items)
                autoSeries.Add(dr.Row[1].ToString());

            lstSeries.AutoCompleteSource = AutoCompleteSource.CustomSource;
            lstSeries.AutoCompleteCustomSource = autoSubCategory;
        }
Ejemplo n.º 3
0
        private void InitializeData(string bookID)
        {            
            if (gridBooks.RowCount > 0)
            {
                lstAuthor.SelectedIndex = 0;
                lstCategory.SelectedIndex = 0;
                lstSeries.SelectedIndex = 0;
                txtMembers.Text = "";
                //lstAlphas.SelectedIndex = 0;
                txtBookId.Text = bookID;
                tempBookid = txtBookId.Text;
                
                DataTable ds = new DataTable();
                ds = bookRep.GetBookIDDetails(tempBookid);
                txtBookName.Text = ds.Rows[0]["BookName"].ToString();
                if (transRep.GetTransLoanDetails(tempBookid).Rows.Count > 0)
                    lblBookLendTo.Text = "Book Loaned To:" + transRep.GetTransLoanDetails(tempBookid).Rows[0]["MemberID"].ToString();
                else
                    lblBookLendTo.Text = "";
                CommonUIMethods.setLstValue(lstAuthor, ds.Rows[0]["Authorname"].ToString());
                txtBookPrice.Text = ds.Rows[0]["BookPrice"].ToString();
                txtOrgprice.Text = ds.Rows[0]["OrgPrice"].ToString();
                CommonUIMethods.setLstValue(lstCategory, ds.Rows[0]["CategoryName"].ToString());
                CommonUIMethods.setLstValue(lstSubcat, ds.Rows[0]["Name"].ToString());
                CommonUIMethods.setLstValue(lstSeries, ds.Rows[0]["SeriesName"].ToString());               
                
                autoAuthors.Clear();
                autoSubCategory.Clear();
                autoSeries.Clear();
                foreach (DataRowView dr in lstAuthor.Items)
                    autoAuthors.Add(dr.Row[1].ToString());

                foreach (DataRowView dr in lstSubcat.Items)
                    autoSubCategory.Add(dr.Row[1].ToString());

                foreach (DataRowView dr in lstSeries.Items)
                    autoSeries.Add(dr.Row[1].ToString());
                lstAuthor.AutoCompleteSource = AutoCompleteSource.CustomSource;
                lstAuthor.AutoCompleteCustomSource = autoAuthors;
                lstSubcat.AutoCompleteSource = AutoCompleteSource.CustomSource;
                lstSubcat.AutoCompleteCustomSource = autoSubCategory;
                lstSeries.AutoCompleteSource = AutoCompleteSource.CustomSource;
                lstSeries.AutoCompleteCustomSource = autoSeries;                
            }
        }
Ejemplo n.º 4
0
 public void initializeTransData(int transID)
 {
     if (gridTrans.Rows.Count > 0)
     {
         DataTable ds = new DataTable();
         btnMemWish.Enabled = false;
         if (transID == 0)
         {
             ds = CommonUIMethods.ConvertGridToTable(gridTrans);
         }
         else
         {
             ds = transRep.GetTransIDDetails(transID);
         }
         lblMemberNotes.Text = memRep.GetMemberNotes(ds.Rows[0]["MemberID"].ToString()).Rows[0]["Notes"].ToString();
         lblAlreadyRead.Text = "";
         txtTransBookid.Text = ds.Rows[0]["BookID"].ToString();
         txtTransMemId.Text  = ds.Rows[0]["MemberID"].ToString();
         setTransMemName();
         lblTransId.Text    = ds.Rows[0]["TransID"].ToString();
         dateTransLoan.Text = ds.Rows[0]["LendDate"].ToString();
         dateTransDue.Text  = ds.Rows[0]["DueDate"].ToString();
         if (String.Compare(DateTime.MinValue.ToString(), ds.Rows[0]["ReturnDate"].ToString()) == 0)
         {
             dateTransReturn.Text = "";
         }
         else
         {
             dateTransReturn.Text = ds.Rows[0]["ReturnDate"].ToString();
         }
         txtTransLendRate.Text = ds.Rows[0]["LendRate"].ToString();
         txtTransFine.Text     = ds.Rows[0]["Fine"].ToString();
         txtLibBal.Text        = ds.Rows[0]["LibBal"].ToString();
         txtMemBal.Text        = ds.Rows[0]["MemBal"].ToString();
         txtRenewal.Text       = ds.Rows[0]["RenewalDays"].ToString();
         CommonUIMethods.setBookLabel(lblBookLabel, txtTransBookid.Text);
         if (wishRep.SearchWishList(txtTransMemId.Text).Rows.Count > 0)
         {
             btnMemWish.Enabled = true;
         }
     }
 }
Ejemplo n.º 5
0
 private void leaveBookID(object sender, EventArgs e)
 {
     CommonUIMethods.setBookLabel(lblBookLabel, txtTransBookid.Text);
     CommonUIMethods.setLendRate(txtTransLendRate, txtTransBookid.Text);
 }
Ejemplo n.º 6
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     CommonUIMethods.ClearControl(this);
 }