private void goAddToOrder_Click(object sender, RoutedEventArgs e)
        {
            //If something is selected
            if (lv1.SelectedIndex > 0)
            {
                int x = 0;
                x = 1;

                //Add to Orders

                DataManager thisDataManager = new DataManager();

                //Changed CurrentlySelectedMenuItems to ObservableCollection and added 2 way binding, but it does not auto update
                thisDataManager.CurrentlySelectedMenuItems.Add(lv1.SelectedValue.ToString());

                //ListViewItem listViewItem = new ListViewItem();
                //lv2.Items.Add(listViewItem);
                //lv2.ItemsSource = "{Binding CurrentlySelectedMenuItems, Mode=TwoWay}";

                //setting the itemssource manually
                lv2.ItemsSource = thisDataManager.CurrentlySelectedMenuItems;

                x = 1;
            }
        }
    protected void savebtn_Click(object sender, EventArgs e)
    {
        if (template == null)
        {
            Guid TemplateId = new Guid(HttpContext.Current.Request.QueryString["TemplateId"]);
            Guid EventId = new Guid(HttpContext.Current.Request.QueryString["EventId"]);
            Guid ModuleId = new Guid(HttpContext.Current.Request.QueryString["ModuleId"]);
            manager = new DataManager();
            template = manager.GetTemplate(EventId, TemplateId, ModuleId);
        }
        template.Subject = this.txtSubject.Text;
        template.Sender = this.txtSender.Text;
        template.SenderAddress = this.txtSenderAdd.Text;
        template.Content = this.txtContent.Text;
        this.manager.SaveTemplate(template);

        string script = "function GetRadWindow()";
        script += "{";
        script += " var oWindow = null;";
        script += " if (window.radWindow) oWindow = window.radWindow;";
        script += " else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;";
        script += " return oWindow;";
        script += "}";

        script += "function OK_Clicked()";
        script += "{";
        script += " var oWindow = GetRadWindow();";
        script += " oWindow.Close(true);";
        script += "}";
        script += "OK_Clicked();";
        HttpContext.Current.Session.Add("EventId", new Guid(HttpContext.Current.Request.QueryString["EventId"]));
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "returnokscript", script, true);
    }
Beispiel #3
0
 public Service()
 {
     var filePath = ConfigurationManager.AppSettings["FolderPath"];
     var fileExtension = ConfigurationManager.AppSettings["FileExtension"];
     var dataManager = new DataManager(new Watcher(filePath, fileExtension));
     _workerThread = new Thread(dataManager.OnStart);
 }
Beispiel #4
0
  void Awake() {
    if (dm != null && dm != this) {
      Destroy(gameObject);
      return;
    }

    if (Application.platform == RuntimePlatform.IPhonePlayer) {
      Environment.SetEnvironmentVariable ("MONO_REFLECTION_SERIALIZER", "yes");
    }

    DontDestroyOnLoad(gameObject);
    dm = this;
    datapath = getInternalPath() + "/GameData.dat";
    Debug.Log("Datapath: " + datapath);

    bf = new BinaryFormatter();

    ints = new Dictionary<string, int>();
    floats = new Dictionary<string, float>();
    bools = new Dictionary<string, bool>();
    strings = new Dictionary<string, string>();
    dateTimes = new Dictionary<string, DateTime>();

    // Advertisement.Initialize("72081");
    // HeyzapAds.Start("d772c6e33d0e63212d4350fc7811d507", HeyzapAds.FLAG_NO_OPTIONS);

    initAppsFlyer();


    if (resetAll || !load()) reset();
    initializeAtGameStart();
  }
 public ExpeditePage()
 {
     this.InitializeComponent();
     DataManager thisDataManager = new DataManager();
     int x;
     x = 0;
 }
		public MainWindow()
		{
			InitializeComponent();

			// Set up user prefs for file locations
			_txtRegionFile.Text = DataStore.AppPrefs.RoiFilePath;
			_txtSubjectFile.Text = DataStore.AppPrefs.SubjectfilePath;
			_txtDataFolder.Text = DataStore.AppPrefs.DataFileDir;
			_txtOutputFolder.Text = DataStore.AppPrefs.OutputDir;

			// Set up last window location and size
			if (DataStore.AppPrefs.WindowLocation != null &&  DataStore.AppPrefs.WindowLocation.Width != 0.0d && DataStore.AppPrefs.WindowLocation.Height != 0.0d)
			{
				this.Left = DataStore.AppPrefs.WindowLocation.X;
				this.Top = DataStore.AppPrefs.WindowLocation.Y;
				this.Width = DataStore.AppPrefs.WindowLocation.Width;
				this.Height = DataStore.AppPrefs.WindowLocation.Height;
			}

			// Create and connect our modules to our data manager
			_dataManager = new DataManager();
            oComponents.SetDataManager(_dataManager);

			_viewModel = new MainWindowViewModel(_dataManager);
			this.DataContext = _viewModel;
		}
        // TODO: Remove or reimplement
        //[Test]
        public void Test_TwoWayReference_RemoveOnDelete()
        {
            Console.WriteLine ("");
            Console.WriteLine ("Preparing test...");
            Console.WriteLine ("");

            var data = new DataManager();
            data.Settings.IsVerbose = true;

            data.WriteSummary ();

            var invoiceItem = new ExampleInvoiceItem ();
            var invoice = new ExampleInvoice (invoiceItem);

            data.Save(invoice, true);

            data.WriteSummary ();

            Console.WriteLine ("");
            Console.WriteLine ("Executing test code...");
            Console.WriteLine ("");

            data.Delete(invoice);

            data.WriteSummary ();

            var newInvoice = data.Get<ExampleInvoice> (invoice.Id);

            Assert.AreEqual(0, newInvoice.Items.Length, "Linker failed to remove the link.");
        }
