Exemplo n.º 1
0
        private void SaveRegulation_Click(object sender, RoutedEventArgs e)
        {
            User currentUser = new User();

            currentUser = (User)Application.Current.Properties["UserInfo"];

            ChangeRegulation updateFee = new ChangeRegulation();

            updateFee.modified    = DateTime.Now;
            updateFee.id_function = Convert.ToInt32(txtFeeId.Text);
            updateFee.value_old   = Convert.ToInt32(txtFeeOld.Text);
            updateFee.value_apply = Convert.ToInt32(txtFeeExam.Text);
            updateFee.date_apply  = Convert.ToDateTime(dpApplyDate.SelectedDate);

            ChangeRegulation updateNumOfPatient = new ChangeRegulation();

            updateNumOfPatient.modified    = DateTime.Now;
            updateNumOfPatient.id_function = Convert.ToInt32(txtPatientId.Text);
            updateNumOfPatient.value_old   = Convert.ToInt32(txtPatientOld.Text);
            updateNumOfPatient.value_apply = Convert.ToInt32(txtNumOfPatient.Text);
            updateNumOfPatient.date_apply  = Convert.ToDateTime(dpApplyDate.SelectedDate);

            try
            {
                int id = DataManager.getInstance().updateRegulation(updateFee, updateNumOfPatient, currentUser.id);
                MessageBox.Show("Cập nhật thành công!");
                LoadRegulation();
            }
            catch
            {
                MessageBox.Show("Cập nhật thất bại!");
            }
        }
Exemplo n.º 2
0
        static public int updateRegulation(ChangeRegulation updateFee, ChangeRegulation updatePatient, int user_update)
        {
            int id = Active.update("UPDATE change_reg SET modifled_day = '" + updateFee.modified.ToString("yyyy-MM-dd HH:mm:ss") + "', value_old = '" + updateFee.value_old + "', value_new = '" + updateFee.value_apply + "', user_change = '" + user_update + "', date_apply = '" + updateFee.date_apply.ToString("yyyy-MM-dd HH:mm:ss") + "' where id_function = " + updateFee.id_function + "");

            id = Active.update("UPDATE change_reg SET modifled_day = '" + updatePatient.modified.ToString("yyyy-MM-dd HH:mm:ss") + "', value_old = '" + updatePatient.value_old + "', value_new = '" + updatePatient.value_apply + "', user_change = '" + user_update + "', date_apply = '" + updatePatient.date_apply.ToString("yyyy-MM-dd HH:mm:ss") + "' where id_function = " + updatePatient.id_function + "");
            return(id);
        }
Exemplo n.º 3
0
        static public List <ChangeRegulation> getAllRegulation()
        {
            DataTable dt = Active.select(" select * from change_reg ");
            List <ChangeRegulation> listRegulation = new List <ChangeRegulation>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ChangeRegulation reg = new ChangeRegulation();
                reg.id_function   = Convert.ToInt32(dt.Rows[i]["id_function"]);
                reg.name_function = dt.Rows[i]["name_function"].ToString();
                reg.value_old     = Convert.ToInt32(dt.Rows[i]["value_old"]);
                reg.date_apply    = Convert.ToDateTime(dt.Rows[i]["date_apply"]);
                reg.value_apply   = Convert.ToInt32(dt.Rows[i]["value_new"]);
                listRegulation.Add(reg);
            }
            return(listRegulation);
        }
Exemplo n.º 4
0
 public int updateRegulation(ChangeRegulation updateFee, ChangeRegulation updatePatient, int user_change)
 {
     return(DataHelper.updateRegulation(updateFee, updatePatient, user_change));
 }