示例#1
0
        private void MustChoose()
        {
            DataSet dsrequire = new DataSet();

            dsrequire = new RequireBLL().GetList("TabName = '老年人随访' and Comment = '健康评估' ");
            DataTable dt    = dsrequire.Tables[0];
            DataTable older = new RecordsSelfcareabilityBLL().GetList("IDCardNo ='" + Model.IDCardNo + "'").Tables[0];
            bool      flag  = (older.Rows.Count > 0) ? true : false;

            if (flag)
            {
                DataRow row = older.Rows[0];
                foreach (DataRow item in dt.Rows)
                {
                    if (item["Isrequired"].ToString() == "1")
                    {
                        switch (item["ChinName"].ToString())
                        {
                        case "进餐":
                            if (string.IsNullOrEmpty(row["Dine"].ToString()))
                            {
                                this.label10.Text      = "*进    餐:";
                                this.label10.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label10.Text      = "进    餐:";
                                this.label10.ForeColor = System.Drawing.Color.Black;
                            }
                            break;
                            break;

                        case "梳洗":
                            if (string.IsNullOrEmpty(row["Groming"].ToString()))
                            {
                                this.label13.Text      = "*梳    洗:";
                                this.label13.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label13.Text      = "梳    洗:";
                                this.label13.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "穿衣":
                            if (string.IsNullOrEmpty(row["Dressing"].ToString()))
                            {
                                this.label16.Text      = "*穿    衣:";
                                this.label16.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label16.Text      = "穿    衣:";
                                this.label16.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "如厕":
                            if (string.IsNullOrEmpty(row["Tolet"].ToString()))
                            {
                                this.label19.Text      = "*如    厕:";
                                this.label19.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label19.Text      = "如    厕:";
                                this.label19.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "活动":
                            if (string.IsNullOrEmpty(row["Activity"].ToString()))
                            {
                                this.label1.Text      = "*活    动:";
                                this.label1.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label1.Text      = "活    动:";
                                this.label1.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        default: break;
                        }
                    }
                }
            }
            else
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (item["Isrequired"].ToString() == "1")
                    {
                        switch (item["ChinName"].ToString())
                        {
                        case "进餐":
                            this.label10.Text      = "*进    餐:";
                            this.label10.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "梳洗":
                            this.label13.Text      = "*梳    洗:";
                            this.label13.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "穿衣":
                            this.label16.Text      = "*穿    衣:";
                            this.label16.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "如厕":
                            this.label19.Text      = "*如    厕:";
                            this.label19.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "活动":
                            this.label1.Text      = "*活    动:";
                            this.label1.ForeColor = System.Drawing.Color.Red;
                            break;

                        default: break;
                        }
                    }
                }
            }
        }
示例#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))
                {
                    PhysicalInfoFactory.ID     = int.Parse(view.Row["ID"].ToString());
                    PhysicalInfoFactory.NewAdd = false;
                    using (PEControler controler = new PEControler(new PhysicalForm(view.Row["IDCardNo"].ToString()), new PhysicalInfoFactory()))
                    {
                        controler.IParentFrm.IShowDialog();
                        CheckData();
                    }
                    GC.Collect();
                }
                else if (((this.dgvData.Columns[e.ColumnIndex].HeaderText == "删除") && (this.bds.Position >= 0)) && (e.RowIndex >= 0))
                {
                    if (view != null)
                    {
                        DataRow row = view.Row;
                        if (MessageBox.Show("确定删除:" + row["CustomerName"].ToString() + "?删除之后的信息将无法恢复!", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                        {
                            int BaseID = Convert.ToInt32(row["ID"].ToString());
                            RecordsGeneralConditionModel GerneralCondition = new RecordsGeneralConditionBLL().GetModelByOutKey(BaseID);
                            if (GerneralCondition != null)
                            {
                                RecordsSelfcareabilityBLL RecordsSelfcareabilityBLL = new RecordsSelfcareabilityBLL();
                                RecordsSelfcareabilityBLL.Delete(GerneralCondition.SelfID);
                            }

                            RecordsMediPhysDistModel MediPhys = new RecordsMediPhysDistBLL().GetModelByOutKey(BaseID);
                            if (MediPhys != null)
                            {
                                RecordsMedicineCnBLL     MedicineCnBLL     = new RecordsMedicineCnBLL();
                                RecordsMedicineResultBLL MedicineResultBLL = new RecordsMedicineResultBLL();
                                MedicineCnBLL.Delete(MediPhys.MedicineID);
                                MedicineResultBLL.Delete(MediPhys.MedicineResultID);
                            }
                            RecordsSignatureModel Signature = new RecordsSignatureBLL().GetModelByOutKey(BaseID, row["IDCardNo"].ToString());
                            if (Signature != null)
                            {
                                if (Signature.FeedbackDate.HasValue)
                                {
                                    string strfbDate     = Convert.ToDateTime(Signature.FeedbackDate).ToString("yyyyMMdd");
                                    string strSign1_Self = String.Format("{0}{1}_{2}_B.png", SignPath, Signature.IDCardNo, strfbDate);
                                    if (File.Exists(strSign1_Self))  //如果存在则删除图片
                                    {
                                        File.Delete(strSign1_Self);
                                    }
                                    string strSign1_Js = String.Format("{0}{1}_{2}_J.png", SignPath, Signature.IDCardNo, strfbDate);
                                    if (File.Exists(strSign1_Js)) //如果存在则删除图片
                                    {
                                        File.Delete(strSign1_Js);
                                    }
                                    string strSign1_Fkr = String.Format("{0}{1}_{2}_F.png", SignPath, Signature.IDCardNo, strfbDate);
                                    if (File.Exists(strSign1_Fkr)) //如果存在则删除图片
                                    {
                                        File.Delete(strSign1_Fkr);
                                    }
                                    string strSign1_Ys = String.Format("{0}{1}_{2}_Doc.png", SignPath, Signature.IDCardNo, strfbDate);
                                    if (File.Exists(strSign1_Ys)) //如果存在则删除图片
                                    {
                                        File.Delete(strSign1_Ys);
                                    }
                                }
                            }
                            new RecordsCustomerBaseInfoBLL().Delete(BaseID);
                            row.Delete();
                            row.Table.AcceptChanges();
                            CheckData();
                        }
                    }
                }
            }
        }
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                RecordsBaseInfoModel model = new RecordsBaseInfoBLL().GetModel(this.CardID);
                string   strage            = "";
                DateTime dtage;
                decimal  dnow = 0, dage = 0;
                if (model.Birthday != null)
                {
                    dtage  = Convert.ToDateTime(model.Birthday);
                    dnow   = Convert.ToDecimal(DateTime.Today.ToString("yyyyMMdd"));
                    dage   = Convert.ToDecimal(dtage.ToString("yyyyMMdd"));
                    strage = Convert.ToString(dnow - dage).ToString();
                    switch (strage.Length)
                    {
                    case 1:
                    case 2:
                    case 3:
                    case 4: strage = "0"; break;

                    case 5: strage = strage.Substring(0, 1); break;

                    case 6: strage = strage.Substring(0, 2); break;

                    case 7: strage = strage.Substring(0, 3); break;

                    default: break;
                    }
                }
                List <ListValue> list = new List <ListValue>
                {
                    new ListValue
                    {
                        strMark = "$archiveid",
                        strVal  = model.RecordID
                    },
                    new ListValue
                    {
                        strMark = "$name",
                        strVal  = model.CustomerName
                    },
                    new ListValue
                    {
                        strMark = "$age",
                        strVal  = strage
                    }
                };
                RecordsCustomerBaseInfoModel CustomerModel = new RecordsCustomerBaseInfoDAL().GetMaxModel(this.CardID);
                if (CustomerModel != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "$pgrq",
                        strVal  = DrawItems.strToDate(CustomerModel.CheckDate, 1)
                    });

                    RecordsGeneralConditionModel GeneralModel = new RecordsGeneralConditionDAL().GetModelByOutKey(CustomerModel.ID);
                    if (GeneralModel != null && GeneralModel.SelfID != 0)
                    {
                        RecordsSelfcareabilityModel model2 = new RecordsSelfcareabilityBLL().GetModelID(GeneralModel.SelfID);
                        if (model2 != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$hd",
                                strVal  = DrawItems.objToNum(model2.Activity, 0)
                            });

                            list.Add(new ListValue
                            {
                                strMark = "$rc",
                                strVal  = DrawItems.objToNum(model2.Tolet, 0)
                            });
                            if (model2.Dressing == 2m)
                            {
                                model2.Dressing = new decimal?(0m);
                            }
                            list.Add(new ListValue
                            {
                                strMark = "$cy",
                                strVal  = DrawItems.objToNum(model2.Dressing, 0)
                            });
                            list.Add(new ListValue
                            {
                                strMark = "$sx",
                                strVal  = DrawItems.objToNum(model2.Groming, 0)
                            });
                            if (model2.Dine == 2m)
                            {
                                model2.Dine = new decimal?(0m);
                            }
                            list.Add(new ListValue
                            {
                                strMark = "$jc",
                                strVal  = DrawItems.objToNum(model2.Dine, 0)
                            });
                            list.Add(new ListValue
                            {
                                strMark = "$zf",
                                strVal  = DrawItems.objToNumStr(model2.TotalScore, 2)
                            });
                            //一般情况签名
                            list.Add(new ListValue
                            {
                                strMark = "&pjysqm",
                                strVal  = SignPath + "_Doctor1.png"
                            });
                        }
                    }
                }
                return(DrawItems.setPage("printXps\\" + this.PrintName, list));
            }
            return(null);
        }