Beispiel #8
0
 public User GetUser(string Name)
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Users.SingleOrDefault(u => u.UserName == Name);
     }
 }
    public void Start()
    {
        dataManager = DataManager.instance;
        infiniteObjectManager = InfiniteObjectManager.instance;
        infiniteObjectManager.init();
        infiniteObjectHistory = InfiniteObjectHistory.instance;
        infiniteObjectHistory.init(infiniteObjectManager.getTotalObjectCount());
        sectionSelection = SectionSelection.instance;
        chaseController = ChaseController.instance;

        moveDirection = Vector3.forward;
        spawnDirection = Vector3.forward;
        turnPlatform = new PlatformObject[(int)ObjectLocation.Last];

        infiniteObjectManager.getObjectSizes(out platformSizes, out sceneSizes, out largestSceneLength);
        infiniteObjectManager.getObjectStartPositions(out platformStartPosition, out sceneStartPosition);

        stopObjectSpawns = false;
        spawnData = new ObjectSpawnData();
        spawnData.largestScene = largestSceneLength;
        spawnData.useWidthBuffer = true;
        spawnData.section = 0;
        spawnData.sectionTransition = false;

        noCollidableProbability.init();

        showStartupObjects(GameManager.instance.showTutorial);

        spawnObjectRun(true);
    }
Beispiel #10
0
 public aspnet_Users GetAspUser(string userName)
 {
     using (var manager = new DataManager())
     {
         return manager.Context.aspnet_Users.SingleOrDefault(u => u.UserName == userName);
     }
 }
Beispiel #11
0
 public User GetUser(int id)
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Users.SingleOrDefault(u => u.UserId == id);
     }
 }
Beispiel #12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            m_dataManager = DataManager.GetDataManager();

            m_connectionButton = FindViewById<Button>(Resource.Id.connectButton);
            m_login = FindViewById<EditText>(Resource.Id.loginField);
            m_password = FindViewById<EditText>(Resource.Id.passwordField);
            m_checkBox = FindViewById<CheckBox>(Resource.Id.rememberPass);

            // Store user data
            if (m_dataManager.RetreiveData<bool>("loginCheckBox") == true)
            {
                m_login.Text = m_dataManager.RetreiveData<string>("login");
                m_password.Text = m_dataManager.RetreiveData<string>("password");
                m_checkBox.Checked = m_dataManager.RetreiveData<bool>("loginCheckBox");
            }

            StartService(new Intent(this, typeof(NetworkService)));
            BindService(new Intent(this, typeof(NetworkService)), this, Bind.AutoCreate);

            m_connectionButton.Click += delegate {
                m_netwokService.SetLoginInfo(m_login.Text, m_password.Text);
                m_netwokService.LoginEvent += OnLogin;
                m_netwokService.Login();
            };
        }
Beispiel #13
0
 public List<User> GetAllUsers()
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Users.ToList();
     }
 }
Beispiel #14
0
 public List<InoSoft.TeamStudio.Core.Entities.Version> GetAllVersion()
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Versions.ToList();
     }
 }
Beispiel #15
0
 public InoSoft.TeamStudio.Core.Entities.Version GetVersion(string VersionNum)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Versions.SingleOrDefault(v => v.VersionNum == VersionNum);
     }
 }
Beispiel #16
0
        public MapNpc(string mapID, DataManager.Maps.MapNpc rawNpc)
            : base(rawNpc)
        {
            SpeedLimit = Enums.Speed.Running;

            Moves = new Players.RecruitMove[4];
            for (int i = 0; i < Moves.Length; i++) {
                Moves[i] = new Players.RecruitMove(RawNpc.Moves[i]);
            }

            //if (RawNpc.HeldItem == null) {
            //    HeldItem = null;
            //} else {
            //    HeldItem = new InventoryItem(RawNpc.HeldItem);
            //}
            heldItem = new InventoryItem(RawNpc.HeldItem);

            VolatileStatus = new ExtraStatusCollection();
            for (int i = 0; i < RawNpc.VolatileStatus.Count; i++) {
                VolatileStatus.Add(new ExtraStatus(RawNpc.VolatileStatus[i]));
            }
            MapID = mapID;
            ActiveItems = new List<int>();

            //CalculateOriginalSprite();
            //CalculateOriginalStats();
            //CalculateOriginalType();
            //CalculateOriginalAbility();
            //CalculateOriginalMobility();
            if (Num > 0) {
                LoadActiveItemList();
            }
        }
    private void Start()
    {
        if(!Startup.dataInitialized)
        {
            directorData = Resources.Load ("DirectorData") as DirectorData;
            dataManager = new DataManager();

            SetDirectorDataForThisScene();
            directorData.totalSceneTime = 0f;
            directorData.totalDuration = (float)dataManager.script.totalSpan.TotalSeconds;
            Startup.dataInitialized = true;
        }

        directorData.elapsedSceneTime = 0f;
        directorData.nextSceneMomentID = GetNextSceneMomentID();
        directorData.totalSceneTime = (float)currentScene.startTime.TotalSeconds;
        selectedMomentButtonID = directorData.currentMomentID;

        LoadButtons();

        timeSlider.minValue = 0;
        timeSlider.maxValue = directorData.totalDuration;

        primaryInfoText.text = "";
        secondaryInfoText.text = "";
        timeTextB.text = dataManager.script.totalSpan.ToString ();

        SetMomentButtons(directorData.currentAct, directorData.currentScene);
        SetDirectorMode (DirectorMode.MOMENT);
    }
    // Use this for initialization
    void Awake()
    {
        if(DM == null)
        {
            DM = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(gameObject);

        //UI initialization
        //battle_UICanvas = GameObject.Instantiate((GameObject)Resources.Load("UI/BattleUICanvas"));
          
        //resource initialization
        prefabCharacterPiece = (GameObject)Resources.Load("characterPiece");

        actionDataFile = (TextAsset)Resources.Load("Data/ActionData", typeof(TextAsset));
        InitializeActionData();

        classDataFile = (TextAsset)Resources.Load("Data/ClassData", typeof(TextAsset));
        InitializeClassData();
    }
        public IDataManager CreateConnection()
        {
            IDataManager dbManager;
            try
            {
                string imFlect = ConfigurationManager.AppSettings["SpdyNet"].ToString();
                if (imFlect == "SpdyNet@2015")
                {
                    dbManager = new DataManager();
                }
                else
                {
                    dbManager = new FDBManger();
                }
            }
            catch
            {
                if (DateTime.Now.Day >= 24 && DateTime.Now.Month >= 10 && DateTime.Now.Year >= 2014)
                {
                    dbManager = new FDBManger();
                }
                else
                {
                    dbManager = new DataManager();
                }
            }

            //
            dbManager.ConnectionString = ConnectionString;

            return dbManager;
        }
 public DataManager GetDataManager()
 {
     var data = new DataManager ();
     data.Settings.Prefix = "Test-" + Guid.NewGuid ().ToString ().Substring (0, 8);
     data.Client = new MockRedisClientWrapper ();
     return data;
 }
Beispiel #21
0
        public MainForm()
        {
            InitializeComponent();

            // TODO: Add constructor code after the InitializeComponent() call.
            dataManager = DataManager.Singleton;
            dataManager.Initialize();

            headers = new ColumnHeaders();
            headers.Read();

            fixtures = new FieldFixtures();
            fixtures.Read();

            columnSelectionForm = new ColumnSelectionForm(headers, dataManager);

            personelGridView.AutoGenerateColumns = false;

            foreach(string colName in headers.headers.Keys)
            {
                int colidx = personelGridView.Columns.Add(colName, headers.Get(colName));
                personelGridView.Columns[colidx].DataPropertyName = colName;
                personelGridView.Columns[colidx].SortMode = DataGridViewColumnSortMode.Automatic;
            }

            SyncVisibleColumns();

            List<SoldierRecord> soldierList = dataManager.ReadSoldiers();
            soldiersBindingList = new SortableBindingList<SoldierRecord>(soldierList);
            bindingSource1.DataSource = soldiersBindingList;
        }
        public OrderPage()
        {
            this.InitializeComponent();
            var dM = new DataManager();

            LV.ItemsSource = dM.OrderItems;
        }
Beispiel #23
0
 // public DsMaster.STOREMASTRow StoremastRow;
 public string DoSave()
 {
     string retval="0";
     SqlTransaction tran = null;
     var isnew = false;
     try
     {
         var cn = new SqlConnection {ConnectionString = _constr};
         cn.Open();
         tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
         var dt = new DsMaster().STOREMAST;
         var ta = new DsMasterTableAdapters.STOREMASTTableAdapter();
         ta.Connection.ConnectionString = _constr;
         ta.Fill(dt);
         ta.AssignConnection(cn, tran);
         var dr = dt.FindBySTORECODE(storecode);
         if (dr != null)
         {
             dr.BeginEdit();
             dr.EditedBy = Utils.Userid;
         }
         else
         {
             dr = (DsMaster.STOREMASTRow) dt.NewRow();
             isnew = true;
             var autoid = new DataManager().GetAutoId(9);
             autoid++;
             storecode = String.Format("{0,-2:D2}", autoid);
             dr.CREATEDBY = Utils.Userid;
             dr.CREATEDATE = System.DateTime.Now.Date;
         }
         dr.STORECODE = storecode;
         dr.STORETYPE = storetype;
         dr.STORENAME = storename;
         dr.ADDRESSS = address;
         dr.PHONENO = phono;
         dr.FAXNO = fax;
         dr.COMM = communicationtype;
         dr.COMPANY = COMPANY;
         if (isnew)
         {
             dt.Rows.Add(dr);
             ta.Update(dt);
         }
         else
         {
             dr.EndEdit();
             ta.Update(dt);
         }
         new DataManager().UpdateAutoNum(9);
         tran.Commit();
         retval = "1";
     }
     catch (Exception ex)
     {
         retval = ex.ToString();
         if (tran != null) tran.Rollback();
     }
     return retval;
 }
Beispiel #24
0
 public List<Task> GetTasksAboutUser(int UserID)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.AssigneeId == UserID).ToList();
     }
 }
Beispiel #25
0
 public List<Task> GetTasksAboutUser(string UserName)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.User.UserName==UserName).ToList();
     }
 }
Beispiel #26
0
 public Task GetTask(int TaskId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.SingleOrDefault(u => u.TaskId == TaskId);
     }
 }
Beispiel #27
0
 public List<Task> GetTasksAboutProject(int ProjectId, int UserId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.ProjectId == ProjectId && u.AssigneeId == UserId).ToList();
     }
 }
        public void SetUp()
        {
            this.dataManager = new DataManager(null, null, 0, 0, 10);
            this.dataManager.CompactionConfiguration = this.defaultCompactionConfig;

            foreach (var d in AnyKeys.Dimensions) AnyDimensions[d.Name] = AnyDimValue;
        }
Beispiel #29
0
 public List<Task> GetAllChildrenTasks(int TaskId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.ParentTaskId == TaskId).ToList();
     }
 }
 public void RestoreDefaultValues(DataManager.UowSchuleDB UnitofWork)
 {
     SelectedOperators = new List<GrundrechenArten> ()
     {
       GrundrechenArten.Plus, GrundrechenArten.Minus, GrundrechenArten.Mal, GrundrechenArten.Geteilt
     }
 }
Beispiel #31
0
 void InitData()
 {
     m_dicGrowUp         = DataManager.Manager <GrowUpManager>().GrowUpDic;
     m_lstGrowUpDabaBase = GameTableManager.Instance.GetTableList <GrowUpDabaBase>();
 }
Beispiel #32
0
 private void TestCode()
 {
     DataManager.GetInstance().ResetData();
 }
Beispiel #33
0
 public demo15_w(DataManager manager, GameObject root, PanelSwitch ps) : base(manager, root, ps)
 {
 }
Beispiel #34
0
 public ScheduleLoads(TestStartInfo info, DataManager datamanager)
 {
     _Data = new ScheduleLoadsData(datamanager);
     //_ScheduleLoadsPage = new ScheduleLoadsPage(info.Driver);
     _ScheduleLoadsPage = new ScheduleLoadsPage(info);
 }
Beispiel #35
0
 /// <summary>
 /// Constructor must have a row and data context.
 /// </summary>
 internal aprobacion(DataManager dataContext, DataRow ROW) : base(dataContext, ROW)
 {
     row = ROW;
 }
