Exemple #1
0
        public void Upsert(string key, string serializedCredentials)
        {
            CheckKey(key);

            var userCreds = GetUserCredentialsByKey(key);

            if (!string.IsNullOrEmpty(userCreds))
            {
                SqlItemList where = new SqlItemList
                {
                    new SqlItem("userid", key),
                    new SqlItem("appuserid", appUserId)
                };
                SqlItemList items = new SqlItemList {
                    new SqlItem("credentials", serializedCredentials)
                };
                SetUpdateSql(SynnDataProvider.TableNames.GoogleTokens, items, where);
            }
            else
            {
                SqlItemList items = new SqlItemList();
                items.Add(new SqlItem("userid", key));
                items.Add(new SqlItem("appuserid", appUserId));
                items.Add(new SqlItem("credentials", serializedCredentials));
                SetInsertIntoSql(SynnDataProvider.TableNames.GoogleTokens, items);
            }
            ExecuteSql();
        }
Exemple #2
0
 public void FinishMethod(string stepName)
 {
     var sqlItems = new SqlItemList();
     sqlItems.Add(new SqlItem("Name", stepName));
     sqlItems.Add(new SqlItem("Date", DateTime.Now));
     SetInsertIntoSql(SynnDataProvider.TableNames.MigrationItems, sqlItems);
     ExecuteSql();
 }
Exemple #3
0
        public void AddToUsbList(MusicItem m)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("UserId", GlobalAppData.CurrentUser.Id));
            sqlItems.Add(new SqlItem("ItemId", m.Id));
            SetInsertIntoSql(xmConsts.UserUsbList, sqlItems);
            ExecuteSql();
        }
Exemple #4
0
        public void Save(ShiftDayData i)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", i.Date));
            sqlItems.Add(new SqlItem("DaylyShift", (int)i.DaylyShift));
            SetInsertIntoSql(SynnDataProvider.TableNames.ShiftsData, sqlItems);
            ExecuteSql();
        }
Exemple #5
0
        private SqlItemList Get(DevTaskItem u)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Description", u.Description));
            sqlItems.Add(new SqlItem("Name", u.Name));
            sqlItems.Add(new SqlItem("Status", u.Status));
            return(sqlItems);
        }
        public void Add(WeddingGuest g)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("GuestName", g.Name));
            sqlItems.Add(new SqlItem("Payment", g.Amount));
            SetInsertIntoSql(SynnDataProvider.TableNames.WeddingItems, sqlItems);
            ExecuteSql();
        }
Exemple #7
0
        private static SqlItemList Get(MoneyMonthlyData p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", p.Date));
            sqlItems.Add(new SqlItem("TotalSpent", p.TotalSpent));
            sqlItems.Add(new SqlItem("Active", p.Active));
            return(sqlItems);
        }
        public void FinishMethod(string stepName)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Name", stepName));
            sqlItems.Add(new SqlItem("Date", DateTime.Now));
            SetInsertIntoSql(TableName, sqlItems);
            ExecuteSql();
        }
Exemple #9
0
        public void Add(DictionarySearchParameters p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("dKey", p.Key));
            sqlItems.Add(new SqlItem("Value", p.Value));
            SetInsertIntoSql(SynnDataProvider.TableNames.UserDictionary, sqlItems);
            ExecuteSql();
        }
Exemple #10
0
        private static SqlItemList GetFrom(MonthlyMoneyTransaction p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Amount", p.Amount));
            sqlItems.Add(new SqlItem("Closed", p.Closed));
            sqlItems.Add(new SqlItem("Month", p.Month));
            sqlItems.Add(new SqlItem("TemplateId", p.TemplateId));
            return(sqlItems);
        }
Exemple #11
0
        public void Add(CashMoneyItem p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", p.Date));
            sqlItems.Add(new SqlItem("TotalSpent", p.TotalSpent));
            sqlItems.Add(new SqlItem("Description", p.Description));
            SetInsertIntoSql(SynnDataProvider.TableNames.CashItems, sqlItems);
            ExecuteSql();
        }
        private static SqlItemList Get(QuickTask p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Name", p.Name));
            sqlItems.Add(new SqlItem("Description", p.Description));
            sqlItems.Add(new SqlItem("CreationDate", p.CreationDate));
            sqlItems.Add(new SqlItem("Active", p.Active));
            return(sqlItems);
        }
