예제 #1
0
 private static void GenerateBecosoftLinkCustomersProperty()
 {
     Models.Core.Property property = new Models.Core.Property();
     property.Key   = "Becosoft:CustomerLinkActive";
     property.Value = "0";
     Crud.Put(property);
 }
예제 #2
0
 private void SetProperty(string key, string value)
 {
     Models.Core.Property property = new Models.Core.Property();
     property.Key   = key;
     property.Value = value;
     Crud.Put(property);
 }
예제 #3
0
 public override void Save()
 {
     try
     {
         var defaultAddress = new Models.Core.Property()
         {
             Key   = "MailSetting_DefaultFromAddress",
             Value = txtDefaultAddress.Text
         };
         FamiHub.Crud.Put(defaultAddress);
         var host = new Models.Core.Property()
         {
             Key   = "MailSetting_Host",
             Value = txtHost.Text
         };
         FamiHub.Crud.Put(host);
         var port = new Models.Core.Property()
         {
             Key   = "MailSetting_Port",
             Value = txtPort.Text
         };
         FamiHub.Crud.Put(port);
         var username = new Models.Core.Property()
         {
             Key   = "MailSetting_Username",
             Value = txtUsername.Text
         };
         FamiHub.Crud.Put(username);
         var password = new Models.Core.Property()
         {
             Key   = "MailSetting_Password",
             Value = txtPassword.Text
         };
         FamiHub.Crud.Put(password);
     }
     catch (Exception x)
     {
         throw new Exception(x.Message);
     }
     MessageBox.Show("Successfully Saved!");
 }
예제 #4
0
        public static void UpdateDb()
        {
            try
            {
                Models.Core.Property pV = Crud.GetById <Models.Core.Property, string>("pgmInstalledVersion");
                if (pV == null)
                {
                    pV       = new Models.Core.Property();
                    pV.Key   = "pgmInstalledVersion";
                    pV.Value = "";
                }

                if (pV.Value != Assembly.GetExecutingAssembly().GetName().Version.ToString() || System.Diagnostics.Debugger.IsAttached)
                {
                    InstallProgramDefinition();
                    pV.Value = Assembly.GetExecutingAssembly().GetName().Version.ToString();
                    Crud.Put(pV);
                }

                Models.Core.Property dbV = Crud.GetById <Models.Core.Property, string>("dbInstalledDataVersion");
                if (dbV == null)
                {
                    dbV       = new Models.Core.Property();
                    dbV.Key   = "dbInstalledDataVersion";
                    dbV.Value = "-1";
                }

                if (Convert.ToInt16(dbV.Value) < currentDbV)
                {
                    dbV.Value = (Convert.ToInt16(dbV.Value) + 1).ToString();
                    UpdateProcessor(dbV.Value);
                    Crud.Put(dbV);
                    UpdateDb();
                }
            }
            catch (Exception ex)
            {
                Common.ExceptionHandling.HandleException(ex);
            }
        }