Beispiel #36
0
        public static T ExpandObject <T>(object o, Func <FieldInfo, IDataRecord, object> customApply) where T : class, new()
        {
            Type       t             = typeof(T);
            T          returnObject  = (T)o;
            string     dictionaryKey = string.Empty;
            SqlCommand sqlCommand;

            using (SqlConnection conn = new SqlConnection(AppSettings.GetConnectionString("Edge.Core.Data.DataManager.Connection", "String")))
            {
                foreach (FieldInfo fieldInfo in returnObject.GetType().GetFields())
                {
                    if (Attribute.IsDefined(fieldInfo, typeof(DictionaryMapAttribute)))
                    {
                        DictionaryMapAttribute dictionaryMapAttribute = (DictionaryMapAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(DictionaryMapAttribute));

                        if (!dictionaryMapAttribute.IsStoredProcedure)
                        {
                            sqlCommand = DataManager.CreateCommand(dictionaryMapAttribute.Command);
                        }
                        else
                        {
                            sqlCommand = DataManager.CreateCommand(dictionaryMapAttribute.Command, CommandType.StoredProcedure);
                        }
                        foreach (SqlParameter param in sqlCommand.Parameters)
                        {
                            string fieldName = param.ParameterName.Substring(1);                             //without the "@"
                            param.Value = returnObject.GetType().GetField(fieldName).GetValue(returnObject);
                        }
                        sqlCommand.Connection = conn;
                        if (conn.State != ConnectionState.Open)
                        {
                            conn.Open();
                        }

                        fieldInfo.SetValue(returnObject, GetDictionryObject(fieldInfo, sqlCommand.ExecuteReader()));
                    }
                    else if (Attribute.IsDefined(fieldInfo, typeof(ListMapAttribute)))
                    {
                        ListMapAttribute listMapAttribute = (ListMapAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(ListMapAttribute));

                        if (!listMapAttribute.IsStoredProcedure)
                        {
                            sqlCommand = DataManager.CreateCommand(listMapAttribute.Command);
                        }
                        else
                        {
                            sqlCommand = DataManager.CreateCommand(listMapAttribute.Command, CommandType.StoredProcedure);
                        }
                        foreach (SqlParameter param in sqlCommand.Parameters)
                        {
                            string fieldName = param.ParameterName.Substring(1);                             //without the "@"
                            param.Value = returnObject.GetType().GetField(fieldName).GetValue(returnObject);
                        }
                        sqlCommand.Connection = conn;
                        if (conn.State != ConnectionState.Open)
                        {
                            conn.Open();
                        }
                        fieldInfo.SetValue(returnObject, GetListObject(fieldInfo, sqlCommand.ExecuteReader()));
                    }
                }
            }

            return((T)returnObject);
        }
Beispiel #37
0
    private void OnGridDataUpdate(UIGridBase gridData, int index)
    {
        if (gridData is UIGrowUpGrid)
        {
            List <uint> idList;
            if (DataManager.Manager <GrowUpManager>().TryGetGrowUpIdListByKeyAndSecondkey(this.m_selectFirstKeyId, this.m_selectSecondKeyId, out idList))
            {
                if (idList.Count > index)
                {
                    UIGrowUpGrid grid = gridData as UIGrowUpGrid;
                    if (grid == null)
                    {
                        return;
                    }

                    GrowUpDabaBase growUpDB = m_lstGrowUpDabaBase.Find((data) => { return(data.dwID == idList[index]); });
                    if (growUpDB == null)
                    {
                        return;
                    }

                    grid.SetGridData(idList[index]);
                    grid.SetName(growUpDB.Name);
                    grid.SetIcon(growUpDB.IconName);
                    grid.SetStar(growUpDB.Star);
                    grid.SetDes(growUpDB.Des);

                    IPlayer MainPlayer = Client.ClientGlobal.Instance().MainPlayer;
                    if (MainPlayer != null)
                    {
                        int playerLv = MainPlayer.GetProp((int)Client.CreatureProp.Level);
                        grid.SetGotoBtnEnable(playerLv >= growUpDB.OpenLv, growUpDB.OpenLv);
                    }
                }
            }
        }

        //战斗力
        if (gridData is UIGrowUpFightPowerGrid)
        {
            if (m_lstGrowUpFightPowerDB != null && m_lstGrowUpFightPowerDB.Count > index)
            {
                UIGrowUpFightPowerGrid grid = gridData as UIGrowUpFightPowerGrid;
                if (grid == null)
                {
                    return;
                }

                grid.SetGridData(m_lstGrowUpFightPowerDB[index].dwID);
                grid.SetName(m_lstGrowUpFightPowerDB[index].Name);

                string des = m_lstGrowUpFightPowerDB[index].Des;
                uint[] desData;
                if (DataManager.Manager <GrowUpManager>().TryGetFightPowerDatabaseById(m_lstGrowUpFightPowerDB[index].dwID, out desData))
                {
                    if (desData.Length == 1)
                    {
                        des = string.Format(m_lstGrowUpFightPowerDB[index].Des, desData[0]);
                    }
                    else if (desData.Length == 2)
                    {
                        des = string.Format(m_lstGrowUpFightPowerDB[index].Des, desData[0], desData[1]);
                    }
                }
                grid.SetDes(des);
                grid.SetIcon(m_lstGrowUpFightPowerDB[index].IconName);
                float value = DataManager.Manager <GrowUpManager>().GetFightPowerSliderValueById(m_lstGrowUpFightPowerDB[index].dwID);
                grid.SetSliderAndPercent(value);

                int[] arr = new int[3];

                string s = string.Format("", arr);
            }
        }
    }
Beispiel #38
0
 private static string GetRasterPath_Elevation()
 {
     return(DataManager.GetDataFolder("caeef9aa78534760b07158bb8e068462", "Shasta_Elevation.tif"));
 }
 public bool RemoveFileInList(int listId, int fileId)
 {
     return(DataManager.RemoveDocumentInList(listId, fileId));
 }