Exemple #13
0
        public void AddLog(string message)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", DateTime.Now));
            sqlItems.Add(new SqlItem("Trace", string.Empty));
            sqlItems.Add(new SqlItem("Message", message));
            SetInsertIntoSql(SynnDataProvider.TableNames.Log, sqlItems);
            ExecuteSql();
        }
Exemple #14
0
        public void Add(string key, string value)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("UserId", SynnDataProvider.DbProvider.CurrentUser.Id));
            sqlItems.Add(new SqlItem("dKey", key));
            sqlItems.Add(new SqlItem("Value", value));
            SetInsertIntoSql(SynnDataProvider.TableNames.UserDictionary, sqlItems);
            ExecuteSql();
        }
Exemple #15
0
        public void Add(ThemeScript i)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("CssAttribute", i.CssAttribute));
            sqlItems.Add(new SqlItem("CssValue", i.CssValue));
            sqlItems.Add(new SqlItem("ElementIdentifier", i.ElementIdentifier));
            SetInsertIntoSql(SynnDataProvider.TableNames.ThemeItems, sqlItems);
            ExecuteSql();
        }
        public void AddNewShopItem(ref ShopItem n)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Name", n.Name));
            sqlItems.Add(new SqlItem("Active", true));
            SetInsertIntoSql(SynnDataProvider.TableNames.ShoppingItems, sqlItems);
            ExecuteSql();

            n.Id = GetLastIdentityValue();
        }
Exemple #17
0
        public string AddLog(Exception l)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", DateTime.Now));
            sqlItems.Add(new SqlItem("Trace", l.StackTrace));
            sqlItems.Add(new SqlItem("Message", l.Message));
            SetInsertIntoSql(SynnDataProvider.TableNames.Log, sqlItems);
            ExecuteSql();
            return(GetMsSqlLastIdentityValue().ToString());
        }
Exemple #18
0
        private static SqlItemList Get(LoggedUser u)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("UserName", u.UserName));
            sqlItems.Add(new SqlItem("Password", u.Password));
            sqlItems.Add(new SqlItem("DisplayName", u.DisplayName));
            sqlItems.Add(new SqlItem("EmailAdress", u.EmailAdress));
            sqlItems.Add(new SqlItem("AllowedClientPagePermissions", XmlHelper.ToXml(u.AllowedClientPagePermissions)));
            return(sqlItems);
        }
Exemple #19
0
        public void AddWorkMonthlyData(WorkHoursData w)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Month", w.Month));
            sqlItems.Add(new SqlItem("Active", w.Active));
            sqlItems.Add(new SqlItem("CurrentMonthTotal", w.CurrentMonthTotal.ToXml()));
            sqlItems.Add(new SqlItem("CurrentShiftStart", w.CurrentShiftStart.ToXml()));
            sqlItems.Add(new SqlItem("CurrentShiftEnd", w.CurrentShiftEnd.ToXml()));
            SetInsertIntoSql(SynnDataProvider.TableNames.WorkHoursData, sqlItems);
            ExecuteSql();
        }
Exemple #20
0
        public void AddThemeLog(ThemeLog l)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Date", DateTime.Now));
            sqlItems.Add(new SqlItem("DestinationPath", l.DestinationPath));
            sqlItems.Add(new SqlItem("NewText", l.NewText));
            sqlItems.Add(new SqlItem("PrevText", l.PrevText));
            sqlItems.Add(new SqlItem("XuiFile", (int)l.XiFile));
            SetInsertIntoSql(SynnDataProvider.TableNames.ThemeLog, sqlItems);
            ExecuteSql();
        }
Exemple #21
0
        private static SqlItemList Get(MusicItem m)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Artist", m.Artist));
            sqlItems.Add(new SqlItem("FileName", m.FileName));
            sqlItems.Add(new SqlItem("FullFileName", m.FullFileName));
            sqlItems.Add(new SqlItem("MachineName", m.MachineName));
            sqlItems.Add(new SqlItem("Title", m.Title));
            //sqlItems.Add(new SqlItem("ToUsb", m.ToUsb));
            //sqlItems.Add(new SqlItem("ToPlaylist", m.ToPlaylist));
            return(sqlItems);
        }
        public SqlItemList GetUpdateParams(ShopSearchParameters i)
        {
            SqlItemList sqlItems = new SqlItemList();

            if (i.Active.HasValue)
            {
                sqlItems.Add(new SqlItem("Active", i.Active.Value));
            }
            if (i.LastBought.HasValue)
            {
                sqlItems.Add(new SqlItem("LastBought", i.LastBought));
            }
            return(sqlItems);
        }
