public MainWindow(ApplicationInfoViewModel applicationInfo)
        {
            _applicationInfo = applicationInfo;
            InitializeComponent();

            BuildTabControl(applicationInfo);
        }
        /// <summary>
        /// Add application info
        /// </summary>
        /// <returns></returns>
        public PartialViewResult PartialAddApplicationInfo()
        {
            ApplicationInfoViewModel oApplicationInfoViewModel = new ApplicationInfoViewModel();

            oApplicationInfoViewModel.APPLICATION_ID = CurrentApplicationID;
            return(PartialView("_AddApplicationInfo", oApplicationInfoViewModel));
        }
        public JsonResult JEditApplicationInfo(ApplicationInfoViewModel oApplicationInfoViewModel)
        {
            Response oResponseResult = null;

            oApplicationInfoViewModel.MODIFIED_BY = Convert.ToInt32(CurrentUser.nUserID);

            oResponseResult      = this.oIApplicationInfoService.oUpdateApplicationInfo(oApplicationInfoViewModel);
            this.OperationResult = oResponseResult.OperationResult;

            switch (this.OperationResult)
            {
            case enumOperationResult.Success:
                this.OperationResultMessages = CommonResx.MessageEditSuccess;
                break;

            case enumOperationResult.Faild:
                this.OperationResultMessages = CommonResx.MessageEditFailed;
                break;
            }
            return(Json(
                       new
            {
                nResult = this.OperationResult,
                sResultMessages = this.OperationResultMessages
            },
                       JsonRequestBehavior.AllowGet));
        }
        public JsonResult JSaveApplicationInfo(ApplicationInfoViewModel oApplicationInfoViewModel)
        {
            Response oResponseResult = null;

            oApplicationInfoViewModel.CREATED_BY = Convert.ToInt32(CurrentUser.nUserID);

            oResponseResult      = this.oIApplicationInfoService.oInsertApplicationInfo(oApplicationInfoViewModel);
            this.OperationResult = oResponseResult.OperationResult;

            switch (this.OperationResult)
            {
            case enumOperationResult.Success:
                this.OperationResultMessages = CommonResx.MessageAddSuccess;
                break;

            case enumOperationResult.RelatedRecordFaild:
                this.OperationResultMessages = ApplicationInfoResx.AlreadyAddedMaximumList;
                break;

            case enumOperationResult.Faild:
                this.OperationResultMessages = CommonResx.MessageAddFailed;
                break;
            }
            return(Json(
                       new
            {
                nResult = this.OperationResult,
                sResultMessages = this.OperationResultMessages
            },
                       JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        /// <summary>
        ///  Insert application info
        /// </summary>
        /// <param name="oApplicationInfoViewModel"></param>
        /// <returns>Response</returns>
        public Response oInsertApplicationInfo(ApplicationInfoViewModel oApplicationInfoViewModel)
        {
            #region ": Insert :"

            Response oResponse = new Response();

            try
            {
                if (oApplicationInfoViewModel != null)
                {
                    var lstMemberInfo = (from c in this.ApplicationInfoDBSet
                                         where c.APPLICATION_ID == oApplicationInfoViewModel.APPLICATION_ID
                                         orderby c.ID descending
                                         select new
                    {
                        ID = c.ID,
                        APPLICATION_ID = c.APPLICATION_ID,
                        MEMBER_INFO_TITLE = c.TITLE,
                        DESCRIPTION = c.DESCRIPTION
                    });
                    if (lstMemberInfo.Count() >= 5)
                    {
                        oResponse.OperationResult = enumOperationResult.RelatedRecordFaild;
                        return(oResponse);
                    }

                    APPLICATION_INFO oAPPLICATION_INFO = new APPLICATION_INFO()
                    {
                        APPLICATION_ID = oApplicationInfoViewModel.APPLICATION_ID,
                        TITLE          = oApplicationInfoViewModel.TITLE,
                        DESCRIPTION    = oApplicationInfoViewModel.DESCRIPTION,
                        CREATED_BY     = oApplicationInfoViewModel.CREATED_BY,
                        CREATED_DATE   = DateTime.Now
                    };
                    this.oTakamulConnection.APPLICATION_INFO.Add(oAPPLICATION_INFO);
                    if (this.intCommit() > 0)
                    {
                        oResponse.OperationResult = enumOperationResult.Success;
                    }
                    else
                    {
                        oResponse.OperationResult = enumOperationResult.Faild;
                    }
                }
            }
            catch (Exception Ex)
            {
                oResponse.OperationResult = enumOperationResult.Faild;
                //TODO : Log Error Message
                oResponse.OperationResultMessage = Ex.Message.ToString();
            }

            return(oResponse);

            #endregion
        }
Пример #6
0
        /// <summary>
        /// Update member info
        /// </summary>
        /// <param name="oApplicationInfoViewModel"></param>
        /// <returns>Response</returns>
        public Response oUpdateApplicationInfo(ApplicationInfoViewModel oApplicationInfoViewModel)
        {
            Response oResponse = new Response();

            #region Try Block

            try
            {
                // Start try

                #region Check oEventViewModel Value
                APPLICATION_INFO oAPPLICATION_INFO = new APPLICATION_INFO();
                oAPPLICATION_INFO = this.oTakamulConnection.APPLICATION_INFO.Find(oApplicationInfoViewModel.ID);

                if (oAPPLICATION_INFO == null)
                {
                    throw new ArgumentNullException("oAPPLICATION_INFO Entity Is Null");
                }

                #endregion

                #region Update Default APPLICATION_INFO

                oAPPLICATION_INFO.APPLICATION_ID = oApplicationInfoViewModel.APPLICATION_ID;
                oAPPLICATION_INFO.TITLE          = oApplicationInfoViewModel.TITLE;
                oAPPLICATION_INFO.DESCRIPTION    = oApplicationInfoViewModel.DESCRIPTION;
                oAPPLICATION_INFO.MODIFIED_BY    = oApplicationInfoViewModel.CREATED_BY;
                oAPPLICATION_INFO.MODIFIED_DATE  = DateTime.Now;
                this.ApplicationInfoDBSet.Attach(oAPPLICATION_INFO);
                this.oTakamulConnection.Entry(oAPPLICATION_INFO).State = EntityState.Modified;

                if (this.intCommit() > 0)
                {
                    oResponse.OperationResult = enumOperationResult.Success;
                }
                else
                {
                    oResponse.OperationResult = enumOperationResult.Faild;
                }
                #endregion
            }// End try
            #endregion

            #region Catch Block
            catch (Exception Ex)
            {// Start Catch
                oResponse.OperationResult = enumOperationResult.Faild;
                //TODO : Log Error Message
                oResponse.OperationResultMessage = Ex.Message.ToString();
            }//End Catch
            #endregion

            return(oResponse);
        }
        private void BuildTabControl(ApplicationInfoViewModel applicationInfo)
        {
            _tabControl = new TabControl();

            _tabControl.Items.Add(new TabItem
            {
                Header  = "ApplicationInfo",
                Content = new Label {
                    Content = "ApplicationInfo todo..."
                }
            });

            AddNumberSpecificationTabs(applicationInfo.NumberSpecifications);

            this.Content = _tabControl;
        }
Пример #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="genericModel">This is the instance created by the WizardViewModel</param>
        /// <returns></returns>
        private static List <CompleteStep <MonoberryProjectObject> > CreateMonoberryProjectSteps(MonoberryProjectObject genericModel)
        {
            /// 2.1) Create a view model for each step.
            ///     Each of these descend from WizardStepViewModelBase
            var step1ViewModel = new WelcomeStepViewModel(genericModel);

            /// This ViewModel contains a RouteOptionGroupViewModel (a group of options that may alter the workflow of the wizard).
            /// See TypeSizeStepViewModel.CreateAvailableDrinkSizes.
            var step2ViewModel = new SDKConfigurationViewModel(genericModel);
            var step3ViewModel = new DeviceSetupViewModel(genericModel);
            var step4ViewModel = new ApplicationInfoViewModel(genericModel);
            var step5ViewModel = new FinishStepViewModel(genericModel);

            /// 2.2) Create a list of steps.
            ///     We pass the same type param (CupOfCoffee) that we passed to WizardViewModel in Button_Click above.
            return(new List <CompleteStep <MonoberryProjectObject> >()
            {
                /// Each step contains a ViewModel and a View type (the type representing the actual Xaml to be shown).
                new CompleteStep <MonoberryProjectObject>()
                {
                    ViewModel = step1ViewModel, ViewType = typeof(WelcomeView), Visited = true
                },
                new CompleteStep <MonoberryProjectObject>()
                {
                    ViewModel = step2ViewModel, ViewType = typeof(SDKConfigurationView)
                },
                new CompleteStep <MonoberryProjectObject>()
                {
                    ViewModel = step3ViewModel, ViewType = typeof(DeviceSetupView)
                },
                new CompleteStep <MonoberryProjectObject>()
                {
                    ViewModel = step4ViewModel, ViewType = typeof(ApplicationInfoView)
                },
                new CompleteStep <MonoberryProjectObject>()
                {
                    ViewModel = step5ViewModel, ViewType = typeof(FinishView)
                },
            });
        }
 /// <summary>
 ///  Edit application info
 /// </summary>
 /// <param name="oMemberInfoViewModel"></param>
 /// <returns></returns>
 public PartialViewResult PartialEditApplicationInfo(ApplicationInfoViewModel oApplicationInfoViewModel)
 {
     oApplicationInfoViewModel.APPLICATION_ID = CurrentApplicationID;
     return(PartialView("_EditApplicationInfo", oApplicationInfoViewModel));
 }