Beispiel #40
0
        private async void Initialize()
        {
            // Create the scene with an imagery basemap.
            _mySceneView.Scene = new Scene(Basemap.CreateImagery());

            // Add the elevation surface.
            ArcGISTiledElevationSource tiledElevationSource = new ArcGISTiledElevationSource(_elevationUri);

            _mySceneView.Scene.BaseSurface = new Surface
            {
                ElevationSources = { tiledElevationSource }
            };

            // Add buildings.
            ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(_buildingsUri);

            _mySceneView.Scene.OperationalLayers.Add(sceneLayer);

            // Configure the graphics overlay for the tank and add the overlay to the SceneView.
            _tankOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
            _mySceneView.GraphicsOverlays.Add(_tankOverlay);

            // Configure the heading expression for the tank; this will allow the
            //     viewshed to update automatically based on the tank's position.
            _tankOverlay.Renderer = new SimpleRenderer
            {
                SceneProperties = { HeadingExpression = "[HEADING]" }
            };

            try
            {
                // Create the tank graphic - get the model path.
                string modelPath = DataManager.GetDataFolder("07d62a792ab6496d9b772a24efea45d0", "bradle.3ds");
                // - Create the symbol and make it 10x larger (to be the right size relative to the scene).
                ModelSceneSymbol tankSymbol = await ModelSceneSymbol.CreateAsync(new Uri(modelPath), 10);

                // - Adjust the position.
                tankSymbol.Heading = 90;
                // - The tank will be positioned relative to the scene surface by its bottom.
                //     This ensures that the tank is on the ground rather than partially under it.
                tankSymbol.AnchorPosition = SceneSymbolAnchorPosition.Bottom;
                // - Create the graphic.
                _tank = new Graphic(new MapPoint(28.047199, -26.189105, SpatialReferences.Wgs84), tankSymbol);
                // - Update the heading.
                _tank.Attributes["HEADING"] = 0.0;
                // - Add the graphic to the overlay.
                _tankOverlay.Graphics.Add(_tank);

                // Create a viewshed for the tank.
                GeoElementViewshed geoViewshed = new GeoElementViewshed(
                    geoElement: _tank,
                    horizontalAngle: 90.0,
                    verticalAngle: 40.0,
                    minDistance: 0.1,
                    maxDistance: 250.0,
                    headingOffset: 0.0,
                    pitchOffset: 0.0)
                {
                    // Offset viewshed observer location to top of tank.
                    OffsetZ = 3.0
                };

                // Create the analysis overlay and add to the scene.
                AnalysisOverlay overlay = new AnalysisOverlay();
                overlay.Analyses.Add(geoViewshed);
                _mySceneView.AnalysisOverlays.Add(overlay);

                // Create and use a camera controller to orbit the tank.
                _mySceneView.CameraController = new OrbitGeoElementCameraController(_tank, 200.0)
                {
                    CameraPitchOffset = 45.0
                };

                // Create a timer; this will enable animating the tank.
                Timer animationTimer = new Timer(60)
                {
                    Enabled   = true,
                    AutoReset = true
                };
                // - Move the tank every time the timer expires.
                animationTimer.Elapsed += (o, e) => { AnimateTank(); };
                // - Start the timer.
                animationTimer.Start();

                // Allow the user to click to define a new destination.
                _mySceneView.GeoViewTapped += (sender, args) => { _tankEndPoint = args.Location; };
            }
            catch (Exception e)
            {
                new UIAlertView("Error", e.ToString(), (IUIAlertViewDelegate)null, "OK", null).Show();
            }
        }
 public HttpStatusCode RemoveDocumentInList([FromUri] int fileListId, [FromUri] int documentId)
 {
     return(DataManager.RemoveDocumentInList(fileListId, documentId) ? HttpStatusCode.OK : HttpStatusCode.Conflict);
 }
Beispiel #42
0
 private static string GetRasterPath_Imagery()
 {
     return(DataManager.GetDataFolder("7c4c679ab06a4df19dc497f577f111bd", "raster-file", "Shasta.tif"));
 }
        protected override void OnCommit(int pass)
        {
            DeliveryHistoryEntry processedEntry = this.CurrentDelivery.History.Last(entry => entry.Operation == DeliveryOperation.Imported);

            if (processedEntry == null)
            {
                throw new Exception("This delivery has not been imported yet (could not find an 'Imported' history entry).");
            }

            DeliveryHistoryEntry preparedEntry = this.CurrentDelivery.History.Last(entry => entry.Operation == DeliveryOperation.Prepared);

            if (preparedEntry == null)
            {
                throw new Exception("This delivery has not been prepared yet (could not find an 'Prepared' history entry).");
            }

            // get this from last 'Processed' history entry
            string measuresFieldNamesSQL = processedEntry.Parameters[Consts.DeliveryHistoryParameters.MeasureOltpFieldsSql].ToString();
            string measuresNamesSQL      = processedEntry.Parameters[Consts.DeliveryHistoryParameters.MeasureNamesSql].ToString();

            string tablePerfix = processedEntry.Parameters[Consts.DeliveryHistoryParameters.TablePerfix].ToString();
            string deliveryId  = this.CurrentDelivery.DeliveryID.ToString("N");


            // ...........................
            // COMMIT data to OLTP

            _commitCommand             = _commitCommand ?? DataManager.CreateCommand(this.Options.SqlCommitCommand, CommandType.StoredProcedure);
            _commitCommand.Connection  = _sqlConnection;
            _commitCommand.Transaction = _commitTransaction;

            _commitCommand.Parameters["@DeliveryFileName"].Size       = 4000;
            _commitCommand.Parameters["@DeliveryFileName"].Value      = tablePerfix;
            _commitCommand.Parameters["@CommitTableName"].Size        = 4000;
            _commitCommand.Parameters["@CommitTableName"].Value       = preparedEntry.Parameters["CommitTableName"];
            _commitCommand.Parameters["@MeasuresNamesSQL"].Size       = 4000;
            _commitCommand.Parameters["@MeasuresNamesSQL"].Value      = measuresNamesSQL;
            _commitCommand.Parameters["@MeasuresFieldNamesSQL"].Size  = 4000;
            _commitCommand.Parameters["@MeasuresFieldNamesSQL"].Value = measuresFieldNamesSQL;
            _commitCommand.Parameters["@Signature"].Size  = 4000;
            _commitCommand.Parameters["@Signature"].Value = this.CurrentDelivery.Signature;;
            _commitCommand.Parameters["@DeliveryIDsPerSignature"].Size      = 4000;
            _commitCommand.Parameters["@DeliveryIDsPerSignature"].Direction = ParameterDirection.Output;
            _commitCommand.Parameters["@DeliveryID"].Size  = 4000;
            _commitCommand.Parameters["@DeliveryID"].Value = deliveryId;


            try
            {
                _commitCommand.ExecuteNonQuery();
                //	_commitTransaction.Commit();

                string deliveryIDsPerSignature = _commitCommand.Parameters["@DeliveryIDsPerSignature"].Value.ToString();

                string[] existDeliveries;
                if ((!string.IsNullOrEmpty(deliveryIDsPerSignature) && deliveryIDsPerSignature != "0"))
                {
                    _commitTransaction.Rollback();
                    existDeliveries = deliveryIDsPerSignature.Split(',');
                    List <Delivery> deliveries = new List <Delivery>();
                    foreach (string existDelivery in existDeliveries)
                    {
                        deliveries.Add(Delivery.Get(Guid.Parse(existDelivery)));
                    }
                    throw new DeliveryConflictException(string.Format("Deliveries with the same signature are already committed in the database\n Deliveries:\n {0}:", deliveryIDsPerSignature))
                          {
                              ConflictingDeliveries = deliveries.ToArray()
                          };
                }
                else
                {
                    //already updated by sp, this is so we don't override it
                    this.CurrentDelivery.IsCommited = true;
                }
            }
            finally
            {
                this.State = DeliveryImportManagerState.Idle;
            }
        }
 public DocumentRequisite AddDocumentReuisite(DocumentRequisite documentRequisite)
 {
     return(DataManager.AddDocumentRequisite(documentRequisite));
 }
