首页 新闻 会员 周边

c#编程 刚上手的小白 刚刚开始正在读书但是任务紧 求解读这段代码什么含义 ?

0
[已解决问题] 解决于 2016-12-28 10:35

private void FillPatientInfo(PatientInfoDto info, Exception ex)
{
this.info = info;
lblFeeType.Text = string.Empty;
lblFamilyAddress.Text = string.Empty;
lblContracts.Text = string.Empty;
lblNextReturn.Text = string.Empty;
lblHDDate.Text = string.Empty;
lblHDOther.Text = string.Empty;
lblBlood.Text = string.Empty;
lblInfectious.Text = string.Empty;
lblAddiction.Text = string.Empty;
if (info == null)
{
this.info = new PatientInfoDto();
this.info.PatientID = this.patient.PatientID;
this.info.FeeType = FeeTypeEnum.Government;
}
else
{
lblFeeType.Text = string.Format("{0}{1}",
HdisEnum.GetEnumText(info.FeeType),
info.FreeCardDate > DateTime.MinValue ? string.Format("({0})", info.FreeCardDate.ToString("yyyy-MM-dd")) : string.Empty);
lblFamilyAddress.Text = string.Format("{0} {1}", info.FamilyAddress.Trim(), info.Tel.Trim());
var sbContract = new StringBuilder();
if (!string.IsNullOrEmpty(info.Tel1))
{
sbContract.Append(string.Format("{0}({1}){2}", string.IsNullOrEmpty(info.Contacts1) ? "姓名" : info.Contacts1, string.IsNullOrEmpty(info.Relation1) ? "关系" : info.Relation1, info.Tel1));
}
if (!string.IsNullOrEmpty(info.Tel2))
{
if (sbContract.Length > 0)
sbContract.Append("、");
sbContract.Append(string.Format("{0}({1}){2}", string.IsNullOrEmpty(info.Contacts2) ? "姓名" : info.Contacts2, string.IsNullOrEmpty(info.Relation2) ? "关系" : info.Relation2, info.Tel2));
}
if (sbContract.Length > 0)
{
lblContracts.Text = sbContract.ToString();
}
if(!string.IsNullOrEmpty(info.NextReturnDoctor))
lblNextReturn.Text = string.Format("{0}({1})", info.NextReturnDoctor, info.NextReturnDate.ToString("yyyy-MM-dd"));

var hdDate = string.Empty;
if (info.HDStartDate.HasValue && info.HDStartDate.Value > DateTime.MinValue)
hdDate = string.Format("血透开始({0})", info.HDStartDate.Value.ToString("yyyy-MM-dd"));
var localHDDate = string.Empty;
if (info.LocalHDStartDate.HasValue && info.LocalHDStartDate.Value > DateTime.MinValue)
localHDDate = string.Format("本院血透开始({0})", info.LocalHDStartDate.Value.ToString("yyyy-MM-dd"));
lblHDDate.Text = HdisHelper.CreateSummary("、", hdDate, localHDDate);

var pdStart = string.Empty;
if (info.PDStartDate.HasValue && info.PDStartDate.Value > DateTime.MinValue)
pdStart = string.Format("腹膜开始({0})", info.PDStartDate.Value.ToString("yyyy-MM-dd"));
var pdEnd = string.Empty;
if (info.PDStopDate.HasValue && info.PDStopDate.Value > DateTime.MinValue)
pdEnd = string.Format("腹膜停止({0})", info.PDStopDate.Value.ToString("yyyy-MM-dd"));
var kt = string.Empty;
if (info.KTDate.HasValue && info.KTDate.Value > DateTime.MinValue)
kt = string.Format("肾移植({0})", info.KTDate.Value.ToString("yyyy-MM-dd"));
lblHDOther.Text = HdisHelper.CreateSummary("、", pdStart, pdEnd, kt);

lblBlood.Text = string.Format("{0} {1}", HdisEnum.GetEnumText(info.ABO), HdisEnum.GetEnumText(info.RH));
lblInfectious.Text = string.Format("{0}{1}", HdisEnum.GetEnumText(info.Infectious), string.IsNullOrEmpty(info.OtherInfection) ? string.Empty : "、" + info.OtherInfection);
lblAddiction.Text = HdisEnum.GetEnumText(info.AddictionHistory);
}
}

private void FillPatientRemark(PatientRemarkDto remark, Exception ex)
{
if (remark == null)
{
this.remark = new PatientRemarkDto();
this.remark.PatientID = this.patient.PatientID;
lblRemark.Text = string.Empty;
}
else
{
this.remark = remark;
lblRemark.Text = remark.Remark;
}
}

private void FillPatientFirstRecord(PatientFirstRecordDto firstRecord, Exception ex)
{
if (firstRecord == null)
{
this.firstRecord = new PatientFirstRecordDto();
this.firstRecord.PatientID = this.patient.PatientID;
txtFirstRecord.Text = string.Empty;
}
else
{
this.firstRecord = firstRecord;
txtFirstRecord.Text = firstRecord.FirstRecord;
}
}

糯米好吃的主页 糯米好吃 | 初学一级 | 园豆:64
提问于:2016-12-16 12:57
< >
分享
最佳答案
-1

这代码就两个意思

1、FillPatientInfo 填充病人资料。

2、FillPatientFirstRecord 填充病人第一个记录。

其他都可以忽略不计。

奖励园豆:5
爱编程的大叔 | 高人七级 |园豆:30839 | 2016-12-16 14:05

大叔 现在c#编程现在平均工资好低啊  程序员刚入门   想把更多的精力投入到工作中 多挣点钱   想听听大叔从业这么多年的感悟和对程序猿这份工作的评价

糯米好吃 | 园豆:64 (初学一级) | 2016-12-27 10:33

@糯米好吃: 不管哪个行业,如果平均工资高,入门门槛低得话,总是会有人进去拉低平均线的。

平均工资没有意义的。

再说了,高于平均工资你还是不会满足的。

爱编程的大叔 | 园豆:30839 (高人七级) | 2016-12-27 11:35

有道理,程序猿能转管理层吗????感觉一直敲代码感觉肯定会被社会落下进度啊

糯米好吃 | 园豆:64 (初学一级) | 2016-12-27 15:47
其他回答(5)
0

 控件赋值,数据填充

网络白蚁 | 园豆:213 (菜鸟二级) | 2016-12-16 13:05

什么意思啊具体点好吗 

支持(0) 反对(0) 糯米好吃 | 园豆:64 (初学一级) | 2016-12-16 13:24
0

你具体是哪里不懂呢。就是简单的赋值操作。如果等于null  值就是空  ,不是null 就赋其他值

青语 | 园豆:1000 (小虾三级) | 2016-12-16 13:37
0

那一段不懂?就是给控件赋值

路过的鱼 | 园豆:279 (菜鸟二级) | 2016-12-16 15:36
0

尼玛这么多 if else

可是我爱你啊 | 园豆:130 (初学一级) | 2018-09-11 17:37
0

医疗行业,没搞头啦

编程非我意 | 园豆:220 (菜鸟二级) | 2022-08-30 18:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册