override protected int DeleteByID(int pID) { try { DAFeedBack DAFeedBack = new DAFeedBack(); DAFeedBack.USP_FeedBack_Delete(pID); return(1); } catch { return(0); } }
override protected int ExecUpdate() { // Update with ID = this.ID try { DAFeedBack DAFeedBack = CreateObjectFromPage(); DAFeedBack.fID = this.KeyID; DAFeedBack.USP_FeedBack_Update(); return(1); } catch { return(0); } }
private void LoadFeedBack() { DAFeedBack daFeedBack = new DAFeedBack(); DataTable dataTable = new DataTable(); dataTable.Load(daFeedBack.USP_FeedBack_GetAll_NotRead()); rptFeedBack.DataSource = dataTable; rptFeedBack.DataBind(); int Count = dataTable.Rows.Count; if (Count > 0) { fFeedBackNumber.InnerText = Count.ToString(); } daFeedBack.CloseAll(); }
private DAFeedBack CreateObjectFromPage() { // check DAFeedBack daFeedBack = new DAFeedBack(); // daFeedBack.fFeedBack = fFeedBack.Value.Trim(); daFeedBack.fContent = fContent.Value.Trim(); daFeedBack.fName = fName.Value.Trim(); daFeedBack.fAddress = fAddress.Value.Trim(); daFeedBack.fEmail = fEmail.Value.Trim(); daFeedBack.fPhone = fPhone.Value.Trim(); daFeedBack.fisRead = true;// fisRead.Checked; // return(daFeedBack); }
override protected Boolean LoadData() { try { LoadFeedBackReply(); // Load Data For Page. DAFeedBack daFeedBack = new DAFeedBack(); daFeedBack.USP_FeedBack_GetFullID(this.KeyID); // fFeedBack.Value = daFeedBack.fFeedBack.ToString(); fContent.Value = daFeedBack.fContent.ToString(); fName.Value = daFeedBack.fName.ToString(); fAddress.Value = daFeedBack.fAddress.ToString(); fEmail.Value = daFeedBack.fEmail.ToString(); fPhone.Value = daFeedBack.fPhone.ToString(); //fisRead.Checked = daFeedBack.fisRead; fSysDate.InnerText += daFeedBack.fSysDate.ToString(); if (daFeedBack.fisRead == false) { // Update FeedBack is readed ! daFeedBack.USP_FeedBack_Update_IsRead(daFeedBack.fID); } if (this.KeyID == 0) { div_btReply.Visible = false; div_box_reply.Visible = false; } else { div_btReply.Visible = true; div_box_reply.Visible = true; } } catch (Exception e) { ShowErrorMes("Lỗi hệ thống: " + e.ToString()); return(false); } return(true); }
override protected int ExecInsert() { try { DAFeedBack DAFeedBack = CreateObjectFromPage(); if (this.mode == ActParam.New) { DAFeedBack.fID = DAFeedBack.USP_GetKey(); this.KeyID = DAFeedBack.fID; // --> Update new SessionID for continue edit. } else { DAFeedBack.fID = 0; } DAFeedBack.USP_FeedBack_Insert(); return(1); } catch { return(0); } }