Exemple #23
0
        public void Update(ThemeScript i)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("CssAttribute", i.CssAttribute));
            sqlItems.Add(new SqlItem("CssValue", i.CssValue));
            sqlItems.Add(new SqlItem("ElementIdentifier", i.ElementIdentifier));
            SetUpdateSql(SynnDataProvider.TableNames.ThemeItems, sqlItems, new SqlItemList {
                new SqlItem {
                    FieldName = "Id", FieldValue = i.Id
                }
            });
            ExecuteSql();
        }
Exemple #24
0
        public void UpdateWorkMonthlyData(WorkHoursData w)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Month", w.Month));
            sqlItems.Add(new SqlItem("Active", w.Active));
            sqlItems.Add(new SqlItem("CurrentMonthTotal", w.CurrentMonthTotal.ToXml()));
            sqlItems.Add(new SqlItem("CurrentShiftStart", w.CurrentShiftStart.ToXml()));
            sqlItems.Add(new SqlItem("CurrentShiftEnd", w.CurrentShiftEnd.ToXml()));
            SetUpdateSql(SynnDataProvider.TableNames.WorkHoursData, sqlItems, new SqlItemList {
                new SqlItem {
                    FieldName = "Id", FieldValue = w.Id
                }
            });
            ExecuteSql();
        }
Exemple #25
0
        public void Add(PermissionGroup g)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Name", g.Name));
            SetInsertIntoSql(SynnDataProvider.TableNames.PermissionGroups, sqlItems);
            ExecuteSql();
        }
        private static SqlItemList Get(GenericData u)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Active", u.Active));
            sqlItems.Add(new SqlItem("CreationDate", u.CreationDate));
            sqlItems.Add(new SqlItem("Description", u.Description));
            sqlItems.Add(new SqlItem("UpdateDate", u.UpdateDate));

            var props = u.GetType().GetProperties();

            foreach (var pinfo in props)
            {
                var genericDataField = ((GenericDataFieldAttribute[])pinfo.GetCustomAttributes(typeof(GenericDataFieldAttribute), true)).FirstOrDefault();
                if (genericDataField != null)
                {
                    var val = pinfo.GetValue(u);
                    sqlItems.Add(new SqlItem(genericDataField.FieldName, val ?? string.Empty));
                }
            }

            return(sqlItems);
        }
Exemple #27
0
        private SqlItemList Get(MoneyTransactionTemplate p)
        {
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("Amount", p.Amount));
            sqlItems.Add(new SqlItem("Active", p.Active));
            sqlItems.Add(new SqlItem("Auto", p.Auto));
            sqlItems.Add(new SqlItem("FromDate", p.FromDate));
            sqlItems.Add(new SqlItem("ToDate", p.ToDate));
            sqlItems.Add(new SqlItem("Name", p.Name));
            sqlItems.Add(new SqlItem("TransactionType", p.TransactionType));
            return(sqlItems);
        }
        public void Add(MemoItem pInsertItem)
        {
            pInsertItem.CreationDate = DateTime.Now;
            var sqlItems = new SqlItemList();

            sqlItems.Add(new SqlItem("title", pInsertItem.title));
            sqlItems.Add(new SqlItem("description", pInsertItem.Description));
            sqlItems.Add(new SqlItem("CreationDate", pInsertItem.CreationDate));
            sqlItems.Add(new SqlItem("date", pInsertItem.Date));
            sqlItems.Add(new SqlItem("RepeatEvery", pInsertItem.RepeatEvery));
            sqlItems.Add(new SqlItem("Shared", pInsertItem.Shared));
            sqlItems.Add(new SqlItem("UserId", pInsertItem.UserId));
            SetInsertIntoSql(SynnDataProvider.TableNames.DiaryData, sqlItems);
            ExecuteSql();
        }