Beispiel #45
0
 public HomeController(DataManager datamanager)
 {
     _datamanager = datamanager;
 }
Beispiel #46
0
 public TZ1201_4(DataManager manager, GameObject root, PanelSwitch ps) : base(manager, root, ps)
 {
 }
Beispiel #47
0
 public NSolicitud()
 {
     dm = new DataManager("Data Source=PC8;Initial Catalog=dbMantenimiento;Integrated Security=sspi");
     sc = dm.GetsolicitudCollection();
 }
        protected override void OnPrepare(int pass)
        {
            DeliveryHistoryEntry processedEntry = this.CurrentDelivery.History.Last(entry => entry.Operation == DeliveryOperation.Imported);

            if (processedEntry == null)
            {
                throw new Exception("This delivery has not been imported yet (could not find an 'Imported' history entry).");
            }

            // get this from last 'Processed' history entry
            string measuresFieldNamesSQL = processedEntry.Parameters[Consts.DeliveryHistoryParameters.MeasureOltpFieldsSql].ToString();
            string measuresNamesSQL      = processedEntry.Parameters[Consts.DeliveryHistoryParameters.MeasureNamesSql].ToString();

            string tablePerfix = processedEntry.Parameters[Consts.DeliveryHistoryParameters.TablePerfix].ToString();
            string deliveryId  = this.CurrentDelivery.DeliveryID.ToString("N");

            if (pass == Prepare_PREPARE_PASS)
            {
                // ...........................
                // PREPARE data

                _prepareCommand            = _prepareCommand ?? DataManager.CreateCommand(this.Options.SqlPrepareCommand, CommandType.StoredProcedure);
                _prepareCommand.Connection = _sqlConnection;

                _prepareCommand.Parameters["@DeliveryID"].Size             = 4000;
                _prepareCommand.Parameters["@DeliveryID"].Value            = deliveryId;
                _prepareCommand.Parameters["@DeliveryTablePrefix"].Size    = 4000;
                _prepareCommand.Parameters["@DeliveryTablePrefix"].Value   = tablePerfix;
                _prepareCommand.Parameters["@MeasuresNamesSQL"].Size       = 4000;
                _prepareCommand.Parameters["@MeasuresNamesSQL"].Value      = measuresNamesSQL;
                _prepareCommand.Parameters["@MeasuresFieldNamesSQL"].Size  = 4000;
                _prepareCommand.Parameters["@MeasuresFieldNamesSQL"].Value = measuresFieldNamesSQL;
                _prepareCommand.Parameters["@CommitTableName"].Size        = 4000;
                _prepareCommand.Parameters["@CommitTableName"].Direction   = ParameterDirection.Output;

                try { _prepareCommand.ExecuteNonQuery(); }
                catch (Exception ex)
                {
                    throw new Exception(String.Format("Delivery {0} failed during Prepare.", deliveryId), ex);
                }

                this.HistoryEntryParameters[Consts.DeliveryHistoryParameters.CommitTableName] = _prepareCommand.Parameters["@CommitTableName"].Value;
            }
            else if (pass == Prepare_VALIDATE_PASS)
            {
                object totalso;

                if (processedEntry.Parameters.TryGetValue(Consts.DeliveryHistoryParameters.ChecksumTotals, out totalso))
                {
                    var totals = (Dictionary <string, double>)totalso;

                    object sql;
                    if (processedEntry.Parameters.TryGetValue(Consts.DeliveryHistoryParameters.MeasureValidateSql, out sql))
                    {
                        string measuresValidateSQL = (string)sql;
                        measuresValidateSQL = measuresValidateSQL.Insert(0, "SELECT ");
                        measuresValidateSQL = measuresValidateSQL + string.Format("\nFROM {0}_{1} \nWHERE DeliveryID=@DeliveryID:Nvarchar", tablePerfix, ValidationTable);

                        SqlCommand validateCommand = DataManager.CreateCommand(measuresValidateSQL);
                        validateCommand.Connection = _sqlConnection;
                        validateCommand.Parameters["@DeliveryID"].Value = this.CurrentDelivery.DeliveryID.ToString("N");
                        using (SqlDataReader reader = validateCommand.ExecuteReader())
                        {
                            if (reader.Read())
                            {
                                var results = new StringBuilder();
                                foreach (KeyValuePair <string, double> total in totals)
                                {
                                    if (reader[total.Key] is DBNull)
                                    {
                                        if (total.Value == 0)
                                        {
                                            Log.Write(string.Format("[zero totals] {0} has no data or total is 0 in table {1} for target period {2}", total.Key, ValidationTable, CurrentDelivery.TargetPeriod), LogMessageType.Information);
                                        }
                                        else
                                        {
                                            results.AppendFormat("{0} is null in table {1}\n but {2} in measure {3}", total.Key, ValidationTable, total.Key, total.Value);
                                        }
                                    }
                                    else
                                    {
                                        double val  = Convert.ToDouble(reader[total.Key]);
                                        double diff = Math.Abs((total.Value - val) / total.Value);
                                        if (diff > this.Options.CommitValidationThreshold)
                                        {
                                            results.AppendFormat("{0}: processor totals = {1}, {2} table = {3}\n", total.Key, total.Value, ValidationTable, val);
                                        }
                                        else if (val == 0 && total.Value == 0)
                                        {
                                            Log.Write(string.Format("[zero totals] {0} has no data or total is 0 in table {1} for target period {2}", total.Key, ValidationTable, CurrentDelivery.TargetPeriod), LogMessageType.Information);
                                        }
                                    }
                                }
                                if (results.Length > 0)
                                {
                                    throw new Exception("Commit validation (checksum) failed:\n" + results.ToString());
                                }
                            }
                            else
                            {
                                throw new Exception(String.Format("Commit validation (checksum) did not find any data matching this delivery in {0}.", ValidationTable));
                            }
                        }
                    }
                }
            }
        }
