public Return(DtoCard dtoCard, DtoBook dtoBook, DtoIssue dtoIssue) { InitializeComponent(); this.dtoCard = dtoCard; this.dtoBook = dtoBook; this.dtoIssue = dtoIssue; }
private void DgwReaderInfo_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgwReaderInfo.Rows.Count.Equals(0)) { return; } // reader string readerID = dgwReaderInfo.CurrentRow.Cells["ReaderID"].Value.ToString(); dtoReader = bllReader.GetByID(readerID); txtReaderID.Text = dtoReader.ReaderID; txtDateOfBirth.Text = dtoReader.DateOfBirth.ToString("dd/MM/yyyy"); txtAddress.Text = dtoReader.Address; txtEnable.Text = StringHelper.ActionStatus.GetByKey(dtoReader.Status).Display; txtReaderName.Text = dtoReader.ReaderName; txtGender.Text = StringHelper.Gender.GetByKey(dtoReader.Gender).Display; txtPhone.Text = dtoReader.Phone; // card string cardID = dgwReaderInfo.CurrentRow.Cells["CardID"].Value.ToString(); dtoCard = bllCard.GetByID(cardID); txtCardID.Text = dtoCard.CardID; txtIssueDate.Text = dtoCard.IssueDate.ToString("dd/MM/yyyy"); txtExpiration.Text = dtoCard.Expiration.ToString("dd/MM/yyyy"); txtNotes.Text = dtoCard.Notes; // btnUpdateReader.Enabled = true; LoadImage(); }
public bool Add(DtoCard dtoCard) { using (SqlConnection sqlConnection = data.GetConnect()) { try { sqlConnection.Open(); string sql = @"INSERT INTO CARD VALUES(@CardID, @IssueDate, @Expiration, @Notes)"; SqlCommand cmd = new SqlCommand(sql, sqlConnection); cmd.Parameters.Add("@CardID", SqlDbType.NChar).Value = dtoCard.CardID; cmd.Parameters.Add("@IssueDate", SqlDbType.Date).Value = dtoCard.IssueDate; cmd.Parameters.Add("@Expiration", SqlDbType.Date).Value = dtoCard.Expiration; cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value = dtoCard.Notes; cmd.ExecuteNonQuery(); } catch { return(false); } } return(true); }
public bool Update(DtoCard dtoCard) { using (SqlConnection sqlConnection = data.GetConnect()) { try { sqlConnection.Open(); string sql = @"UPDATE CARD SET IssueDate = @IssueDate, Expiration = @Expiration, Notes = @Notes WHERE CardID = @CardID"; SqlCommand cmd = new SqlCommand(sql, sqlConnection); cmd.Parameters.Add("@CardID", SqlDbType.NChar).Value = dtoCard.CardID; cmd.Parameters.Add("@IssueDate", SqlDbType.Date).Value = dtoCard.IssueDate; cmd.Parameters.Add("@Expiration", SqlDbType.Date).Value = dtoCard.Expiration; cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value = dtoCard.Notes; cmd.ExecuteNonQuery(); } catch { return(false); } } return(true); }
private void DgwReaderList_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgwReaderList.Rows.Count.Equals(0)) { return; } //reader string ReaderID = dgwReaderList.CurrentRow.Cells["ReaderID"].Value.ToString(); dtoReader = bllReader.GetByID(ReaderID); txtReaderName.Text = dtoReader.ReaderName; txtGender.Text = StringHelper.Gender.GetByKey(dtoReader.Gender).Display; txtPhone.Text = dtoReader.Phone; //card string CardID = dgwReaderList.CurrentRow.Cells["CardID"].Value.ToString(); dtoCard = bllCard.GetByID(CardID); txtCardID.Text = dtoCard.CardID; txtCardIssueDate.Text = dtoCard.IssueDate.ToString("dd / MM / yyyy"); txtCardExpiration.Text = dtoCard.Expiration.ToString("dd / MM / yyyy"); txtCardNotes.Text = dtoCard.Notes; // LoadDGWIssueBook(); LoadDGWHistoryReturn(); txtNoBookIssue.Text = dgwIssueBook.Rows.Count.ToString(); // btnLending.Enabled = true; foreach (TextBox textBox in gboIssueInfo.Controls.OfType <TextBox>()) { textBox.ResetText(); } btnLost.Enabled = false; btnReturn.Enabled = false; btnReturnDetails.Enabled = false; GetImage(); }
public Update(DtoReader dtoReader, DtoCard dtoCard) { InitializeComponent(); this.dtoReader = dtoReader; this.dtoCard = dtoCard; }
public bool Update(DtoCard dtoCard) { return(dalCard.Update(dtoCard)); }
public bool Add(DtoCard dtoCard) { return(dalCard.Add(dtoCard)); }
public Lending(DtoCard dtoCard) { InitializeComponent(); this.dtoCard = dtoCard; }
public ReturnDetails(DtoCard dtoCard, DtoReturn dtoReturn) { InitializeComponent(); this.dtoCard = dtoCard; this.dtoReturn = dtoReturn; }