Example #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (this.bds.Position >= 0)
            {
                DataRowView view = this.bds.List[this.bds.Position] as DataRowView;
                if (view != null)
                {
                    DataRow row = view.Row;
                    if (MessageBox.Show("确定删除:" + row["CustomerName"].ToString() + "?删除之后的信息将无法恢复!", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        archive_baseinfo.Delete(Convert.ToInt32(row["ID"].ToString()));

                        row.Delete();
                        row.Table.AcceptChanges();
                    }
                }
            }
        }
Example #2
0
        private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((this.bds.Position >= 0) && (e.RowIndex >= 0))
            {
                DataRowView view = (DataRowView)this.bds.List[this.bds.Position];

                if (((this.dgvData.Columns[e.ColumnIndex].HeaderText == "修改") && (this.bds.Position >= 0)) && (e.RowIndex >= 0))
                {
                    if (view != null)
                    {
                        DataRow row = view.Row;
                        new Controler(new MDIParentForm(view.Row["IDCardNo"].ToString()), new FocusQueryInfoFactory(Convert.ToInt32(row["ID"].ToString()), RecordsName)).IParentFrm.IShowDialog();
                        //this.GetDataView();
                    }
                }
                if (((this.dgvData.Columns[e.ColumnIndex].HeaderText == "删除") && (this.bds.Position >= 0)) && (e.RowIndex >= 0))
                {
                    if (view != null)
                    {
                        DataRow row = view.Row;
                        string  Sign = "", SignDoc = "";
                        if (MessageBox.Show("确定删除:" + row["CustomerName"].ToString() + "?删除之后的信息将无法恢复!", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                        {
                            ChronicDrugConditionBLL drugbll = new ChronicDrugConditionBLL();
                            switch (this.RecordsName)
                            {
                            case "老年人记录":
                                OlderMedicineResultBLL oldMedicineResultbll = new OlderMedicineResultBLL();
                                oldMedicineResultbll.DelOUTkey(Convert.ToInt32(row["ID"].ToString()));
                                OlderMedicineCnBLL   OlderMedicineCnbll = new OlderMedicineCnBLL();
                                OlderMedicineCnModel MedResultModel     = OlderMedicineCnbll.GetModelOUTKey(Convert.ToInt32(row["ID"].ToString()));
                                OlderMedicineCnbll.DelOUTkey(Convert.ToInt32(row["ID"].ToString()));

                                //删除签名
                                Sign = string.Format("{0}{1}_{2}_Asses.png", SignPath + "OldVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);

                                if (MedResultModel != null)
                                {
                                    SignDoc = string.Format("{0}{1}_{2}_MeC.png", SignPath + "OldVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(MedResultModel.RecordDate).ToString("yyyyMMdd"));
                                    DeletSign(SignDoc);
                                }

                                break;

                            case "高血压记录":
                                this.drugType = "1";

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "HypVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "HypVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);

                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "糖尿病记录":
                                this.drugType = "2";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "DiaVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "DiaVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);
                                break;

                            case "冠心病记录":
                                this.drugType = "4";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "脑卒中记录":
                                this.drugType = "5";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "精神病记录":
                                this.drugType = "3";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "MentalVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "MentalVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);
                                break;

                            case "肺结核记录":
                                ChronicLungerVisitBLL lungerVisit = new ChronicLungerVisitBLL();
                                //删除签名
                                DataSet ds = lungerVisit.GetList(" OutKey=" + Convert.ToInt32(row["ID"].ToString()));
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    string VisitCount = ds.Tables[0].Rows[i]["VisitCount"].ToString();
                                    string strDate    = Convert.ToDateTime(ds.Tables[0].Rows[i]["FollowupDate"]).ToString("yyyyMMdd");

                                    Sign    = string.Format("{0}{1}_{2}_{3}.png", SignPath + "PTBVisit//", row["IDCardNo"].ToString(), VisitCount, strDate);
                                    SignDoc = string.Format("{0}{1}_{2}_{3}_Doc.png", SignPath + "PTBVisit//", row["IDCardNo"].ToString(), VisitCount, strDate);

                                    DeletSign(Sign);
                                    DeletSign(SignDoc);
                                }

                                break;

                            case "":
                                break;

                            default: break;
                            }

                            archive_baseinfo.Delete(Convert.ToInt32(row["ID"].ToString()));
                            string where           = this.GetWhere();
                            this.totalCount        = archive_baseinfo.GetRecordCount(where);
                            this.lbTotalCount.Text = string.Format("共计{0}条", this.totalCount.ToString());

                            row.Delete();
                            row.Table.AcceptChanges();
                        }
                    }
                }
            }
        }