Beispiel #1
0
        private void btnAddAndSet_Click(object sender, EventArgs e)
        {
            //CommonClass.typeMenu = "Add";

            //frm004_system_setting_specific_power  frm_add = new frm004_system_setting_specific_power();
            //frm_add.ShowDialog();
            //getDetailProcess();
            //frm_add.Close();

            if (txtProcessSelected.Text == "XXX")
            {
                CommonClassLibraryGlobal.showError("กรุณาเลือกโปรเซสที่ต้องการ");
                return;
            }

            Button senderBtn = (Button)sender;

            if (senderBtn.Text == "Set")
            {
                senderBtn.Text                    = "Add";
                btnClearPowerAll.Visible          = true;
                dataGridView1.ReadOnly            = false;
                dataGridView1.Columns[0].ReadOnly = true;
            }
            else
            {
                dataGridView1.Rows.Add(dataGridView1.Rows.Count + 1, "", "", "", "", "Delete");
            }
        }
Beispiel #2
0
        private bool _getTargetPower(CvSystemSpecificPurchasePowerOutputProperty dataItem)
        {
            bool result = true;

            try
            {
                TARGET_POWER.Text     = "";
                MAX_VOLTAGE_STEP.Text = "";

                dataGridView1.Rows.Clear();

                List <CvSystemSpecificPurchasePowerOutputProperty> list = _cvSystemSpecificPurchasePowerOutputController.SearchBySystemIdAndPurchaseIdAndProcessId(dataItem);

                foreach (CvSystemSpecificPurchasePowerOutputProperty systemSpecificConfigPower in list)
                {
                    TARGET_POWER.Text     = systemSpecificConfigPower.TARGET_POWER.ToString();
                    MAX_VOLTAGE_STEP.Text = systemSpecificConfigPower.MAX_VOLTAGE_STEP.ToString();
                    break;
                }

                foreach (CvSystemSpecificPurchasePowerOutputProperty systemSpecificConfigPower in list)
                {
                    dataGridView1.Rows.Add(systemSpecificConfigPower.NO, systemSpecificConfigPower.POWER_PERCENT_FROM, systemSpecificConfigPower.POWER_PERCENT_TO, systemSpecificConfigPower.VOLTAGE_STEP, systemSpecificConfigPower.WAIT_TIME, "Delete");
                }
            }
            catch (Exception ex)
            {
                CommonClassLibraryGlobal.showError(ex.Message);
                result = false;
            }

            return(result);
        }
Beispiel #3
0
        private bool _getInitialVoltage(CvSystemSpecificPurchaseProperty dataItem)
        {
            bool result = true;

            try
            {
                dataGridView1.Rows.Clear();

                CvSystemSpecificPurchaseProperty CvSystemSpecificProcessProperty = _cvSystemSpecificPurchaseController.SearchBySystemIdAndPurchaseId(dataItem);

                if (CvSystemSpecificProcessProperty != null)
                {
                    INITIAL_VOLTAGE_OF_INPUT.Text        = CvSystemSpecificProcessProperty.INITIAL_VOLTAGE_OF_INPUT;
                    INITIAL_VOLTAGE_OF_OUTPUT.Text       = CvSystemSpecificProcessProperty.INITIAL_VOLTAGE_OF_OUTPUT;
                    OUTPUT_TEMPERATURE_TARGET_POWER.Text = CvSystemSpecificProcessProperty.OUTPUT_TEMPERATURE_TARGET_POWER;
                }
                else
                {
                    INITIAL_VOLTAGE_OF_INPUT.Text        = "";
                    INITIAL_VOLTAGE_OF_OUTPUT.Text       = "";
                    OUTPUT_TEMPERATURE_TARGET_POWER.Text = "";
                }
            }
            catch (Exception ex)
            {
                CommonClassLibraryGlobal.showError(ex.Message);
                result = false;
            }

            return(result);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageBoxButtons buttons      = MessageBoxButtons.YesNo;
            DialogResult      resultDialog = MessageBox.Show("ยืนยันการบันทึกข้อมูล ?", "message", buttons, MessageBoxIcon.Warning);

            if (resultDialog == DialogResult.No)
            {
                return;
            }


            CvSystemCommonProperty data = new CvSystemCommonProperty();

            data.IP_ADDRESS   = CommonClassLibraryGlobal.IP;
            data.NAME_ADDRESS = CommonClassLibraryGlobal.HOST_NAME;
            data.SYSTEM_ID    = frmSystem.SYSTEM_ID;
            data.USER_CREATE  = CommonClassLibraryGlobal.OPERATOR_ID;
            data.USER_UPDATE  = CommonClassLibraryGlobal.OPERATOR_ID;

            foreach (Control toolBox in this.Controls)
            {
                if (toolBox is SettingSpec_Text_Value_Without_Panel)
                {
                    SettingSpec_Text_Value_Without_Panel tool = (SettingSpec_Text_Value_Without_Panel)toolBox;

                    if (!SettingSpec_Text_Value_Without_Panel.checkData(tool))
                    {
                        return;
                    }
                    else
                    {
                        PropertyInfo prop = null;

                        prop = data.GetType().GetProperty(toolBox.Name, BindingFlags.Public | BindingFlags.Instance);
                        if (null != prop && prop.CanWrite)
                        {
                            prop.SetValue(data, tool.TextBoxValue);
                        }
                        else
                        {
                            CommonClassLibraryGlobal.showError("ไม่สามารถเก็บค่าตัวแปรได้ '" + toolBox.Name + "' กรุณาติดต่อโปรแกรมเมอร์");
                            return;
                        }
                    }
                }
            }

            if (_cvSystemCommonController.Insert(data))
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลสำเร็จ");
                return;
            }
            else
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลไม่สำเร็จ กรุณาลองใหม่อีกครั้ง");
                return;
            }
        }
Beispiel #5
0
        private void btnClearPowerAll_Click(object sender, EventArgs e)
        {
            if (txtProcessSelected.Text == "XXX")
            {
                CommonClassLibraryGlobal.showError("กรุณาเลือกโปรเซสที่ต้องการ");
                return;
            }

            dataGridView1.Rows.Clear();
        }
Beispiel #6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            this.Text           = Properties.Settings.Default.PROGRAM_NAME + " " + Properties.Settings.Default.PROGRAM_VERSION;
            lblProgramName.Text = Properties.Settings.Default.PROGRAM_NAME + " " + Properties.Settings.Default.PROGRAM_VERSION;
            lblFooter.Text      = Properties.Settings.Default.PROGRAM_NAME + " " + Properties.Settings.Default.PROGRAM_VERSION + " © 2020 Furukawa Fitel(Thailand) All rights reserved";


            MaximizeBox = false;
            CommonClassLibraryGlobal.HOST_NAME = CommonClassLibraryGlobal.GetLocalHostName();
            CommonClassLibraryGlobal.IP        = CommonClassLibraryGlobal.GetLocalIPAddress();
            txtSerialNumber.Select();
        }
 private void txtUserID_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (String.IsNullOrWhiteSpace(txtUserID.Text))
         {
             CommonClassLibraryGlobal.showError("กรุณากรอก UserID");
             txtUserID.Focus();
             return;
         }
         txtPassword.Focus();
     }
 }
        private void _getDetail()
        {
            List <CvSystemCommonProperty> listItem = _cvSystemCommonController.SearchBySystemId(new CvSystemCommonProperty {
                SYSTEM_ID = frmSystem.SYSTEM_ID
            });

            if (listItem.Count > 1)
            {
                CommonClassLibraryGlobal.showError("Spec มีมากกว่า 1 แถว กรุณาติดต่อโปรแกรมเมอร์");
                this.Dispose();
            }
            else if (listItem.Count == 1)
            {
                setOldValue(listItem[0]);
            }
        }
        private bool _checkData()
        {
            if (String.IsNullOrWhiteSpace(system_name.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก System Name");
                system_name.Focus();
                return(false);
            }


            if (String.IsNullOrWhiteSpace(ip_address_system.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก ip address system");
                ip_address_system.Focus();
                return(false);
            }

            return(true);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (_checkData() == true)
            {
                CvSystemProperty dataItem = new CvSystemProperty
                {
                    SYSTEM_NAME       = system_name.Text,
                    IP_ADDRESS_SYSTEM = ip_address_system.Text,
                    DESCRIPTION       = description.Text,
                    IP_ADDRESS        = CommonClassLibraryGlobal.IP,
                    NAME_ADDRESS      = CommonClassLibraryGlobal.HOST_NAME,
                    CREATE_USER       = CommonClassLibraryGlobal.OPERATOR_ID,
                };

                DialogResult res = MessageBox.Show("ยืนยันการบันทึกข้อมูล ?", "การยืนยัน", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (res == DialogResult.Cancel)
                {
                    return;
                }

                CvSystemProperty dataItemCheck = new CvSystemProperty();
                dataItemCheck = CvSystemController.SearchByIpAddressSystem(dataItem);
                if (dataItemCheck != null)
                {
                    CommonClassLibraryGlobal.showSuccess("ip address system นี้มีข้อมูลอยู่แล้ว");
                    _clearData();
                    return;
                }

                if (CvSystemController.Insert(dataItem))
                {
                    CommonClassLibraryGlobal.showSuccess("เพิ่มข้อมูลสำเร็จ");
                    this.Close();
                    return;
                }
                else
                {
                    CommonClassLibraryGlobal.showSuccess("เพิ่มไม่ข้อมูลสำเร็จ กรุณาลองใหม่อีกครั้ง");
                    return;
                }
            }
        }
Beispiel #11
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView senderGrid = (DataGridView)sender;

            if ((senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn) && (e.RowIndex >= 0))
            {
                switch (e.ColumnIndex)
                {
                case 5:

                    if (btnSet_Add.Text == "Set")
                    {
                        CommonClassLibraryGlobal.showError("กรุณากดปุ่ม Set ก่อนที่จะดำเนินการลบข้อมูล");
                    }
                    else
                    {
                        MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                        DialogResult      result  = MessageBox.Show("Are your sure ?", "Message", buttons, MessageBoxIcon.Warning);

                        if (result == DialogResult.No)
                        {
                            return;
                        }
                        else
                        {
                            dataGridView1.Rows.RemoveAt(e.RowIndex);
                            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                            {
                                dataGridView1.Rows[i].Cells[0].Value = i + 1;
                            }
                        }
                    }
                    break;
                }
            }
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtUserID.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก UserID");
                txtUserID.Focus();
                return;
            }

            if (String.IsNullOrWhiteSpace(txtPassword.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Password");
                txtPassword.Focus();
                return;
            }

            if (txtUserID.Text.Substring(0, 1) != "S")
            {
                CommonClassLibraryGlobal.showError("UserID นี้ไม่สามารถแก้ไขข้อมูลได้");
                txtPassword.Text = "";
                txtUserID.Text   = "";
                txtUserID.Focus();
                return;
            }


            EmployeeProperty employeeProperty = new EmployeeProperty();

            employeeProperty.EmpCode = txtUserID.Text;

            employeeProperty = employeeController.SearchOne(employeeProperty);

            if (employeeProperty == null)
            {
                CommonClassLibraryGlobal.showError("ไม่พบข้อมูล UserID");
                txtPassword.Text = "";
                txtUserID.Text   = "";
                txtUserID.Focus();
                return;
            }

            if (txtPassword.Text != "FL12345")
            {
                CommonClassLibraryGlobal.showError("UserID / Password ไม่ถูกต้อง");
                txtPassword.Text = "";
                txtUserID.Text   = "";
                txtUserID.Focus();
                return;
            }

            CommonClassLibraryGlobal.OPERATOR_ID = txtUserID.Text;

            switch (CommonClassLibraryGlobal.Login_TYPE_FORM)
            {
            case "Product Spec":

                frmProductSpecSetting frmProduct = new frmProductSpecSetting();
                frmProduct.ShowDialog();
                this.Dispose();
                frmProduct.Close();

                break;

            case "System Spec":

                frmSystem frmSystem = new frmSystem();
                frmSystem.ShowDialog();
                this.Dispose();
                frmSystem.Close();

                break;
            }
        }
Beispiel #13
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(KIKUSUI_USB_NAME.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก kikusui usb name");
                KIKUSUI_USB_NAME.Focus();
                return;
            }


            if (String.IsNullOrWhiteSpace(KIKUSUI_ADDRESS.Text))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก kikusui address");
                KIKUSUI_ADDRESS.Focus();
                return;
            }

            if (!double.TryParse(KIKUSUI_MAX_CURRENT.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก kikusui max current เป็นตัวเลขเท่านั้น");
                KIKUSUI_MAX_CURRENT.Text = "";
                KIKUSUI_MAX_CURRENT.Focus();
                return;
            }


            if (!double.TryParse(KIKUSUI_MAX_VOLTAGE.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก kikusui max voltage เป็นตัวเลขเท่านั้น");
                KIKUSUI_MAX_VOLTAGE.Text = "";
                KIKUSUI_MAX_VOLTAGE.Focus();
                return;
            }

            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult      result  = MessageBox.Show("คุณต้องการบันทึกข้อมูล ?", "Message", buttons, MessageBoxIcon.Warning);

            if (result == DialogResult.No)
            {
                return;
            }

            CvSystemSpecificProperty itemData = new CvSystemSpecificProperty
            {
                SYSTEM_ID           = frmSystem.SYSTEM_ID,
                PURCHASE_ID         = frmSystemSpecificPurchase.PURCHASE_ID,
                KIKUSUI_USB_NAME    = KIKUSUI_USB_NAME.Text,
                KIKUSUI_ADDRESS     = KIKUSUI_ADDRESS.Text,
                KIKUSUI_MAX_CURRENT = KIKUSUI_MAX_CURRENT.Text,
                KIKUSUI_MAX_VOLTAGE = KIKUSUI_MAX_VOLTAGE.Text,
                IP_ADDRESS          = CommonClassLibraryGlobal.IP,
                NAME_ADDRESS        = CommonClassLibraryGlobal.HOST_NAME,
                USER_CREATE         = CommonClassLibraryGlobal.OPERATOR_ID,
                USER_UPDATE         = CommonClassLibraryGlobal.OPERATOR_ID,
            };

            if (_cvSystemSpecificController.InsertAndUpdateInuse(itemData) == true)
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลสำเร็จ");
            }
            else
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลไม่สำเร็จ กรุณาลองใหม่อีกครั้ง");
            }
        }
