public List <EventsTemplate> GetEvenData() { EventsTemplate temp; if (!isOpen) { Open_Datebase(); } List <EventsTemplate> Events = new List <EventsTemplate> { }; sqlstatment = Connection.CreateCommand(); sqlstatment.CommandText = "SELECT * FROM `events` "; MySqlDataReader reder = sqlstatment.ExecuteReader(); while (reder.Read()) { temp = new EventsTemplate { Senor = (int)reder["Sensor_id"], Module = (int)reder["Module_id"], Machine = reder["Machine"].ToString(), State = (string)reder["State"], Date = (DateTime)reder["Date"] }; Events.Add(temp); } Close_Datebase(); return(Events); }
public Object Deletetemplatedata(EventsTemplate TempObj) { try { return(VSWebDAL.ConfiguratorDAL.AlertsDAL.Ins.Deletetemplatedata(TempObj)); } catch (Exception) { throw; } }
private void CreateApiIndexFiles() { foreach (var solution in StepInput.SDProject.Solutions.Values) { var sdRepository = solution.Repositories.SingleOrDefault(r => r.TargetFx.Identifier == StepInput.CurrentTargetFx.Identifier); if (sdRepository != null) { foreach (var sdNamespace in sdRepository.GetAllNamespaces()) { ExecuteOnStepMessage(string.Format("{0}: {1}", StepInput.ChmStrings.CreateIndexFilesFor, sdNamespace.Fullname)); var namespaceHtmlFile = Path.Combine(StepInput.TmpPath, sdNamespace.Guid + ".html"); var template = new NamespaceTemplate { SDNamespace = sdNamespace }; File.WriteAllText(namespaceHtmlFile, template.TransformText()); foreach (var sdType in sdNamespace.Types) { var fieldsIndexHtmlFile = Path.Combine(StepInput.TmpPath, sdType.Guid + "-Fields.html"); var fieldsTemplate = new FieldsTemplate { SDType = sdType }; File.WriteAllText(fieldsIndexHtmlFile, fieldsTemplate.TransformText()); var eveIndexHtmlFile = Path.Combine(StepInput.TmpPath, sdType.Guid + "-Events.html"); var eventsTemplate = new EventsTemplate { SDType = sdType }; File.WriteAllText(eveIndexHtmlFile, eventsTemplate.TransformText()); var propertiesIndexHtmlFile = Path.Combine(StepInput.TmpPath, sdType.Guid + "-Properties.html"); var propertiesTemplate = new PropertiesTemplate { SDType = sdType }; File.WriteAllText(propertiesIndexHtmlFile, propertiesTemplate.TransformText()); var constructorsIndexHtmlFile = Path.Combine(StepInput.TmpPath, sdType.Guid + "-Constructors.html"); var constructorsTemplate = new ConstructorsTemplate { SDType = sdType }; File.WriteAllText(constructorsIndexHtmlFile, constructorsTemplate.TransformText()); var methodsIndexHtmlFile = Path.Combine(StepInput.TmpPath, sdType.Guid + "-Methods.html"); var methodsTemplate = new MethodsTemplate { SDType = sdType }; File.WriteAllText(methodsIndexHtmlFile, methodsTemplate.TransformText()); } } } } }
protected void btn_OkClick(object sender, EventArgs e) { EventsTemplate tempobj = new EventsTemplate(); tempobj.ID = Eventid; VSWebBL.ConfiguratorBL.AlertsBL.Ins.Deletetemplatedata(tempobj); FillAlertEventTEmplategrid(); Site1 currMaster = (Site1)this.Master; currMaster.refreshStatusBoxes(); }
protected void AlertEventTEmplategrid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { DataTable Htable = Session["Eventtemplate"] as DataTable; DataRow[] dr = Htable.Select("ID=" + Convert.ToInt32(e.Keys[0])); foreach (DataRow r in dr) { r.Delete(); r.AcceptChanges(); } //7/3/2013 NS added detailes deletion EventsTemplate tempobj = new EventsTemplate(); tempobj.ID = Convert.ToInt32(e.Keys[0]); //VSWebBL.ConfiguratorBL.AlertsBL.Ins.DeleteHoursData(Alertobj); VSWebBL.ConfiguratorBL.AlertsBL.Ins.Deletetemplatedata(tempobj); Session["Eventtemplate"] = Htable; ASPxGridView gridview = (ASPxGridView)sender; gridview.CancelEdit(); e.Cancel = true; FillAlertEventTEmplategrid(); //fillTemplateGridfromSession(); }