public OtherContentDetailPage() { this._constantCollection = new ConstantCollection(); this._otherContentRT = new OtherContentRT(); this._pictureRT = new PictureRT(); this._visitorIPMACAddress = new VisitorIPMACAddress(); }
protected void btnSave_Click(object sender, EventArgs e) { try { labelMessageOtherContent.Text = string.Empty; using (OtherContentRT receiverTransfer = new OtherContentRT()) { hdSave.Value = "true"; OiiOOther Oiioother = CreateOtherContent(); receiverTransfer.AddOtherContent(Oiioother); if (Oiioother.IID > 0) { labelMessageOtherContent.Text = "Data successfully saved..."; labelMessageOtherContent.ForeColor = System.Drawing.Color.Green; } else { labelMessageOtherContent.Text = "Data not saved..."; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } } ClearField(); LoadotherContentListView(); hdSave.Value = null; } catch (Exception ex) { labelMessageOtherContent.Text = "Error : " + ex.Message; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } }
protected void lvContent_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == "EditContent") { try { labelMessageOtherContent.Text = string.Empty; btnSave.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = false; btnCancel.Visible = true; chkOtherContentActv.Visible = true; int OtherContentID = Convert.ToInt32(e.CommandArgument); hdContentID.Value = OtherContentID.ToString(); using (OtherContentRT receiverTransfer = new OtherContentRT()) { OiiOOther oIIoother = receiverTransfer.GetOtherContentByIID(OtherContentID); FillOtherContentForEdit(oIIoother); } } catch (Exception ex) { labelMessageOtherContent.Text = "Error : " + ex.Message; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { // labelMessage.Text = string.Empty; using (OtherContentRT receiverTransfer = new OtherContentRT()) { hdIsEdit.Value = "true"; OiiOOther oiiocontent = CreateOtherContent(); if (oiiocontent != null) { receiverTransfer.Updateoiiocontent(oiiocontent); labelMessageOtherContent.Text = "Data successfully updated..."; labelMessageOtherContent.ForeColor = System.Drawing.Color.Green; } else { labelMessageOtherContent.Text = "Data not updated..."; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } } ClearField(); btnVisibilityForCancel(); LoadotherContentListView(); } catch (Exception ex) { labelMessageOtherContent.Text = "Error : " + ex.Message; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } }
private void LoadListViewForSearch() { try { int dynamicItemCount; int staticItemCount; if (Session["SearchWeb"] != null) { string search = Session["SearchWeb"].ToString(); using (OtherContentRT receiverTransfer = new OtherContentRT()) { lvSearch.DataSource = receiverTransfer.GetSearchResultForListView(search); lvSearch.DataBind(); dynamicItemCount = lvSearch.Items.Count; } lvStaticView.DataSource = AspxPageRead(search); lvStaticView.DataBind(); staticItemCount = lvStaticView.Items.Count; lblSearchCount.Text = (dynamicItemCount + staticItemCount) + " Search Result From OiiO HaaT"; } } catch (Exception ex) { lblSearchWholeweb.Text = "Error : " + ex.Message; lblSearchWholeweb.ForeColor = System.Drawing.Color.Red; // throw new Exception(ex.Message, ex); } }
private void LoadotherContentListView() { try { using (OtherContentRT receiverTransfer = new OtherContentRT()) { lvContent.DataSource = receiverTransfer.GetotherContentAllForListView();; lvContent.DataBind(); } } catch (Exception ex) { labelMessageOtherContent.Text = "Error : " + ex.Message; labelMessageOtherContent.ForeColor = System.Drawing.Color.Red; } }
// private string GetQueryStringDataForSearch() //{ // string categoryType = default(string); // try // { // if (!string.IsNullOrEmpty(Request.QueryString[0])) // { // bool reqIDIsValid = Int64.TryParse(Request.QueryString[0], out CatID); // if (!reqIDIsValid) // { // categoryType = Request.QueryString[0]; // } // } // else // { // Response.Redirect("~/Default.aspx"); // } // } // catch (Exception ex) // { // LogFileWritten(ex.Message, ex.StackTrace); // } // return categoryType; //} //private void LoadAllCountries() //{ // try // { // var result = _countryRT.GetCountryAll().Where(x => x.IsRemoved == false).ToList(); // rp_Country_Load.DataSource = result; // rp_Country_Load.DataBind(); // } // catch (Exception ex) // { // LogFileWritten(ex.Message, ex.StackTrace); // } //} private void LoadListViewOthersFromOiiO() { try { using (OtherContentRT receiverTransfer = new OtherContentRT()) { lvOthersFormOiiO.DataSource = receiverTransfer.GetotherActiveContentAllForListView();; lvOthersFormOiiO.DataBind(); } } catch (Exception ex) { //labelMessage.Text = "Error : " + ex.Message; //labelMessage.ForeColor = System.Drawing.Color.Red; throw new Exception(ex.Message, ex); } }