Exemple #1
0
        private void loadData()
        {
            tsbSave.Enabled   = false;
            tsbCancel.Enabled = false;
            tsbEdit.Enabled   = false;
            CtrlUtil.EnabledControl(false, txtChrData);
            shtView.ActiveSkin = Common.ACTIVE_SKIN;


            try
            {
                SystemConfigController  ctlsys = new SystemConfigController();
                SystemConfigurationUIDM model  = ctlsys.LoadSysConfig();

                //List<SysConfigDTO> dto = ctlsys.LoadSysConfig();
                //m_dtAllData = DTOUtility.ConvertListToDataTable(dto);
                //DataTable dtView = m_dtAllData.Clone();
                //foreach (DataRow dr in m_dtAllData.Rows)
                //{
                //    dtView.ImportRow(dr);
                //}

                fpView.DataSource = model.DATA_VIEW;
                CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));

                for (int i = 0; i < shtView.Rows.Count; i++)
                {
                    if (Convert.ToInt32(shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value) == 1)
                    {
                        shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value = true;
                    }
                    else
                    {
                        shtView.Cells[i, (int)eColumns.EDIT_FLAG].Value = false;
                    }
                }

                //if ((shtView.Rows.Count > 0)&& (Convert.ToBoolean(shtView.Cells[0, (int)eColumns.EDIT_FLAG].Value)==true))
                // {
                //     txtSysGroupId.Text = Convert.ToString(shtView.Cells[shtView.ActiveRowIndex, (int)eColumns.SYS_GROUP_ID].Value);
                //     txtSysKey.Text = Convert.ToString(shtView.Cells[shtView.ActiveRowIndex, (int)eColumns.SYS_KEY].Value);
                //     txtChrData.Text = Convert.ToString(shtView.Cells[shtView.ActiveRowIndex, (int)eColumns.CHAR_DATA].Value);
                //     tsbEdit.Enabled = true;
                // }

                if (shtView.RowCount > 0)
                {
                    shtView.ActiveRowIndex = 0;
                    shtView.AddSelection(0, 0, 1, 1);

                    shtView.SetActiveCell(0, 0);
                    fpView.ShowActiveCell(VerticalPosition.Top, HorizontalPosition.Left);
                    fpView_SelectionChanged(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }
Exemple #2
0
        internal SystemConfigurationUIDM LoadSysConfig()
        {
            SystemConfigurationUIDM model      = new SystemConfigurationUIDM();
            SysConfigBIZ            biz        = new SysConfigBIZ();
            List <SysConfigDTO>     listConfig = biz.LoadData();

            model.DATA_VIEW = DTOUtility.ConvertListToDataTable <SysConfigDTO>(listConfig);
            return(model);
        }
Exemple #3
0
        internal int UpdateConfig(SystemConfigurationUIDM sysUIDM)
        {
            SysConfigDTO data = new SysConfigDTO();

            data.SYS_GROUP_ID = sysUIDM.SysGroupId;
            data.SYS_KEY      = sysUIDM.SysKey;
            data.CHAR_DATA    = sysUIDM.ChrData;
            int checkUpdate = UpdateConfig(data);

            return(checkUpdate);
        }
Exemple #4
0
        private void UpdateData()
        {
            SystemConfigurationUIDM datamodel = dmc.SaveData(new SystemConfigurationUIDM());

            try
            {
                SystemConfigController ctlsys = new SystemConfigController();
                int check = ctlsys.UpdateConfig(datamodel);
                if (check == 0)
                {
                    MessageDialog.ShowInformation(this, null, Message.LoadMessage(TKPMessages.eValidate.VLM0100.ToString()).MessageDescription);
                    return;
                }
                else
                {
                    loadData();
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }