public static FG_Root GetCSharpFormGlobals_NEW(EbWebForm _this, WebformData _formdata, WebformData _formdataBkUp, IDatabase DataDB, DbConnection DbCon, bool isSrcForm) { FG_User fG_User = new FG_User(_this.UserObj.UserId, _this.UserObj.FullName, _this.UserObj.Email, _this.UserObj.Roles); FG_System fG_System = new FG_System(); FG_DataDB fG_DataDB = null; if (DataDB != null) { DelegateTest OutDelObj = new DelegateTest(DataDB, DbCon); fG_DataDB = new FG_DataDB(OutDelObj.ExecuteScalar); } WebformData _formdataEmpty = _this.GetEmptyModel(); if (_formdata == null) { _formdata = _formdataEmpty; } else { _formdata.DGsRowDataModel = _formdataEmpty.DGsRowDataModel; } FG_Locations fG_Locations = Get_FG_Locations(_this.SolutionObj.Locations); int createdBy = _this.TableRowId <= 0 ? _this.UserObj.UserId : _formdata.CreatedBy; string createdAt = _this.TableRowId <= 0 ? DateTime.UtcNow.ConvertFromUtc(_this.UserObj.Preference.TimeZone).ToString(FormConstants.yyyyMMdd_HHmmss, CultureInfo.InvariantCulture) : _formdata.CreatedAt; FG_WebForm fG_WebForm = new FG_WebForm(_this.TableName, _this.TableRowId, _this.LocationId, _this.RefId, createdBy, createdAt); GetCSharpFormGlobalsRec_NEW(fG_WebForm, _this, _formdata, _formdataBkUp); return(new FG_Root(fG_WebForm, fG_User, fG_System, isSrcForm, fG_DataDB, fG_Locations)); }
private static FG_Locations Get_FG_Locations(Dictionary <int, EbLocation> ebLocs) { FG_Locations fG_Locations = new FG_Locations(); foreach (KeyValuePair <int, EbLocation> locEnrty in ebLocs) { EbLocation l = locEnrty.Value; fG_Locations.Add(new FG_Location() { LocId = l.LocId, IsGroup = l.IsGroup, Logo = l.Logo, LongName = l.LongName, Meta = l.Meta, ParentId = l.ParentId, ShortName = l.ShortName, TypeId = l.TypeId, TypeName = l.TypeName, WeekHoliday1 = l.WeekHoliday1, WeekHoliday2 = l.WeekHoliday2 }); } return(fG_Locations); }