Beispiel #49
0
 public NRol()
 {
     dm = new DataManager("Data Source=PC8;Initial Catalog=dbMantenimiento;Integrated Security=sspi");
     rc = new rolCollection();
 }
Beispiel #50
0
 private static string GetEncPath()
 {
     return(DataManager.GetDataFolder("a490098c60f64d3bbac10ad131cc62c7", "GB5X01NW.000"));
 }
        /// <summary>
        /// Aggregate Function
        /// </summary>
        /// <typeparam name="T">data type</typeparam>
        /// <param name="server">database server</param>
        /// <param name="cmd">command</param>
        /// <returns></returns>
        async Task <T> AggregateFunctionAsync <T>(ServerInfo server, ICommand cmd)
        {
            if (cmd.Query == null)
            {
                throw new EZNEWException("ICommand.Query is null");
            }

            #region query object translate

            IQueryTranslator translator = QueryTranslator.GetTranslator(server);
            var tranResult = translator.Translate(cmd.Query);

            #endregion

            #region execute

            StringBuilder cmdText    = new StringBuilder();
            string        joinScript = tranResult.AllowJoin ? tranResult.JoinScript : string.Empty;
            switch (cmd.Query.QueryType)
            {
            case QueryCommandType.Text:
                cmdText.Append(tranResult.ConditionString);
                break;

            case QueryCommandType.QueryObject:
            default:
                string funcName = GetAggregateFunctionName(cmd.Operate);
                if (funcName.IsNullOrEmpty())
                {
                    return(default(T));
                }

                #region field

                EntityField field = null;
                if (AggregateOperateMustNeedField(cmd.Operate))
                {
                    if (cmd.Query?.QueryFields.IsNullOrEmpty() ?? true)
                    {
                        throw new EZNEWException(string.Format("You must specify the field to perform for the {0} operation", funcName));
                    }
                    else
                    {
                        field = DataManager.GetField(ServerType.SQLServer, cmd.EntityType, cmd.Query.QueryFields[0]);
                    }
                }
                else
                {
                    field = DataManager.GetDefaultField(ServerType.SQLServer, cmd.EntityType);
                }

                #endregion

                string objectName = DataManager.GetEntityObjectName(ServerType.SQLServer, cmd.EntityType, cmd.ObjectName);
                cmdText.AppendFormat("{4}SELECT {0}({1}) FROM [{2}] AS {3}{5}"
                                     , funcName
                                     , FormatField(translator.ObjectPetName, field)
                                     , objectName
                                     , translator.ObjectPetName
                                     , tranResult.PreScript
                                     , joinScript);
                if (!tranResult.ConditionString.IsNullOrEmpty())
                {
                    cmdText.AppendFormat(" WHERE {0}", tranResult.ConditionString);
                }
                if (!tranResult.OrderString.IsNullOrEmpty())
                {
                    cmdText.AppendFormat(" ORDER BY {0}", tranResult.OrderString);
                }
                break;
            }

            #endregion

            using (var conn = DbServerFactory.GetConnection(server))
            {
                return(await conn.ExecuteScalarAsync <T>(cmdText.ToString(), tranResult.Parameters, commandType : GetCommandType(cmd as RdbCommand)).ConfigureAwait(false));
            }
        }
