public void InitEveryThing() { this.elderSelf = new OlderSelfCareabilityBLL().GetModelID(this.IDPerson); if (this.elderSelf == null) { return; } else { this.elderSelf.LastUpDateBy = new decimal?(ConfigHelper.GetNodeDec("doctor")); this.elderSelf.LastUpDateDate = new DateTime?(DateTime.Today); } this.cp_elderSelf = GlbTools.DeepCopy(this.elderSelf); if (string.IsNullOrEmpty(this.elderSelf.FollowUpDoctor)) { this.elderSelf.FollowUpDoctor = ConfigHelper.GetNode("doctorName"); } this.tbDoctor.DataBindings.Add("TEXT", this.elderSelf, "FollowUpDoctor", false, DataSourceUpdateMode.OnPropertyChanged); if (string.IsNullOrEmpty(this.elderSelf.NextVisitAim)) { this.elderSelf.NextVisitAim = "低盐饮食,预防高血压"; } this.txbNextVisitAim.DataBindings.Add("TEXT", this.elderSelf, "NextVisitAim", false, DataSourceUpdateMode.OnPropertyChanged); this.CbSimpleBind(this.cbDinner, "DINE"); this.CbSimpleBind(this.cbGromming, "Groming"); this.CbSimpleBind(this.cbDressing, "Dressing"); this.CbSimpleBind(this.cbTolet, "Tolet"); this.CbSimpleBind(this.cbAct, "Activity"); if (this.elderSelf.TotalScore.HasValue) { this.tbTotal.Text = this.elderSelf.TotalScore.Value.ToString(); } if (this.elderSelf.FollowUpDate.HasValue) { this.dtpCheckdate.Value = this.elderSelf.FollowUpDate.Value; } else { this.dtpCheckdate.Value = DateTime.Now; } if (this.elderSelf.NextFollowUpDate.HasValue) { this.dtpNextF.Value = this.elderSelf.NextFollowUpDate.Value; } else { this.dtpNextF.Value = DateTime.Today.AddYears(1); } MustChoose(); this.EveryThingIsOk = true; }
public bool SaveUc() { if (GlbTools.IsChanged(this.DataSrc, this.srcData, new string[] { "ModelState", "VisitDoctor" })) { KidsTcmhmOneBLL kidsTcmhmOneBLL = new KidsTcmhmOneBLL(); if (this.DataSrc.ModelState == RecordsStateModel.AddToDB) { kidsTcmhmOneBLL.Add(this.DataSrc); } else if (this.DataSrc.ModelState == RecordsStateModel.UpdateInDB) { kidsTcmhmOneBLL.Update(this.DataSrc); } } return(true); }
public bool SaveUc() { if (GlbTools.IsChanged(this.srcData, this.DataSrc, new string[] { "ModelState", "VisitDoctor" })) { KidsTcmhmOneToThreeBLL child_tcmhm_onethree = new KidsTcmhmOneToThreeBLL(); if (this.DataSrc.ModelState == RecordsStateModel.AddToDB) { child_tcmhm_onethree.Add(this.DataSrc); } else if (this.DataSrc.ModelState == RecordsStateModel.UpdateInDB) { child_tcmhm_onethree.Update(this.DataSrc); } } return(true); }
private void btnOK_Click(object sender, EventArgs e) { this.elderSelf.FollowUpDate = new DateTime?(this.dtpCheckdate.Value.Date); this.elderSelf.NextFollowUpDate = new DateTime?(this.dtpNextF.Value.Date); this.UpdataToModel(); if (this.elderSelf.TotalScore.HasValue) { this.account = this.elderSelf.TotalScore.Value; } if (GlbTools.IsChanged(this.cp_elderSelf, this.elderSelf, new string[] { "VisitDate", "NextfollowupDate" })) { OlderSelfCareabilityBLL olderSelfCareabilityBLL = new OlderSelfCareabilityBLL(); if (olderSelfCareabilityBLL.Exists(this.IDPerson)) { olderSelfCareabilityBLL.Update(this.elderSelf); } } base.DialogResult = DialogResult.OK; }
public void InitEveryThing() { if (this.HelderSelf == null) { HealthSelfCareabilityModel olderSelfCareabilityModel = new HealthSelfCareabilityModel { IDCardNo = this.Model.IDCardNo, Dine = 0, Groming = 0, Dressing = 0, Tolet = 0, Activity = 0, CreatedDate = new DateTime?(DateTime.Today) }; this.HelderSelf = olderSelfCareabilityModel; this.HelderSelf.CreatedBy = ConfigHelper.GetNode("doctorName"); } else { this.HelderSelf.LastUpDateBy = ConfigHelper.GetNode("doctorName"); this.HelderSelf.LastUpDateDate = new DateTime?(DateTime.Today); } this.cp_elderSelf = GlbTools.DeepCopy(this.HelderSelf); this.CbSimpleBind(this.cbDinner, "DINE"); this.CbSimpleBind(this.cbGromming, "Groming"); this.CbSimpleBind(this.cbDressing, "Dressing"); this.CbSimpleBind(this.cbTolet, "Tolet"); this.CbSimpleBind(this.cbAct, "Activity"); if (this.HelderSelf.TotalScore.HasValue) { this.tbTotal.Text = this.HelderSelf.TotalScore.Value.ToString(); } else { this.tbTotal.Text = "0"; } MustChoose(); this.EveryThingIsOk = true; }
public bool SaveModelToDB() { this.elderSelf.FollowUpDate = new DateTime?(this.dtpCheckdate.Value.Date); this.elderSelf.NextFollowUpDate = new DateTime?(this.dtpNextF.Value.Date); if (GlbTools.IsChanged(this.cp_elderSelf, this.elderSelf, new string[] { "VisitDate", "NextfollowupDate" })) { OlderSelfCareabilityBLL older_selfcareability = new OlderSelfCareabilityBLL(); if (older_selfcareability.Exists(this.elderSelf.ID)) { older_selfcareability.Update(this.elderSelf); } RecordsGeneralConditionBLL recordsGeneralConditionBLL = new RecordsGeneralConditionBLL(); RecordsGeneralConditionModel recordsGeneralConditionModel = recordsGeneralConditionBLL.GetModel(this.Model.IDCardNo); if (recordsGeneralConditionModel != null) { recordsGeneralConditionModel.OldSelfCareability = this.tbTotal.Text; if (this.account <= 3M) { recordsGeneralConditionModel.OldSelfCareability = "1"; } else if ((this.account >= 4M) && (this.account <= 8M)) { recordsGeneralConditionModel.OldSelfCareability = "2"; } else if ((this.account >= 9M) && (this.account <= 18M)) { recordsGeneralConditionModel.OldSelfCareability = "3"; } else if (this.account >= 19M) { recordsGeneralConditionModel.OldSelfCareability = "4"; } recordsGeneralConditionBLL.Update(recordsGeneralConditionModel); } } return(true); }
private void GetNewVersion() { GlbTools.GetFtpServer(ConfigHelper.GetNode("versionID"), out this.ftp, out this.user, out this.pwd); if (((this.ftp != "") && (this.user != "")) && (this.pwd != "")) { if (!System.IO.File.Exists(Application.StartupPath + @"\versioninfo.txt")) { StreamWriter writer = new StreamWriter(new FileStream(Application.StartupPath + @"\versioninfo.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite), Encoding.Default); writer.Write("0\r\n"); writer.Write("0\r\n"); writer.Write("0\r\n"); writer.Write("1\r\n"); writer.Flush(); writer.Close(); } else { StreamReader reader = new StreamReader(Application.StartupPath + @"\versioninfo.txt"); if (!reader.EndOfStream) { string str = reader.ReadLine(); if (str != "") { this.m_lastyear = Convert.ToInt32(str); } } if (!reader.EndOfStream) { string str2 = reader.ReadLine(); if (str2 != "") { this.m_lastmonth = Convert.ToInt32(str2); } } if (!reader.EndOfStream) { string str3 = reader.ReadLine(); if (str3 != "") { this.m_lastday = Convert.ToInt32(str3); } } if (!reader.EndOfStream) { string str4 = reader.ReadLine(); m_verion = str4; if (str4 != "") { this.m_lastversion = Convert.ToDouble(str4); } } reader.Close(); } string str5 = this.readerFtp("ftp://" + this.ftp, this.user, this.pwd); if ((str5 != "error") && (str5.Length >= 12)) { double num = Convert.ToDouble(str5.Substring(7, str5.Length - 11)); if ((num - this.m_lastversion) > 1E-05) { this.linkLatestVersion.Visible = true; this.m_lastversion = num; } } } }
public void InitUc() { if (string.IsNullOrEmpty(this.DataSrc.FollowDoctor)) { this.tbDoctor.Text = ConfigHelper.GetNode("doctorName"); } else { this.tbDoctor.Text = this.DataSrc.FollowDoctor; } if (this.DataSrc == null) { throw new Exception("DataSrc 为Null"); } this.baojian = new ManyCheckboxs <KidsTcmhmOneModel>(this.DataSrc); this.baojian.AddCk(new CheckBox[] { this.chk1, this.chk2, this.chk3 }); this.baojian.AddCk(this.chk4, this.tbBaojianOth); this.baojian.BindingProperty("Tcmhm", "TcmhmOther"); if (this.DataSrc.FollowupDate.HasValue) { this.dtpVisitDate.Value = this.DataSrc.FollowupDate.Value; } if (this.DataSrc.NextFollowDate.HasValue) { this.dtpNextVisitDate.Value = this.DataSrc.NextFollowDate.Value; } this.srcData = GlbTools.DeepCopy(this.DataSrc); if (this.SelIndex != 2) { this.tbBaojianOth.ReadOnly = false; this.baojian.MVisiable = false; this.lbOther.Visible = false; this.tbBaojianOth.Size = new Size(this.tbBaojianOth.Size.Width, this.tbBaojianOth.Size.Height * 2); this.tbBaojianOth.Dock = DockStyle.Fill; } if (this.SelIndex == 2)//6个月 { this.SignS = string.Format("{0}{1}_Mec6.png", this.SignPath, this.DataSrc.IDCardNo); this.SignDoc = string.Format("{0}{1}_Mec6_Doc.png", this.SignPath, this.DataSrc.IDCardNo); } //签名初始化 if (File.Exists(this.SignS)) { Image imgeb = Image.FromFile(SignS); Image bmp = new System.Drawing.Bitmap(imgeb); picSignJs.Image = bmp; picSignJs.Show(); imgeb.Dispose(); this.lkJs.Enabled = true; picSignJs.BackColor = Color.White; } if (File.Exists(this.SignDoc)) { Image imgeb = Image.FromFile(SignDoc); Image bmp = new System.Drawing.Bitmap(imgeb); picSignYs.Image = bmp; picSignYs.Show(); imgeb.Dispose(); this.lkYs.Enabled = true; picSignYs.BackColor = Color.White; } }
public void InitUc() { if (string.IsNullOrEmpty(this.DataSrc.FollowUpDoctor)) { this.tbDoctor.Text = ConfigHelper.GetNode("doctorName"); } else { this.tbDoctor.Text = this.DataSrc.FollowUpDoctor; } if (this.DataSrc == null) { throw new Exception("DataSrc 为Null"); } this.baojian = new ManyCheckboxs <KidsTcmhmOneToThreeModel>(this.DataSrc); this.baojian.AddCk(new CheckBox[] { this.chk1, this.chk2, this.chk3 }); this.baojian.AddCk(this.chk4, this.tbBaojianOth); this.baojian.BindingProperty("Tcmhm", "TcmhmOther"); if (this.DataSrc.FollowupDate.HasValue) { this.dtpVisitDate.Value = this.DataSrc.FollowupDate.Value; } if (this.DataSrc.NextFollowupDate.HasValue) { this.dtpNextVisitDate.Value = this.DataSrc.NextFollowupDate.Value; } this.SignS = string.Format("{0}{1}_Mec12.png", this.SignPath, this.DataSrc.IDCardNo); this.SignDoc = string.Format("{0}{1}_Mec12_Doc.png", this.SignPath, this.DataSrc.IDCardNo); this.srcData = GlbTools.DeepCopy(this.DataSrc); switch (this.SelIndex) { case 1: this.chk3.Text = "传授按揉迎香穴、足三里穴方法"; this.SignS = string.Format("{0}{1}_Mec18.png", this.SignPath, this.DataSrc.IDCardNo); this.SignDoc = string.Format("{0}{1}_Mec18_Doc.png", this.SignPath, this.DataSrc.IDCardNo); break; case 2: this.chk3.Text = "传授按揉迎香穴、足三里穴方法"; this.SignS = string.Format("{0}{1}_Mec24.png", this.SignPath, this.DataSrc.IDCardNo); this.SignDoc = string.Format("{0}{1}_Mec24_Doc.png", this.SignPath, this.DataSrc.IDCardNo); break; case 3: this.chk3.Text = "传授按揉四神聪穴方法"; this.SignS = string.Format("{0}{1}_Mec30.png", this.SignPath, this.DataSrc.IDCardNo); this.SignDoc = string.Format("{0}{1}_Mec30_Doc.png", this.SignPath, this.DataSrc.IDCardNo); break; } //签名初始化 if (File.Exists(this.SignS)) { Image imgeb = Image.FromFile(SignS); Image bmp = new System.Drawing.Bitmap(imgeb); picSignJs.Image = bmp; picSignJs.Show(); imgeb.Dispose(); this.lkJs.Enabled = true; picSignJs.BackColor = Color.White; } if (File.Exists(this.SignDoc)) { Image imgeb = Image.FromFile(SignDoc); Image bmp = new System.Drawing.Bitmap(imgeb); picSignYs.Image = bmp; picSignYs.Show(); imgeb.Dispose(); this.lkYs.Enabled = true; picSignYs.BackColor = Color.White; } }
public void InitEveryThing() { //this.elderSelf = new RecordsSelfcareabilityBLL().GetModelID(this.SelfID); if (this.elderSelf == null) { RecordsSelfcareabilityModel olderSelfCareabilityModel = new RecordsSelfcareabilityModel { IDCardNo = this.Model.IDCardNo, RecordID = this.Model.RecordID, FollowUpDoctor = this.Model.Doctor, Dine = 0, Groming = 0, Dressing = 0, Tolet = 0, Activity = 0, CreatedDate = new DateTime?(DateTime.Today) }; this.elderSelf = olderSelfCareabilityModel; this.elderSelf.CreatedBy = new decimal?(ConfigHelper.GetNodeDec("doctor")); this.dtpNextF.Value = DateTime.Today.AddYears(1); } else { this.elderSelf.LastUpDateBy = new decimal?(ConfigHelper.GetNodeDec("doctor")); this.elderSelf.LastUpDateDate = new DateTime?(DateTime.Today); if (this.elderSelf.NextFollowUpDate.HasValue && PhysicalInfoFactoryID > 0) { this.dtpNextF.Value = this.elderSelf.NextFollowUpDate.Value; } else { this.dtpNextF.Value = DateTime.Today.AddYears(1); } } this.cp_elderSelf = GlbTools.DeepCopy(this.elderSelf); if (string.IsNullOrEmpty(this.elderSelf.FollowUpDoctor)) { this.elderSelf.FollowUpDoctor = ConfigHelper.GetNode("doctorName"); } this.tbDoctor.DataBindings.Add("TEXT", this.elderSelf, "FollowUpDoctor", false, DataSourceUpdateMode.OnPropertyChanged); if (string.IsNullOrEmpty(this.elderSelf.NextVisitAim)) { //this.elderSelf.NextVisitAim = "防意外,防伤害,防坠床。"; this.elderSelf.NextVisitAim = "低盐饮食,预防高血压"; } this.txbNextVisitAim.DataBindings.Add("TEXT", this.elderSelf, "NextVisitAim", false, DataSourceUpdateMode.OnPropertyChanged); this.CbSimpleBind(this.cbDinner, "DINE"); this.CbSimpleBind(this.cbGromming, "Groming"); this.CbSimpleBind(this.cbDressing, "Dressing"); this.CbSimpleBind(this.cbTolet, "Tolet"); this.CbSimpleBind(this.cbAct, "Activity"); if (this.elderSelf.TotalScore.HasValue) { this.tbTotal.Text = this.elderSelf.TotalScore.Value.ToString(); } else { this.tbTotal.Text = "0"; } if (this.elderSelf.FollowUpDate.HasValue) { this.dtpCheckdate.Value = this.elderSelf.FollowUpDate.Value; } else { this.dtpCheckdate.Value = DateTime.Today; } //if (this.elderSelf.NextFollowUpDate.HasValue) //{ // this.dtpNextF.Value = this.elderSelf.NextFollowUpDate.Value; //} //else //{ // this.dtpNextF.Value = DateTime.Today; //} MustChoose(); this.EveryThingIsOk = true; }