Beispiel #14
0
        private void btnSavePower_Click(object sender, EventArgs e)
        {
            if (txtProcessSelected.Text == "XXX")
            {
                CommonClassLibraryGlobal.showError("กรุณาเลือกโปรเซสที่ต้องการ");
                return;
            }

            //-------------------------- ตรวจสอบข้อมูล ------------------------------------------

            if (!double.TryParse(TARGET_POWER.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Target Power เป็นตัวเลขเท่านั้น");
                TARGET_POWER.Text = "";
                TARGET_POWER.Focus();
                return;
            }

            if (!double.TryParse(MAX_VOLTAGE_STEP.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Max Voltage Step เป็นตัวเลขเท่านั้น");
                MAX_VOLTAGE_STEP.Text = "";
                MAX_VOLTAGE_STEP.Focus();
                return;
            }

            if (double.Parse(MAX_VOLTAGE_STEP.Text) <= 0)
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Max Voltage Step ให้มากกว่า 0 ");
                return;
            }

            int percent = 0;

            for (int rows = 0; rows < dataGridView1.Rows.Count; rows++)
            {
                if (!int.TryParse(dataGridView1.Rows[rows].Cells[1].Value.ToString(), out CommonClassLibraryGlobal.chkInt))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Power From (%) เป็นตัวเลขจำนวนเต็มเท่านั้น ");
                    return;
                }

                if (!int.TryParse(dataGridView1.Rows[rows].Cells[2].Value.ToString(), out CommonClassLibraryGlobal.chkInt))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Power To (%) เป็นตัวเลขจำนวนเต็มเท่านั้น ");
                    return;
                }

                if (int.Parse(dataGridView1.Rows[rows].Cells[1].Value.ToString()) > int.Parse(dataGridView1.Rows[rows].Cells[2].Value.ToString()))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Power From (%) ให้น้อยกว่า Power To (%) ");
                    return;
                }

                if (!double.TryParse(dataGridView1.Rows[rows].Cells[3].Value.ToString(), out CommonClassLibraryGlobal.chkDouble))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Voltage Step (V) เป็นตัวเลขเท่านั้น ");
                    return;
                }

                if (double.Parse(dataGridView1.Rows[rows].Cells[3].Value.ToString()) <= 0)
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Voltage Step (V) ให้มากกว่า 0 ");
                    return;
                }

                if (double.Parse(dataGridView1.Rows[rows].Cells[3].Value.ToString()) > double.Parse(MAX_VOLTAGE_STEP.Text))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Voltage Step (V) ให้น้อยกว่าหรือเท่ากับ Max Voltage Step");
                    return;
                }

                if (!double.TryParse(dataGridView1.Rows[rows].Cells[4].Value.ToString(), out CommonClassLibraryGlobal.chkDouble))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Wait Time (S) เป็นตัวเลขเท่านั้น ");
                    return;
                }
            }

            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                if (int.Parse(dataGridView1.Rows[i].Cells[1].Value.ToString()) != percent)
                {
                    CommonClassLibraryGlobal.showError("ไม่พบ Power (%) ที่ " + percent + " ของ No." + (i + 1));
                    return;
                }

                percent = int.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString()) + 1;
            }

            if (percent - 1 != 100)
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Power To (%) ให้ครบ 100% ");
                return;
            }

            //-------------------------- End of ตรวจสอบข้อมูล ------------------------------------------

            MessageBoxButtons buttons      = MessageBoxButtons.YesNo;
            DialogResult      dialogResult = MessageBox.Show("ต้องการบันทึกข้อมูล ?", "Message", buttons, MessageBoxIcon.Warning);

            if (dialogResult == DialogResult.No)
            {
                return;
            }

            List <CvSystemSpecificPurchasePowerOutputProperty> listItem = new List <CvSystemSpecificPurchasePowerOutputProperty>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                CvSystemSpecificPurchasePowerOutputProperty dataItem = new CvSystemSpecificPurchasePowerOutputProperty()
                {
                    SYSTEM_ID          = frmSystem.SYSTEM_ID,
                    PURCHASE_ID        = frmSystemSpecificPurchase.PURCHASE_ID,
                    PROCESS_NAME       = txtProcessSelected.Text,
                    NO                 = row.Cells[0].Value.ToString(),
                    TARGET_POWER       = TARGET_POWER.Text,
                    POWER_PERCENT_FROM = row.Cells[1].Value.ToString(),
                    POWER_PERCENT_TO   = row.Cells[2].Value.ToString(),
                    MAX_VOLTAGE_STEP   = MAX_VOLTAGE_STEP.Text,
                    VOLTAGE_STEP       = row.Cells[3].Value.ToString(),
                    WAIT_TIME          = row.Cells[4].Value.ToString(),
                    IP_ADDRESS         = CommonClassLibraryGlobal.IP,
                    NAME_ADDRESS       = CommonClassLibraryGlobal.HOST_NAME,
                    USER_CREATE        = CommonClassLibraryGlobal.OPERATOR_ID,
                    USER_UPDATE        = CommonClassLibraryGlobal.OPERATOR_ID,
                };

                listItem.Add(dataItem);
            }

            if (_cvSystemSpecificPurchasePowerOutputController.InsertAndUpdateInuse(listItem) == true)
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลสำเร็จ");
                return;
            }
            else
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลไม่สำเร็จ กรุณาลองใหม่อีกครั้ง");
                return;
            }
        }
Beispiel #15
0
        private void btnSaveInitialVoltage_Click(object sender, EventArgs e)
        {
            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult      result  = MessageBox.Show("คุณต้องการบันทึกข้อมูล ?", "Message", buttons, MessageBoxIcon.Warning);

            if (result == DialogResult.No)
            {
                return;
            }

            if (txtProcessSelected.Text == "XXX")
            {
                CommonClassLibraryGlobal.showError("กรุณาเลือกโปรเซสที่ต้องการ");
                return;
            }

            if (!double.TryParse(INITIAL_VOLTAGE_OF_INPUT.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Initial Voltage Of Input power control เป็นตัวเลขเท่านั้น");
                INITIAL_VOLTAGE_OF_INPUT.Text = "";
                INITIAL_VOLTAGE_OF_INPUT.Focus();
                return;
            }

            if (double.Parse(INITIAL_VOLTAGE_OF_INPUT.Text) > Properties.Settings.Default.MAX_VOLTAGE || double.Parse(INITIAL_VOLTAGE_OF_INPUT.Text) < Properties.Settings.Default.MIN_VOLTAGE)
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Initial Voltage Of Input power control ให้อยู่ระหว่าง " + Properties.Settings.Default.MIN_VOLTAGE + " ถึง " + Properties.Settings.Default.MAX_VOLTAGE);
                INITIAL_VOLTAGE_OF_INPUT.Text = "";
                INITIAL_VOLTAGE_OF_INPUT.Focus();
                return;
            }

            if (!double.TryParse(INITIAL_VOLTAGE_OF_OUTPUT.Text, out CommonClassLibraryGlobal.chkDouble))
            {
                CommonClassLibraryGlobal.showError("กรุณากรอก Initial Voltage Of Output power control เป็นตัวเลขเท่านั้น");
                INITIAL_VOLTAGE_OF_OUTPUT.Text = "";
                INITIAL_VOLTAGE_OF_OUTPUT.Focus();
                return;
            }

            //if (double.Parse(INITIAL_VOLTAGE_OF_OUTPUT.Text) > Properties.Settings.Default.MAX_VOLTAGE || double.Parse(INITIAL_VOLTAGE_OF_OUTPUT.Text) < Properties.Settings.Default.MIN_VOLTAGE)
            //{
            //    CommonClassLibraryGlobal.showError("กรุณากรอก Initial Voltage Of Output power control ให้อยู่ระหว่าง " + Properties.Settings.Default.MIN_VOLTAGE + " ถึง " + Properties.Settings.Default.MAX_VOLTAGE);
            //    INITIAL_VOLTAGE_OF_OUTPUT.Text = "";
            //    INITIAL_VOLTAGE_OF_OUTPUT.Focus();
            //    return;

            //}

            if (!string.IsNullOrWhiteSpace(OUTPUT_TEMPERATURE_TARGET_POWER.Text))
            {
                if (!double.TryParse(OUTPUT_TEMPERATURE_TARGET_POWER.Text, out CommonClassLibraryGlobal.chkDouble))
                {
                    CommonClassLibraryGlobal.showError("กรุณากรอก Target Power Of Output Temperature เป็นตัวเลขเท่านั้น");
                    OUTPUT_TEMPERATURE_TARGET_POWER.Text = "";
                    OUTPUT_TEMPERATURE_TARGET_POWER.Focus();
                    return;
                }
            }



            CvSystemSpecificPurchaseProperty dataItem = new CvSystemSpecificPurchaseProperty()
            {
                SYSTEM_ID                       = frmSystem.SYSTEM_ID,
                PURCHASE_ID                     = frmSystemSpecificPurchase.PURCHASE_ID,
                PROCESS_NAME                    = txtProcessSelected.Text,
                INITIAL_VOLTAGE_OF_INPUT        = INITIAL_VOLTAGE_OF_INPUT.Text,
                INITIAL_VOLTAGE_OF_OUTPUT       = INITIAL_VOLTAGE_OF_OUTPUT.Text,
                OUTPUT_TEMPERATURE_TARGET_POWER = OUTPUT_TEMPERATURE_TARGET_POWER.Text,
                IP_ADDRESS                      = CommonClassLibraryGlobal.IP,
                NAME_ADDRESS                    = CommonClassLibraryGlobal.HOST_NAME,
                USER_CREATE                     = CommonClassLibraryGlobal.OPERATOR_ID,
                USER_UPDATE                     = CommonClassLibraryGlobal.OPERATOR_ID,
            };


            if (_cvSystemSpecificPurchaseController.InsertAndUpdateInuse(dataItem) == true)
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลสำเร็จ");
                return;
            }
            else
            {
                CommonClassLibraryGlobal.showSuccess("แก้ไขข้อมูลไม่สำเร็จ กรุณาลองใหม่อีกครั้ง");
                return;
            }
        }