/// <summary> /// /// </summary> public void LoadReports() { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); DataTable dt = new DataTable(); dt = a.GetAppReport(this.ClientID, this.AppID); foreach (DataRow r in dt.Rows) { } }
public void LoadLookUp() { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); DataTable dt = new DataTable(); dt = a.GetAppLookups(this.ClientID, this.AppID); string s = string.Join(", ", dt.Rows.OfType <DataRow>().Select(r => r["ElementID"].ToString())); var lookups = Tz.Core.Lookup.GetLookUps(this.ClientID, s); foreach (Tz.Core.Lookup l in lookups) { var apLookup = new App.AppElement.AppLookup(this.ClientID, this.AppID); apLookup.Set(l); this.Lookups.Add(apLookup); } }
/// <summary> /// /// </summary> public void LoadForms() { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); DataTable dt = new DataTable(); dt = a.GetAppForm(this.ClientID, this.AppID); string s = string.Join(", ", dt.Rows.OfType <DataRow>().Select(r => r["ElementID"].ToString())); var uforms = Tz.UIForms.Form.GetForms(this.ClientID, s); foreach (UIForms.Form f in uforms) { var apForm = new App.AppElement.AppForm(this.ClientID, this.AppID); apForm.Set(f); this.Forms.Add(apForm); } }
/// <summary> /// /// </summary> /// <returns></returns> internal bool Assign() { try { Data.App.App aa = new Data.App.App(Common.GetConnection(this.ClientID)); if (aa.AssignElement(this.ClientID, this.AppID, (int)AppElementType.COMPONENT, ElementID)) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
private void Load() { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); var dt = new DataTable(); dt = a.GetApp(this.ClientID, this.AppID); foreach (DataRow dr in dt.Rows) { // am._appid = dr["AppID"] == null ? "" : (string)dr["AppID"]; this.AppName = dr["Name"] == null ? "" : (string)dr["Name"]; this.Description = dr["Description"] == null ? "" : (string)dr["Description"]; this.CreatedOn = DBNull.Value.Equals(dr["CreatedOn"]) == true ? DateTime.Now : (DateTime)dr["CreatedOn"]; this.Category = dr["Category"] == null ? "" : (string)dr["Category"]; this.TimeZone = DBNull.Value.Equals(dr["TimeZone"]) == true ? 0 : (Int32)dr["TimeZone"]; this.DateFormat = DBNull.Value.Equals(dr["DateFormat"]) == true ? 0 : (Int32)dr["DateFormat"]; this.TimeFormat = DBNull.Value.Equals(dr["TimeFormat"]) == true ? 0 : (Int32)dr["TimeFormat"]; } }
public bool RemoveComponent(string componentID) { if (this.Components.Count == 0) { GetComponents(); } var comp = this.GetComponent(componentID); Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); Core.ComponentManager mg = new ComponentManager(comp); if (mg.Remove()) { a.RemoveAppComponent(this.ClientID, this.AppID, componentID); return(true); } else { return(false); } }
/// <summary> /// /// </summary> public List <App.AppElement.AppComponent> GetComponents() { var acs = new List <App.AppElement.AppComponent>(); Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); DataTable dt, dtFields = new DataTable(); dt = a.GetAppComponent(this.ClientID, this.AppID); var dttable = dt.DefaultView.ToTable(true, "ComponentID", "ComponentName", "ComponentType", "Title", "TableID", "PrimaryKeys", "TitleFormat", "Category", "IsGlobal" ); foreach (DataRow dr in dttable.Rows) { string cid = dr.IsNull("ComponentID") ? "" : dr["ComponentID"].ToString(); var ac = new App.AppElement.AppComponent(this.ClientID, this.AppID, cid); var c = ac.Component; c.ClientID = this.ClientID; c.ComponentID = cid; c.ComponentName = dr.IsNull("ComponentName") ? "" : dr["ComponentName"].ToString(); c.ComponentType = dr.IsNull("ComponentType") ? Tz.Core.ComponentType.none : (Tz.Core.ComponentType)dr["ComponentType"]; c.Title = dr.IsNull("Title") ? "" : dr["Title"].ToString(); c.TableID = dr.IsNull("TableID") ? "" : dr["TableID"].ToString(); c.PrimaryKeys = dr.IsNull("PrimaryKeys") ? "" : dr["PrimaryKeys"].ToString(); c.TitleFormat = dr.IsNull("TitleFormat") ? "" : dr["TitleFormat"].ToString(); c.Category = dr.IsNull("Category") ? "" : dr["Category"].ToString(); c.IsGlobal = dr.IsNull("IsGlobal") ? false : Convert.ToBoolean(dr["IsGlobal"]); this.Components.Add(ac); acs.Add(ac); } return(acs); }
public static List <AppManager> GetAppManagers(string clientid) { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(clientid)); var dt = new DataTable(); dt = a.GetApps(clientid); var ams = new List <AppManager>(); foreach (DataRow dr in dt.Rows) { var am = new AppManager(clientid); am._appid = dr["AppID"] == null ? "" : (string)dr["AppID"]; am.AppName = dr["Name"] == null ? "" : (string)dr["Name"]; am.Description = dr["Description"] == null ? "" : (string)dr["Description"]; am.CreatedOn = DBNull.Value.Equals(dr["CreatedOn"]) == true ? DateTime.Now : (DateTime)dr["CreatedOn"]; am.Category = dr["Category"] == null ? "" : (string)dr["Category"]; am.TimeZone = DBNull.Value.Equals(dr["TimeZone"]) == true ? 0 : (Int32)dr["TimeZone"]; am.DateFormat = DBNull.Value.Equals(dr["DateFormat"]) == true ? 0 : (Int32)dr["DateFormat"]; am.TimeFormat = DBNull.Value.Equals(dr["TimeFormat"]) == true ? 0 : (Int32)dr["TimeFormat"]; ams.Add(am); } return(ams); }
/// <summary> /// /// </summary> /// <returns></returns> public bool Remove() { Tz.Data.App.App a = new Data.App.App(Common.GetConnection(this.ClientID)); return(a.Remove(this.ClientID, this.AppID)); }