Esempio n. 1
0
 private void PackageItembindingSource1_CurrentChanged(object sender, EventArgs e)
 {
     lbmsgalert.Text = "";
     if (dbc.GetChangeSet().Updates.Count > 0 ||
         dbc.GetChangeSet().Inserts.Count > 0)
     {
         if (MessageBox.Show("Do you want save change data.", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             SaveData();
         }
         else
         {
             btnClaear_cancel_Click(null, null);
             return;
         }
     }
     Clearbutton();
 }
Esempio n. 2
0
 private void btnPrevious_Click(object sender, EventArgs e)
 {
     lbAlertMsg.Text = "";
     panelSummary.Focus();
     if (dbc.GetChangeSet().Updates.Count > 0)
     {
         if (MessageBox.Show("Do you want save change data?", "Confirm Save Data", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             PatientAssHdrbindingSource1.EndEdit();
             dbc.SubmitChanges();
         }
         else
         {
             PatientAssHdrbindingSource1.CancelEdit();
             dbc = null;
             dbc = new InhCheckupDataContext();
             PatientAssHdrbindingSource1.DataSource = (from t1 in dbc.trn_patient_ass_hdrs
                                                       where t1.trn_patient_ass_grp.tpr_id == ptpr_id
                                                       select t1);
         }
     }
     PatientAssHdrbindingSource1.MovePrevious();
 }
Esempio n. 3
0
        private void PatientbindingSource1_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                if (dbc.GetChangeSet().Updates.Count > 0)
                {
                    if (MessageBox.Show("คุณต้องการบันทึกการเปลี่ยนแปลงข้อมูลหรือไม่", "Confirm Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        dbc.SubmitChanges();
                    }
                    else
                    {
                        PatientbindingSource1.CancelEdit();
                    }
                }
            }
            catch (Exception ex)
            {
                Program.MessageError(ex.Message);
            }
            // Gender
            trn_patient currentpt = (trn_patient)PatientbindingSource1.Current;

            if (currentpt != null)
            {
                Program.SetValueRadioGroup(GBGender, currentpt.tpt_gender);
                Program.SetValueRadioGroup(pnlMarried, currentpt.tpt_married);
            }

            //Patient Type
            trn_patient_regi currentRegis = (trn_patient_regi)trnpatientregisBindingSource.Current;

            if (currentRegis != null)
            {
                Program.SetValueRadioGroup(GBPatientType, currentRegis.tpr_patient_type);
            }
        }
Esempio n. 4
0
 //-------bindingSource
 private void RoomHDRbindingSource1_CurrentChanged1(object sender, EventArgs e)
 {
     lbmsgAlert.Text = "";
     if (dbc.GetChangeSet().Updates.Count > 0 ||
         dbc.GetChangeSet().Inserts.Count > 0)
     {
         if (MessageBox.Show("Do you want save change data.", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             btnSaveStationRoom_Click(null, null);
         }
         else
         {
             dbc.Dispose();
             dbc = new InhCheckupDataContext();
             Loaddata(0);
             return;
         }
     }
 }
Esempio n. 5
0
 private void ConfigHeader_bindingSource1_CurrentChanged(object sender, EventArgs e)
 {
     lbMsgAlertTab1.Text = "";
     if (dbc.GetChangeSet().Updates.Count > 0 ||
         dbc.GetChangeSet().Inserts.Count > 0)
     {
         if (MessageBox.Show("Do you want save change data.", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             btnTab1Save_Click(null, null);
         }
         else
         {
             CancelAllTab();
             return;
         }
     }
 }
Esempio n. 6
0
        private void mstUserTypebindingSource1_CurrentChanged(object sender, EventArgs e)
        {
            lbmsgalert.Text = "";

            //char? admintype = Program.GetValueRadioTochar(pnlAdminType);
            //if(admintype==
            if (dbc.GetChangeSet().Updates.Count > 0 ||
                dbc.GetChangeSet().Inserts.Count > 0)
            {
                if (MessageBox.Show("Do you want save change data.", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    SaveData();
                }
                else
                {
                    btnClaear_cancel_Click(null, null);

                    return;
                }
            }

            mst_user_type currentmut = (mst_user_type)mstUserTypebindingSource1.Current;

            gvUserRoom.DataBindings.Clear();
            if (currentmut != null)
            {
                //start date
                if (currentmut.mut_effective_date != null)
                {
                    txtEffectDate.Value = Convert.ToDateTime(currentmut.mut_effective_date);
                }
                else
                {
                    txtEffectDate.Value = DateTime.Now;
                }
                //end date
                if (currentmut.mut_expire_date != null)
                {
                    rdoExpireDt.Checked   = true;
                    txtExpireDate.Enabled = true;
                    txtExpireDate.Value   = Convert.ToDateTime(currentmut.mut_expire_date);
                }
                else
                {
                    rdoNonExpire.Checked  = true;
                    txtExpireDate.Enabled = false;
                    txtExpireDate.Value   = DateTime.Now;
                }

                //status
                if (currentmut.mut_status == 'A')
                {
                    ChStatus.Checked = true;
                }
                else
                {
                    ChStatus.Checked = false;
                }
                //Gender
                Program.SetValueRadioGroup(pnlGender, currentmut.mut_gender);
                //mutType
                Program.SetValueRadioGroup(pnlmut_type, currentmut.mut_type);

                //Admin Type
                if (currentmut.mut_admin == true)
                {
                    pnlAdminType.Enabled = true;
                    Program.SetValueRadioGroup(pnlAdminType, currentmut.mut_admin_type);
                }
                else
                {
                    pnlAdminType.Enabled      = false;
                    RDAdmin_UserAdmin.Checked = true;
                    RDAdmin_UserAdmin.Checked = false;
                }
                //
                Clearbutton();

                LoadRoom(ddlMstSite.SelectedValue == null? 1 : (int)ddlMstSite.SelectedValue, currentmut.mut_id);
                LoadUserRoom(currentmut.mut_id);
            }
        }