Example #1
0
        private void RetriveData()
        {
            try
            {
                if (user == null)
                {
                    user               = new sp_MAS101_GetUser_Result();
                    user.CRT_DATE      = DateTime.Now;
                    this.ToolBarSwitch = "2122222222";
                    CtrlUtil.EnableControls(true, txtID);
                }
                else if (user.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                    CtrlUtil.EnableControls(false, txtID);
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                    CtrlUtil.EnableControls(false, txtID);
                }

                CtrlUtil.EnableControls(user.DEL_ID.IsNull(), cboPreName, cboDivision, cboSubDivision, cboPosition, cboGroup);
                CtrlUtil.EnableControls(user.DEL_ID.IsNull(), txtFName_En, txtLName_En, txtFName_Th, txtLName_Th, txtNickName, txtIDCard, dtBirthDate, dtStartDate, txtPassword, txtRegistrationNo, txtLabSupervisorNo);

                user.PASS     = null;
                bs.DataSource = user;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
 private void txtStdLight_OnSelected(object sender, EventArgs e)
 {
     try
     {
         if (txtStdLight.IntValue != null)
         {
             sp_MAS302_GetSTDLight_Result data = (txtStdLight.SelectedData as sp_MAS302_GetSTDLight_Result);
             sp_MAS201_GetCustomer_Result cust = vmMas.GetCustomer(this.result.CUSTOMER_ID);
             txtStdValue.NullableIntValue = data.STANDARD;
             txtStdName.Text = data.ALIAS_NAME.GetValueOrDefault(data.NAME);
             if (cust != null)
             {
                 if (cust.IS_LANG_TH == true)
                 {
                     txtStdName.Text = data.ALIAS_NAME.GetValueOrDefault(data.NAME);
                 }
                 else
                 {
                     txtStdName.Text = data.ALIAS_NAME_EN.GetValueOrDefault(data.NAME);
                 }
             }
             CtrlUtil.EnableControls(true, txtStdName);
         }
         else
         {
             txtStdValue.NullableIntValue = null;
             txtStdName.Text = null;
             CtrlUtil.EnableControls(false, txtStdName);
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }
        private void RetriveData()
        {
            try
            {
                if (MethodResult == null)
                {
                    MethodResult          = new sp_MAS304_GetMethodAnalysis_Result();
                    MethodResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch    = "2122222222";
                }
                else if (MethodResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(MethodResult.DEL_ID.IsNull(), txtName, cboInstitution, txtSeq);

                bdSource.DataSource = MethodResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #4
0
        private void RetriveData()
        {
            try
            {
                if (LabExtResult == null)
                {
                    LabExtResult          = new sp_MAS310_GetLabExt_Result();
                    LabExtResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch    = "2122222222";
                }
                else if (LabExtResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(LabExtResult.DEL_ID.IsNull(), txtName, txtSeq);

                bdSource.DataSource = LabExtResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #5
0
        private void RetriveData()
        {
            try
            {
                if (InstrumentResult == null)
                {
                    InstrumentResult          = new sp_MAS303_GetInstrument_Result();
                    InstrumentResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch        = "2122222222";
                }
                else if (InstrumentResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(InstrumentResult.DEL_ID.IsNull(), txtName, txtModel, txtSerialNo, txtSeq);

                bs.DataSource = InstrumentResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #6
0
        private void RetriveData()
        {
            try
            {
                if (InstitutionResult == null)
                {
                    InstitutionResult          = new sp_MAS307_GetInstitutionSTD_Result();
                    InstitutionResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch         = "2122222222";
                }
                else if (InstitutionResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(InstitutionResult.DEL_ID.IsNull(), txtName, txtShortName, txtEditionName, txtPageFrom, txtPageTo, txtSeq);

                bdSource.DataSource = InstitutionResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void RetriveData()
        {
            try
            {
                if (stdLightResult == null)
                {
                    stdLightResult          = new sp_MAS302_GetSTDLight_Result();
                    stdLightResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch      = "2122222222";
                }
                else if (stdLightResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(stdLightResult.DEL_ID.IsNull(), txtName, txtTypeName, txtBuildingName, txtAliasName, txtAliasNameEn, txtStandard, txtSeq);

                bs.DataSource = stdLightResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #8
0
        private void RetriveData()
        {
            try
            {
                if (groupResult == null)
                {
                    groupResult            = new GroupDTO();
                    groupResult.CRT_DATE   = DateTime.Now;
                    groupResult.Permission = vmMas.GetGroupPermission(groupResult.ID);
                    this.ToolBarSwitch     = "2122222222";
                }
                else if (groupResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                    groupResult        = vmMas.GetGroup(groupResult.ID);
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                    groupResult        = vmMas.GetGroup(groupResult.ID);
                }

                CtrlUtil.EnableControls(groupResult.DEL_ID.IsNull(), txtNameTh, txtNameEn, txtSeq);

                bs.DataSource           = groupResult;
                gvPermission.DataSource = groupResult.Permission;
                gvUser.DataSource       = groupResult.User;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void RetriveData()
        {
            try
            {
                if (ParameterResult == null)
                {
                    ParameterResult          = new sp_MAS305_GetParameterAnalysis_Result();
                    ParameterResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch       = "2122222222";
                }
                else if (ParameterResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(ParameterResult.DEL_ID.IsNull(), txtName, txtMethod, cboUnit, txtStandardThai, txtStandardACGIH, txtToolPick, txtToolAnalysis, txtSeq);
                CtrlUtil.EnableControls(ParameterResult.DEL_ID.IsNull(), txtMethodRef, txtMethodRemark, txtMRLValue, cboLabExt, txtAnalysisDetail, chkCeilingLimit);

                bdSource.DataSource = ParameterResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #10
0
        private void RetriveData()
        {
            try
            {
                if (posResult == null)
                {
                    posResult          = new sp_MAS104_GetPosition_Result();
                    posResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch = "2122222222";
                }
                else if (posResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(posResult.DEL_ID.IsNull(), txtNameTh, txtNameEn, txtSeq);

                bs.DataSource = posResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void RetriveData()
        {
            try
            {
                if (custpResult == null)
                {
                    custpResult          = new sp_MAS202_GetCustomerProject_Result();
                    custpResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch   = "2122222222";
                }
                else if (custpResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(custpResult.DEL_ID.IsNull(), txtCustomer, txtNameTh, txtNameEn, txtAddrNo, txtMoo, txtBuildingEn, txtBuildingTh, txtAlleyEn, txtAlleyTh, txtLaneEn, txtLaneTh, txtRoadEn, txtRoadTh, txtSubDictrictEn, txtSubDictrictTh, txtDictrictEn, txtDictrictTh, cboProvince, txtPostCode, txtSeq);

                bs.DataSource = custpResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
 private void dtMeasuredDateNight_DateChange(object sender, EventArgs e)
 {
     CtrlUtil.EnableControls(dtMeasuredDateNight.DateValue.HasValue, dtTimeFromNight, dtTimeToNight);
     if (!dtMeasuredDateNight.DateValue.HasValue)
     {
         dtTimeFromNight.TimeValue = dtTimeToNight.TimeValue = null;
         if (wplResult != null && wplResult.Detail != null)
         {
             foreach (DataRow dr in wplResult.Detail.Rows)
             {
                 dr.SetValue("RESULT_NIGHT", null);
             }
         }
     }
 }
 private void chkLess_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (chkLess.Checked)
         {
             txtResult.NullableDecimalValue = txtMRL.NullableDecimalValue;
         }
         CtrlUtil.EnableControls(!chkLess.Checked, txtResult);
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }
 private void txtResult_TextChanged(object sender, EventArgs e)
 {
     try
     {
         bool isError = (txtResultDay.NullableIntValue.HasValue && txtStdValue.NullableIntValue > txtResultDay.NullableIntValue) || (txtResultNight.NullableIntValue.HasValue && txtStdValue.NullableIntValue > txtResultNight.NullableIntValue);
         CtrlUtil.EnableControls(isError, txtCondition);
         if (!isError)
         {
             txtCondition.Text = null;
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }
        private void SetDataToControl(sp_RPT001_GetWorkPlaceLightDt_Result data)
        {
            try
            {
                txtLocationLV3.Text             = data.LOC_NAME_LV3;
                txtLocationLV2.Text             = data.LOC_NAME_LV2;
                txtLocationName.Text            = data.LOC_NAME;
                txtStdLight.IntValue            = data.STDLIGHT_ID;
                txtStdName.Text                 = data.STDLIGHT_NAME;
                txtStdValue.NullableIntValue    = data.STDLIGHT_STANDARD;
                txtResultDay.NullableIntValue   = data.RESULT_DAY;
                txtResultNight.NullableIntValue = data.RESULT_NIGHT;
                txtCondition.Text               = data.CONDITION;

                CtrlUtil.EnableControls(txtStdValue.NullableIntValue.HasValue, txtStdName);
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void InitialScreen()
        {
            try
            {
                gvDetail.SetOISStyle(true);
                gvDetail.MappingEnum(typeof(eCol));

                gvDetail.SetColumnDate((int)eCol.SAMPLING_DATE);
                gvDetail.SetColumnTime((int)eCol.SAMPLING_TIME);
                gvDetail.SetColumnNumeric((int)eCol.SAMPLING_MINS);
                gvDetail.SetColumnNumeric((int)eCol.AIR_FLOW, 4);
                gvDetail.SetColumnNumeric((int)eCol.RESULT_VALUE, 3);
                gvDetail.SetColumnNumeric((int)eCol.STANDARD_THAI, 1);
                gvDetail.SetColumnNumeric((int)eCol.STANDARD_ACGIH, 1);
                gvDetail.SetColumnNumeric((int)eCol.MRL_VALUE, 5);

                gvDetail.Columns[(int)eCol.CEILING_LIMIT].Visible = false;

                gvDetail.Columns[(int)eCol.UNIT_NAME].ReadOnly = true;
                gvDetail.Columns[(int)eCol.MRL_VALUE].ReadOnly = true;

                for (int i = (int)eCol.ID; i <= (int)eCol.DEL_ID; i++)
                {
                    gvDetail.Columns[i].Visible = false;
                }

                cboUnit.SetDataSource(vmCombo.GetComboUnit(), false);

                CtrlUtil.EnableControls(false, txtStdThai, txtStdAcgih, txtMRL, cboUnit, chkC);

                gvDetail.DataSource = this.result.Detail;


                this.SetGridError();
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void InitialScreen()
        {
            try
            {
                gvDetail.SetOISStyle(true);
                gvDetail.MappingEnum(typeof(eCol));

                gvDetail.SetColumnNumeric((int)eCol.STDLIGHT_STANDARD);
                gvDetail.SetColumnNumeric((int)eCol.RESULT_DAY);
                gvDetail.SetColumnNumeric((int)eCol.RESULT_NIGHT);
                gvDetail.SetColumnText((int)eCol.CONDITION);

                for (int i = (int)eCol.ID; i <= (int)eCol.DEL_ID; i++)
                {
                    gvDetail.Columns[i].Visible = false;
                }
                gvDetail.Columns[(int)eCol.LOC_BTN].Visible      = false;
                gvDetail.Columns[(int)eCol.STDLIGHT_BTN].Visible = false;

                gvDetail.Columns[(int)eCol.RESULT_DAY].Visible   = this.result.MEASURED_DATE.HasValue;
                gvDetail.Columns[(int)eCol.RESULT_NIGHT].Visible = this.result.MEASURED_DATE_NIGHT.HasValue;

                CtrlUtil.EnableControls(this.result.MEASURED_DATE.HasValue, txtResultDay);
                CtrlUtil.EnableControls(this.result.MEASURED_DATE_NIGHT.HasValue, txtResultNight);
                CtrlUtil.EnableControls(false, txtStdName);

                gvDetail.DataSource = this.result.Detail;


                this.SetGridError();
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
        private void RetriveData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                systemConfigResult = vmSys.GetSystemConfig();

                if (mode == ScreenMode.Add)
                {
                    if (wplResult == null)
                    {
                        wplResult                     = new RPT001_WorkPlaceLightDTO();
                        wplResult.CRT_DATE            = DateTime.Now;
                        wplResult.REGISTRATION_ID     = systemConfigResult.DEFAULT_REPORT_REGISTRATION_ID;
                        wplResult.REGISTRATION_NAME   = systemConfigResult.DEFAULT_REPORT_REGISTRATION_NAME;
                        wplResult.LAB_SUPERVISOR_ID   = systemConfigResult.DEFAULT_REPORT_LAB_SUPERVISOR_ID;
                        wplResult.LAB_SUPERVISOR_NAME = systemConfigResult.DEFAULT_REPORT_LAB_SUPERVISOR_NAME;
                        this.ToolBarSwitch            = "2122222222";
                        CtrlUtil.EnableControls(true, cboReportCode);
                    }
                    else
                    {
                        wplResult.ID                  = 0;
                        wplResult.REPORTNUMBER        = null;
                        wplResult.REPORT_CODE         = null;
                        wplResult.CRT_ID              = null;
                        wplResult.CRT_DATE            = DateTime.Now;
                        wplResult.CRT_MACHINE         = null;
                        wplResult.CRT_NAME            = null;
                        wplResult.UPD_ID              = null;
                        wplResult.UPD_DATE            = null;
                        wplResult.UPD_MACHINE         = null;
                        wplResult.UPD_NAME            = null;
                        wplResult.DEL_ID              = null;
                        wplResult.DEL_DATE            = null;
                        wplResult.DEL_MACHINE         = null;
                        wplResult.DEL_NAME            = null;
                        wplResult.REGISTRATION_ID     = systemConfigResult.DEFAULT_REPORT_REGISTRATION_ID;
                        wplResult.REGISTRATION_NAME   = systemConfigResult.DEFAULT_REPORT_REGISTRATION_NAME;
                        wplResult.LAB_SUPERVISOR_ID   = systemConfigResult.DEFAULT_REPORT_LAB_SUPERVISOR_ID;
                        wplResult.LAB_SUPERVISOR_NAME = systemConfigResult.DEFAULT_REPORT_LAB_SUPERVISOR_NAME;
                        this.ToolBarSwitch            = "2122222222";
                        CtrlUtil.EnableControls(true, cboReportCode);
                    }
                }
                else if (wplResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122122102";
                    CtrlUtil.EnableControls(false, cboReportCode);
                }
                else
                {
                    this.ToolBarSwitch = "2022022012";
                    CtrlUtil.EnableControls(false, cboReportCode);
                }


                CtrlUtil.EnableControls(!wplResult.Is_Canceled, txtCustomer, txtCustomerAddr, txtProject, txtProjectAddr, dtMeasuredDate, dtMeasuredDateTo, dtTimeFrom, dtTimeTo, dtMeasuredDateNight, dtMeasuredDateNightTo, dtTimeFromNight, dtTimeToNight, btnUpdateCustomer, btnUpdateProject, chkShowLv3EachPage, chkShowLv3Cont, chkShowLv2Cont);

                CtrlUtil.EnableControls(OISDataInfo.UserInfomation.GROUP_ID == 3 && !wplResult.Is_Canceled, txtRegistration, txtLabSupervisor);

                //bs.DataSource = wplResult;
                BindData();
                ApplySummary();

                dtMeasuredDate_DateChange(null, null);
                dtMeasuredDateNight_DateChange(null, null);
                this.wplResult.Detail.AcceptChanges();
                this.wplResult.User.AcceptChanges();
                this.wplResult.Instrument.AcceptChanges();
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #19
0
        private void RetriveData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                systemConfigResult = vmSys.GetSystemConfig();

                if (mode == ScreenMode.Add)
                {
                    if (wpaResult == null)
                    {
                        wpaResult                     = new RPT002_WorkPlaceAirDTO();
                        wpaResult.IS_WA               = true;
                        wpaResult.IS_AWA              = false;
                        wpaResult.REPORT_DATE         = DateTime.Now;
                        wpaResult.CRT_DATE            = DateTime.Now;
                        wpaResult.REGISTRATION_ID     = systemConfigResult.DEFAULT_REPORT_WPA_REGISTRATION_ID;
                        wpaResult.REGISTRATION_NAME   = systemConfigResult.DEFAULT_REPORT_WPA_REGISTRATION_NAME;
                        wpaResult.LAB_SUPERVISOR_ID   = systemConfigResult.DEFAULT_REPORT_WPA_LAB_SUPERVISOR_ID;
                        wpaResult.LAB_SUPERVISOR_NAME = systemConfigResult.DEFAULT_REPORT_WPA_LAB_SUPERVISOR_NAME;
                        wpaResult.AGENT_FLAG          = true;
                        wpaResult.SHOW_LV3_EACH_PAGE  = true;
                        wpaResult.SHOW_LV3_CONT       = true;
                        wpaResult.SHOW_LV2_CONT       = false;
                        this.ToolBarSwitch            = "2122222222";
                    }
                    else
                    {
                        wpaResult.ID                  = 0;
                        wpaResult.IS_WA               = true;
                        wpaResult.IS_AWA              = false;
                        wpaResult.ANALYSYS_NO         = null;
                        wpaResult.JOB_NO              = null;
                        wpaResult.CRT_ID              = null;
                        wpaResult.CRT_DATE            = DateTime.Now;
                        wpaResult.CRT_MACHINE         = null;
                        wpaResult.CRT_NAME            = null;
                        wpaResult.UPD_ID              = null;
                        wpaResult.UPD_DATE            = null;
                        wpaResult.UPD_MACHINE         = null;
                        wpaResult.UPD_NAME            = null;
                        wpaResult.DEL_ID              = null;
                        wpaResult.DEL_DATE            = null;
                        wpaResult.DEL_MACHINE         = null;
                        wpaResult.DEL_NAME            = null;
                        wpaResult.REGISTRATION_ID     = systemConfigResult.DEFAULT_REPORT_WPA_REGISTRATION_ID;
                        wpaResult.REGISTRATION_NAME   = systemConfigResult.DEFAULT_REPORT_WPA_REGISTRATION_NAME;
                        wpaResult.LAB_SUPERVISOR_ID   = systemConfigResult.DEFAULT_REPORT_WPA_LAB_SUPERVISOR_ID;
                        wpaResult.LAB_SUPERVISOR_NAME = systemConfigResult.DEFAULT_REPORT_WPA_LAB_SUPERVISOR_NAME;
                        wpaResult.AGENT_FLAG          = true;
                        wpaResult.AGENT_NAME          = null;
                        wpaResult.SHOW_LV3_EACH_PAGE  = true;
                        wpaResult.SHOW_LV3_CONT       = true;
                        wpaResult.SHOW_LV2_CONT       = false;
                        this.ToolBarSwitch            = "2122222222";
                    }
                }
                else if (wpaResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122112102";
                }
                else
                {
                    this.ToolBarSwitch = "2022002012";
                }


                CtrlUtil.EnableControls(!wpaResult.Is_Canceled, txtCustomer, txtCustomerAddr, txtProject, txtProjectAddr, dtReceivedDate, dtAnalyticalDate, dtAnalyticalDateTo, chkShowLv3EachPage, chkShowLv3Cont, chkShowLv2Cont);

                CtrlUtil.EnableControls(OISDataInfo.UserInfomation.GROUP_ID == 3 && !wpaResult.Is_Canceled, txtRegistration, txtLabSupervisor);

                this.SetDataToControl();
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }