Esempio n. 1
0
        public void tiaoban_application(string user_name, DateTimePicker dateTimePicker2, DateTimePicker dateTimePicker4, ComboBox comboBox3, TextBox textBox1)
        {
            int arrangementId_self, arrangementId_others;

            Barrangement  ba = new Barrangement();
            Bchangerecord bc = new Bchangerecord();

            DTO4Arrangement dto4a_self = new DTO4Arrangement();

            dto4a_self         = ba.QueryArrangementIdByDoctorNameAndBeginTime(user_name, dateTimePicker2.Value.Date);
            arrangementId_self = int.Parse(dto4a_self.Id);

            DTO4Arrangement dto4a_others = new DTO4Arrangement();

            dto4a_others         = ba.QueryArrangementIdByDoctorNameAndBeginTime(comboBox3.SelectedValue.ToString(), dateTimePicker4.Value.Date);
            arrangementId_others = int.Parse(dto4a_others.Id);

            if (bc.InsertChangeRecord(arrangementId_self, arrangementId_others, textBox1.Text, "untreated"))
            {
                MessageBox.Show("申请成功!");
            }
            else
            {
                MessageBox.Show("申请失败,请确认是否正确选择班次!");
            }
        }
Esempio n. 2
0
        public void UpdateArrangement(DataGridView dataGridView1, ComboBox comboBox1, ComboBox comboBox2)
        {
            string begin, end;

            if (dataGridView1.CurrentCell.RowIndex < 10)
            {
                begin = " 00:00:00";
                end   = " 12:00:00";
            }
            else
            {
                begin = " 12:00:00";
                end   = " 23:59:59";
            }

            DateTime bT = DateTime.Parse(dataGridView1.Rows[0].Cells[dataGridView1.CurrentCell.ColumnIndex].Value.ToString() + begin);
            DateTime fT = DateTime.Parse(dataGridView1.Rows[0].Cells[dataGridView1.CurrentCell.ColumnIndex].Value.ToString() + end);

            Barrangement Ba            = new Barrangement();
            string       arrangementId = Ba.QueryArrangementIdByDoctorNameAndBeginTime(dataGridView1.CurrentCell.Value.ToString(), bT).Id;

            Bdoctorinfo    Bd = new Bdoctorinfo();
            DTO4DoctorInfo updatedoctorinfo = new DTO4DoctorInfo();

            updatedoctorinfo = Bd.QuaryDoctorinfoByNameAndOffice(comboBox2.SelectedValue.ToString(), comboBox1.SelectedValue.ToString());
            try
            {
                Ba.UpdateById(arrangementId, bT, fT, updatedoctorinfo.Id, updatedoctorinfo.Office, updatedoctorinfo.Name, updatedoctorinfo.JobTitle);
                dataGridView1.CurrentCell.Value = comboBox2.SelectedValue.ToString();//立即显示修改
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
        public void DelectArrangement(DataGridView dataGridView1)
        {
            string begin;

            if (dataGridView1.CurrentCell.RowIndex < 10)
            {
                begin = " 00:00:00";
            }
            else
            {
                begin = " 12:00:00";
            }

            DateTime     bT            = DateTime.Parse(dataGridView1.Rows[0].Cells[dataGridView1.CurrentCell.ColumnIndex].Value.ToString() + begin);
            Barrangement Ba            = new Barrangement();
            string       arrangementId = Ba.QueryArrangementIdByDoctorNameAndBeginTime(dataGridView1.CurrentCell.Value.ToString(), bT).Id;

            try
            {
                Ba.DelById(arrangementId);
                dataGridView1.CurrentCell.Value = null;//立即显示修改
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
        public void Execution(CheckBox checkBox4, CheckBox checkBox3, DataGridView dataGridView1, TextBox textBox1, string[] Ids, int z)//执行申请管理操作
        {
            string        operate;
            Bchangerecord bc = new Bchangerecord();

            if (checkBox4.Checked)
            {
                if (z == 0)       //自动执行调班处理;
                {
                    Barrangement    ba = new Barrangement();
                    DTO4Arrangement self_arrangement = new DTO4Arrangement();
                    DTO4Arrangement others_arrangement = new DTO4Arrangement();
                    DateTime        begin_time, finish_time;
                    self_arrangement   = ba.QueryArrangementIdByDoctorNameAndBeginTime(dataGridView1.CurrentRow.Cells[0].Value.ToString(), DateTime.Parse(dataGridView1.CurrentRow.Cells[2].Value.ToString()));
                    others_arrangement = ba.QueryArrangementIdByDoctorNameAndBeginTime(dataGridView1.CurrentRow.Cells[1].Value.ToString(), DateTime.Parse(dataGridView1.CurrentRow.Cells[3].Value.ToString()));
                    begin_time         = self_arrangement.BeginTime;
                    finish_time        = self_arrangement.FinishTime;
                    ba.UpdateById(self_arrangement.Id, others_arrangement.BeginTime, others_arrangement.FinishTime, self_arrangement.DoctorId, self_arrangement.Office, self_arrangement.DoctorName, self_arrangement.DoctorJobTitle);
                    ba.UpdateById(others_arrangement.Id, begin_time, finish_time, others_arrangement.DoctorId, others_arrangement.Office, others_arrangement.DoctorName, others_arrangement.DoctorJobTitle);
                    MessageBox.Show("已成功将" + self_arrangement.DoctorName + "与" + others_arrangement.DoctorName + "的班次对调!");
                }
                operate = "approve";
                bc.UpdateChangeRecordById(Ids[dataGridView1.CurrentCell.RowIndex], "processed", textBox1.Text, operate);
                MessageBox.Show("处理成功!");
            }
            else if (checkBox3.Checked)
            {
                operate = "disapprove";
                bc.UpdateChangeRecordById(Ids[dataGridView1.CurrentCell.RowIndex], "processed", textBox1.Text, operate);
                MessageBox.Show("处理成功!");
            }
            else
            {
                MessageBox.Show("请先选择处理结果:批准/不批准");
            }
        }
Esempio n. 5
0
        public void qingjia_application(string user_name, DateTimePicker dateTimePicker3, TextBox textBox2)
        {
            int arrangementId_self;

            Barrangement  ba = new Barrangement();
            Bchangerecord bc = new Bchangerecord();

            DTO4Arrangement dto4a_self = new DTO4Arrangement();

            dto4a_self         = ba.QueryArrangementIdByDoctorNameAndBeginTime(user_name, dateTimePicker3.Value.Date);
            arrangementId_self = int.Parse(dto4a_self.Id);

            if (bc.InsertChangeRecord(arrangementId_self, 0, textBox2.Text, "untreated"))
            {
                MessageBox.Show("申请成功!");
            }
            else
            {
                MessageBox.Show("申请失败,请确认是否正确选择班次!");
            }
        }