/// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MainWorkPlaceVwViewModel mainWorkPlaceVwViewModel = new MainWorkPlaceVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // mainWorkPlaceVwViewModel.Instance = MainWorkPlaceVwServices.Get(id.Value, db);
            mainWorkPlaceVwViewModel.Instance = MainWorkPlaceVwServices.GetChildren(id.Value, db);
            if (mainWorkPlaceVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.SalaryWorkPlaceVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "SalaryWorkPlace", "ModuleNamePlural");
            // mainWorkPlaceVwViewModel.SalaryWorkPlaceVwViewModel.List = SalaryWorkPlaceVwServices.GetByMainWorkPlaceId(id.Value, db);
            mainWorkPlaceVwViewModel.SalaryWorkPlaceVwViewModel.List = mainWorkPlaceVwViewModel.Instance.SalaryWorkPlaceVwList;


            return(View(mainWorkPlaceVwViewModel));
        }
        /// <summary>
        /// Returns a list of MainWorkPlaceVw objects
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(MainWorkPlaceVwViewModel Model)
        {
            Db db = new Db(DbServices.ConnectionString);

            Model.List = MainWorkPlaceVwServices.List(db);
            return(View(Model));
        }
Esempio n. 3
0
 private void FormMainWorkPlaceView_Load(object sender, EventArgs e)
 {
     if (dataSource == null)
     {
         DateTime dt = DateTime.Now;
         DataSource = MainWorkPlaceVwServices.List(new Db(DbServices.ConnectionString));
         slblEllapsedTimeValue.Text = (DateTime.Now.Subtract(dt).TotalMilliseconds / 1000).ToString();
     }
 }