protected void Page_Load(object sender, EventArgs e) { //Add ddl tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(); tblServicePicCollection detPicTbl = new tblServicePicCollection(); if (!IsPostBack) { for (int i = 0; i < GroupTbl.Count; i++) { ddlNewsGroup.Items.Add(new ListItem(GroupTbl[i].ServiceGroupTitle, GroupTbl[i].id.ToString())); } } //place data string detString = string.Empty; tblServicesCollection detTbl = new tblServicesCollection(); detTbl.ReadList(); string addRow = "<div class='row'>"; int countSteps = 0; for (int i = 0; i < detTbl.Count; i++) { GroupTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, detTbl[i].idServiceGroup)); detPicTbl.ReadList(Criteria.NewCriteria(tblServicePic.Columns.idService, CriteriaOperators.Equal, detTbl[i].id)); if (countSteps == 0) { detString += addRow; } detString += "<div class='col-md-6 graph-2'>" + "<h3 class='inner-tittle'>Service " + (i + 1) + " </h3>" + "<div class='panel panel-primary two'>" + "<div class='panel-heading'>" + detTbl[i].ServiceTitle + "(" + GroupTbl[0].ServiceGroupTitle + ")" + "</div><div class='panel-body ont two'>"; if (detPicTbl.Count > 0) { detString += "<div><img src='../images/service/" + detPicTbl[0].picName + "' alt='" + detPicTbl[0].picName + "' style='width: 100%;' /></div>"; } detString += "<p>" + detTbl[i].ServiceDetail + "</p></div>" + "<div class='panel-footer'><a href='service-details.aspx?item=" + detTbl[i].id + "'>edit</a></div></div></div>"; countSteps++; if (countSteps == 2) { countSteps = 0; detString += "</div>"; } } infHtml.InnerHtml = detString; }
protected void btnUpdate_Click(object sender, EventArgs e) { int idElement = 0; if (Request.Cookies["idElement"] != null) { idElement = Int32.Parse(Request.Cookies["idElement"].Value); } tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, idElement)); if (txtTitleUpdate.Text.Trim().Length > 0) { GroupTbl[0].ServiceGroupTitle = txtTitleUpdate.Text; } else { lblError.Visible = true; } GroupTbl[0].ServiceGroupDetail = txtDetailUpdate.Text; if (lblError.Visible == false) { GroupTbl[0].Update(); Response.Redirect("services-group.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { //kill cookies if (!IsPostBack) { ScriptManager.RegisterStartupScript(this, GetType(), "myfunction", "killCookie();", true); } string itemsString = string.Empty; string popupPageString = string.Empty; tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(); for (int i = 0; i < GroupTbl.Count; i++) { //item to be shown itemsString += "<div class='popup panel-footer'>" + (i + 1) + "- <a id=\"" + GroupTbl[i].id + "\" href=\"javascript:__doPostBack('ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$LinkButton" + GroupTbl[i].id + "','')\" Class='clickable'>" + GroupTbl[i].ServiceGroupTitle + "</a><br />" + "</div"; } itemsHtml.InnerHtml = itemsString; }
protected void Page_Load(object sender, EventArgs e) { string serviceStr = string.Empty; tblServiceGroupCollection serviceGrpTbl = new tblServiceGroupCollection(); tblServicePicCollection servicePicTbl = new tblServicePicCollection(); tblServicesCollection serviceTbl = new tblServicesCollection(); int itemGet = 0; if (Request.QueryString["itemId"] != null) { itemGet = int.Parse(Request.QueryString["itemId"]); serviceTbl.ReadList(Criteria.NewCriteria(tblServices.Columns.idServiceGroup, CriteriaOperators.Equal, itemGet)); } else { serviceTbl.ReadList(); } for (int i = 0; i < serviceTbl.Count; i++) { serviceGrpTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, serviceTbl[i].idServiceGroup)); servicePicTbl.ReadList(Criteria.NewCriteria(tblServicePic.Columns.idService, CriteriaOperators.Equal, serviceTbl[i].id)); serviceStr += "<div class='col-md-4 col-sm-6 col-xs-12'>" + "<div class='grid1'><span>" + serviceGrpTbl[0].ServiceGroupTitle + "</span>" + "<div class='price-tit text-center'>" + "<img src='images/service/" + servicePicTbl[0].picName + "' alt='bondelectric " + servicePicTbl[0].picName + "' class='service-image' />" + "<h2>" + serviceTbl[i].ServiceTitle + "</h2><p>" + serviceGrpTbl[0].ServiceGroupDetail + "</p></div>" + "<div class='para'><p>" + serviceTbl[i].ServiceDetail + "</p></div></div></div>"; } serviceStr += "<div class='clear'> </div>"; serviceHtml.InnerHtml = serviceStr; #region header top picture tblLogsCollection picTopTbl = new tblLogsCollection(); picTopTbl.ReadList(); if (picTopTbl.Count > 0) { headerPicHtml.Attributes["style"] = "background: url(" + picTopTbl[0].logDetail + ")no-repeat;background-size: cover;background-position: center;"; } #endregion }
protected void btnDel_Click(object sender, EventArgs e) { int idElement = 0; if (Request.Cookies["idElement"] != null) { idElement = Int32.Parse(Request.Cookies["idElement"].Value); } tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, idElement)); GroupTbl[0].Delete(); Response.Redirect("services-group.aspx"); }
protected void Page_Load(object sender, EventArgs e) { int itemGet = 0; if (Request.QueryString["itemNo"] != null) { itemGet = int.Parse(Request.QueryString["itemNo"]); } else { Response.Redirect("default.aspx"); } string servicesString = string.Empty; tblServicesCollection servicesTbl = new tblServicesCollection(); servicesTbl.ReadList(Criteria.NewCriteria(tblServices.Columns.idServiceGroup, CriteriaOperators.Equal, itemGet)); tblServiceGroupCollection serviceGrpTbl = new tblServiceGroupCollection(); serviceGrpTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, itemGet)); tblServicePicCollection servicePicTbl = new tblServicePicCollection(); for (int i = 0; i < servicesTbl.Count; i++) { servicePicTbl.ReadList(Criteria.NewCriteria(tblServicePic.Columns.idService, CriteriaOperators.Equal, servicesTbl[i].id)); servicesString += "<div class='col-md-3'><div class='message-box'>" + "<h4>" + serviceGrpTbl[0].ServiceGroupTitle + "</h4>" + "<img src='images/service/" + servicePicTbl[0].picName + "' alt='bondelectric " + servicePicTbl[0].picName + "' />" + "<h2>" + servicesTbl[i].ServiceTitle + "</h2>" + "<p>" + servicesTbl[i].ServiceDetail + "</p></div></div>"; } servicesHtml.InnerHtml = servicesString; #region header top picture tblLogsCollection picTopTbl = new tblLogsCollection(); picTopTbl.ReadList(); //if (picTopTbl.Count > 0) //headerPicHtml.Attributes["style"] = "background: url(" + picTopTbl[0].logDetail + ")no-repeat;background-size: cover;background-position: center;"; #endregion }
protected void lbUpdate_Click(object sender, EventArgs e) { int idElement = 0; if (Request.Cookies["idElement"] != null) { idElement = Int32.Parse(Request.Cookies["idElement"].Value); } tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(Criteria.NewCriteria(tblServiceGroup.Columns.id, CriteriaOperators.Equal, idElement)); lblTitle.Text = GroupTbl[0].ServiceGroupTitle; txtTitleUpdate.Text = GroupTbl[0].ServiceGroupTitle; txtDetailUpdate.Text = GroupTbl[0].ServiceGroupDetail; ScriptManager.RegisterStartupScript(this, GetType(), "myfunction", "open();", true); }
protected void Page_Load(object sender, EventArgs e) { int itemGet = 0; if (Request.QueryString["item"] != null) { itemGet = int.Parse(Request.QueryString["item"]); } else { Response.Redirect("services-add.aspx"); } //fill data tblServicesCollection DetailsTbl = new tblServicesCollection(); DetailsTbl.ReadList(Criteria.NewCriteria(tblServices.Columns.id, CriteriaOperators.Equal, itemGet)); tblServicePicCollection DetailsPicTbl = new tblServicePicCollection(); DetailsPicTbl.ReadList(Criteria.NewCriteria(tblServicePic.Columns.idService, CriteriaOperators.Equal, itemGet)); if (DetailsPicTbl.Count > 0) { setPicHtml.InnerHtml = "<img src='../images/service/" + DetailsPicTbl[0].picName + "' class='img-responsive' draggable='false'>"; } //----- Add writer of review ------- //string writerStr = string.Empty; //tblStaffCollection NewsCreatorTbl = new tblStaffCollection(); //NewsCreatorTbl.ReadList(Criteria.NewCriteria(tblStaff.Columns.id, CriteriaOperators.Equal, DetailsTbl[0].infWriter)); //if (NewsCreatorTbl.Count > 0) // writerStr = NewsCreatorTbl[0].StaffName + " " + NewsCreatorTbl[0].StaffFamily; string addDataString = string.Empty; addDataString += "<h3>" + DetailsTbl[0].ServiceTitle + "</h3><br>" + //"<span class='code'>Writer: <a>" + writerStr + "</a></span>" + "<p>Information Details: " + DetailsTbl[0].ServiceDetail + "</p>" + "<div class='price'>" + "<span class='text'></span>"; addDataString += "<span class='price-new'></span>"; addDataString += "<span class='price-tax'><label class='checkbox'></label></span><br>"; //addDataString += "<span class='points'><small>Insert Date: " + DetailsTbl[0].infDetailInsertDate + "</small></span><br>"; addDataString += "</div>"; addDetailHtml.InnerHtml = addDataString; //fill data in change part //Groups tblServiceGroupCollection GroupTbl = new tblServiceGroupCollection(); GroupTbl.ReadList(); //Select old items if (!IsPostBack) { if (DetailsTbl[0].ServiceTitle.Length > 0) { txtTitle.Text = DetailsTbl[0].ServiceTitle; } if (DetailsTbl[0].ServiceDetail.Length > 0) { string str = ckDetails.Text; ckDetails.Text = Server.HtmlDecode(str); } for (int i = 0; i < GroupTbl.Count; i++) { ddlNewsGroup.Items.Add(new ListItem(GroupTbl[i].ServiceGroupTitle, GroupTbl[i].id.ToString())); } ddlNewsGroup.SelectedValue = DetailsTbl[0].idServiceGroup.ToString(); } }