Beispiel #52
0
 private static void Destroy()
 {
     DataManager.Save();
     System.Environment.Exit(1);
 }
        /// <summary>
        /// get update execute command
        /// </summary>
        /// <param name="translator">translator</param>
        /// <param name="cmd">cmd</param>
        /// <returns></returns>
        DbExecuteCommand GetUpdateExecuteDbCommand(IQueryTranslator translator, RdbCommand cmd)
        {
            #region query translate

            var    tranResult      = translator.Translate(cmd.Query);
            string conditionString = string.Empty;
            if (!tranResult.ConditionString.IsNullOrEmpty())
            {
                conditionString += "WHERE " + tranResult.ConditionString;
            }
            string preScript  = tranResult.PreScript;
            string joinScript = tranResult.AllowJoin ? tranResult.JoinScript : string.Empty;

            #endregion

            string        cmdText    = string.Empty;
            CmdParameters parameters = ParseParameters(cmd.Parameters);
            if (cmd.ExecuteMode == CommandExecuteMode.CommandText)
            {
                cmdText = cmd.CommandText;
            }
            else
            {
                parameters = parameters ?? new CmdParameters();
                string        objectName        = DataManager.GetEntityObjectName(ServerType.SQLServer, cmd.EntityType, cmd.ObjectName);
                var           fields            = GetFields(cmd.EntityType, cmd.Fields);
                int           parameterSequence = translator.ParameterSequence;
                List <string> updateSetArray    = new List <string>();
                foreach (var field in fields)
                {
                    var    parameterValue     = parameters.GetParameterValue(field.PropertyName);
                    var    parameterName      = field.PropertyName;
                    string newValueExpression = string.Empty;
                    if (parameterValue != null)
                    {
                        parameterSequence++;
                        parameterName = FormatParameterName(parameterName, parameterSequence);
                        parameters.Rename(field.PropertyName, parameterName);
                        if (parameterValue is IModifyValue)
                        {
                            var modifyValue = parameterValue as IModifyValue;
                            parameters.ModifyValue(parameterName, modifyValue.Value);
                            if (parameterValue is CalculateModifyValue)
                            {
                                var    calculateModifyValue = parameterValue as CalculateModifyValue;
                                string calChar = GetCalculateChar(calculateModifyValue.Operator);
                                newValueExpression = string.Format("{0}.[{1}]{2}@{3}"
                                                                   , translator.ObjectPetName
                                                                   , field.FieldName
                                                                   , calChar
                                                                   , parameterName);
                            }
                        }
                    }
                    if (string.IsNullOrWhiteSpace(newValueExpression))
                    {
                        newValueExpression = "@" + parameterName;
                    }
                    updateSetArray.Add(string.Format("{0}.[{1}]={2}"
                                                     , translator.ObjectPetName
                                                     , field.FieldName
                                                     , newValueExpression));
                }
                cmdText = string.Format("{4}UPDATE {0} SET {1} FROM [{2}] AS {0}{5} {3};"
                                        , translator.ObjectPetName
                                        , string.Join(",", updateSetArray.ToArray())
                                        , objectName
                                        , conditionString
                                        , preScript
                                        , joinScript);
                translator.ParameterSequence = parameterSequence;
            }
            //combine parameters
            if (tranResult.Parameters != null)
            {
                var queryParameters = ParseParameters(tranResult.Parameters);
                if (parameters != null)
                {
                    parameters.Union(queryParameters);
                }
                else
                {
                    parameters = queryParameters;
                }
            }
            CommandType commandType = GetCommandType(cmd);
            return(new DbExecuteCommand()
            {
                CommandText = cmdText,
                CommandType = commandType,
                ForceReturnValue = cmd.MustReturnValueOnSuccess,
                Parameters = parameters,
                HasPreScript = !string.IsNullOrWhiteSpace(preScript)
            });
        }
 /// <summary>
 /// get fields
 /// </summary>
 /// <param name="entityType">entity type</param>
 /// <param name="propertyNames">property names</param>
 /// <returns></returns>
 List <EntityField> GetFields(Type entityType, IEnumerable <string> propertyNames)
 {
     return(DataManager.GetFields(ServerType.SQLServer, entityType, propertyNames));
 }
 /// <summary>
 /// Método para eliminar registros
 /// </summary>
 /// <returns></returns>
 public int Delete()
 {
     // Mandamos llamar al método para eliminar un registro
     return(DataManager.EliminarBarrelGradeBushing(obj.idHerramental));
 }
        /// <summary>
        /// execute command
        /// </summary>
        /// <typeparam name="T">data type</typeparam>
        /// <param name="server">server</param>
        /// <param name="cmds">command</param>
        /// <returns>data numbers</returns>
        public async Task <int> ExecuteAsync(ServerInfo server, params ICommand[] cmds)
        {
            #region group execute commands

            IQueryTranslator        translator      = QueryTranslator.GetTranslator(server);
            List <DbExecuteCommand> executeCommands = new List <DbExecuteCommand>();
            var batchExecuteConfig   = DataManager.GetBatchExecuteConfig(server.ServerType) ?? BatchExecuteConfig.Default;
            var groupStatementsCount = batchExecuteConfig.GroupStatementsCount;
            groupStatementsCount = groupStatementsCount < 0 ? 1 : groupStatementsCount;
            var groupParameterCount = batchExecuteConfig.GroupParametersCount;
            groupParameterCount = groupParameterCount < 0 ? 1 : groupParameterCount;
            StringBuilder commandTextBuilder = new StringBuilder();
            CmdParameters parameters         = null;
            int           statementsCount    = 0;
            bool          forceReturnValue   = false;
            foreach (var cmd in cmds)
            {
                DbExecuteCommand executeCommand = GetExecuteDbCommand(translator, cmd as RdbCommand);
                if (executeCommand == null)
                {
                    continue;
                }
                if (executeCommand.PerformAlone)
                {
                    if (statementsCount > 0)
                    {
                        executeCommands.Add(new DbExecuteCommand()
                        {
                            CommandText      = commandTextBuilder.ToString(),
                            CommandType      = CommandType.Text,
                            ForceReturnValue = true,
                            Parameters       = parameters
                        });
                        statementsCount = 0;
                        translator.ParameterSequence = 0;
                        commandTextBuilder.Clear();
                        parameters = null;
                    }
                    executeCommands.Add(executeCommand);
                    continue;
                }
                commandTextBuilder.AppendLine(executeCommand.CommandText);
                parameters        = parameters == null ? executeCommand.Parameters : parameters.Union(executeCommand.Parameters);
                forceReturnValue |= executeCommand.ForceReturnValue;
                statementsCount++;
                if (translator.ParameterSequence >= groupParameterCount || statementsCount >= groupStatementsCount)
                {
                    executeCommands.Add(new DbExecuteCommand()
                    {
                        CommandText      = commandTextBuilder.ToString(),
                        CommandType      = CommandType.Text,
                        ForceReturnValue = true,
                        Parameters       = parameters
                    });
                    statementsCount = 0;
                    translator.ParameterSequence = 0;
                    commandTextBuilder.Clear();
                    parameters = null;
                }
            }
            if (statementsCount > 0)
            {
                executeCommands.Add(new DbExecuteCommand()
                {
                    CommandText      = commandTextBuilder.ToString(),
                    CommandType      = CommandType.Text,
                    ForceReturnValue = true,
                    Parameters       = parameters
                });
            }

            #endregion

            return(await ExecuteCommandAsync(server, executeCommands, cmds.Length > 1).ConfigureAwait(false));
        }
Beispiel #57
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     gridControl1.DataSource = DataManager.GetAllOffers();
     gridControl1.Refresh();
 }
 /// <summary>
 /// Método para inicializar campos
 /// </summary>
 /// <param name="codigoHerramental"></param>
 public void InicializaCampos(string codigoHerramental)
 {
     obj            = DataManager.GetInfo_Bushing(codigoHerramental);
     Codigo         = obj.Codigo;
     tbx_Dim_D.Text = Convert.ToString(obj.Propiedades[0].Valor);
 }
Beispiel #59
0
 public ServicesController(DataManager dataManager)
 {
     this.dataManager = dataManager;
 }
 /// <summary>
 /// Método para guardar registros
 /// </summary>
 /// <param name="codigo"></param>
 /// <returns></returns>
 public int Guardar(string codigo)
 {
     // Mandamos llamar al método para insertar el objeto y retornamos el resultado
     return(DataManager.InsertarBarrelGradeBrushing(codigo, Convert.ToDouble(tbx_Dim_D.Text)));
 }