Ejemplo n.º 1
0
 public LishiZhishiModel(LishiZhishi lishiZhishi)
 {
     this.zhishiId = lishiZhishi.Zhishi.Id;
     this.banbenhao = lishiZhishi.Banben.ToString() + ".0";
     this.chuangjianren = WebHelper.GetYonghuXingming(lishiZhishi.Chuangjianren);
     this.chuangjianShijian = lishiZhishi.ChuangjianShijian.ToString("yyyy-MM-dd");
     string yonghu = WebHelper.DangqianYonghuZhanghao;
     if (lishiZhishi.ErjiDaan != null)
     {
         this.erjiDaan = lishiZhishi.ErjiDaan.Neirong;
         this.erjiDaanFujian = lishiZhishi.ErjiDaan.FujianList.Select(x => new FujianModel(x)).ToList();
     }
     this.id = lishiZhishi.Id;
     if (lishiZhishi.SanjiDaan != null)
     {
         this.sanjiDaan = lishiZhishi.SanjiDaan.Neirong;
         this.sanjiDaanFujian = lishiZhishi.SanjiDaan.FujianList.Select(x => new FujianModel(x)).ToList();
     }
     if (lishiZhishi.SijiDaan != null)
     {
         this.sijiDaan = lishiZhishi.SijiDaan.Neirong;
         this.sijiDaanFujian = lishiZhishi.SijiDaan.FujianList.Select(x => new FujianModel(x)).ToList();
     }
     this.wenti = lishiZhishi.Wenti;
     if (lishiZhishi.WujiDaan != null)
     {
         this.wujiDaan = lishiZhishi.WujiDaan.Neirong;
         this.wujiDaanFujian = lishiZhishi.WujiDaan.FujianList.Select(x => new FujianModel(x)).ToList();
     }
     if (lishiZhishi.YijiDaan != null)
     {
         this.yijiDaan = lishiZhishi.YijiDaan.Neirong;
         this.yijiDaanFujian = lishiZhishi.YijiDaan.FujianList.Select(x => new FujianModel(x)).ToList();
     }
 }
Ejemplo n.º 2
0
 public ZhishiChakanModel(LishiZhishi zhishi)
 {
     this.banbenhao = zhishi.Banben.ToString() + ".0";
     this.chuangjianren = WebHelper.GetYonghuXingming(zhishi.Chuangjianren);
     this.chuangjianShijian = zhishi.ChuangjianShijian.ToString("yyyy-MM-dd");
     string yonghu = WebHelper.DangqianYonghuZhanghao;
     this.daanHtml = "";
     if (zhishi.ErjiDaan != null)
     {
         this.daanHtml += this.ShengchengHtml(zhishi.ErjiDaan);
     }
     this.id = zhishi.Id;
     if (zhishi.SanjiDaan != null)
     {
         this.daanHtml += this.ShengchengHtml(zhishi.SanjiDaan);
     }
     if (zhishi.SijiDaan != null)
     {
         this.daanHtml += this.ShengchengHtml(zhishi.SijiDaan);
     }
     this.wenti = zhishi.Wenti;
     if (zhishi.WujiDaan != null)
     {
         this.daanHtml += this.ShengchengHtml(zhishi.WujiDaan);
     }
     if (zhishi.YijiDaan != null)
     {
         this.daanHtml += this.ShengchengHtml(zhishi.YijiDaan);
     }
 }
Ejemplo n.º 3
0
 private LishiZhishi ChuangjianLishi(string chuangjianren)
 {
     LishiZhishiDataModel lsModel = new LishiZhishiDataModel(this);
     lsModel.Chuangjianren = chuangjianren;
     lsModel.ChuangjianShijian = DateTime.Now;
     lsModel.Id = (int) NHibernateHelper.CurrentSession.Save(lsModel);
     LishiZhishi zhishi = new LishiZhishi(lsModel.Id, lsModel.Wenti, this.YijiDaan, this.ErjiDaan, this.SanjiDaan, this.SijiDaan, this.WujiDaan,
         lsModel.Chuangjianren, lsModel.ChuangjianShijian, lsModel.Banben);
     List<LishiZhishi> list = this._lishiBanben.ToList();
     zhishi.Zhishi = this;
     list.Add(zhishi);
     this._lishiBanben = list;
     return zhishi;
 }
Ejemplo n.º 4
0
 private List<LishiZhishi> JiazaiLishiZhishi(int zhishiId)
 {
     List<LishiZhishi> lishiZhishiList = new List<LishiZhishi>();
     List<LishiZhishiDataModel> dataModels = NHibernateHelper.CurrentSession.QueryOver<LishiZhishiDataModel>().Where(x => x.ZhishiId == zhishiId).List().ToList();
     foreach (LishiZhishiDataModel model in dataModels)
     {
         LishiZhishi zhishi = new LishiZhishi(model.Id, model.Wenti, this.JiazaiDaan(model.YijiDaan), this.JiazaiDaan(model.ErjiDaan),
             this.JiazaiDaan(model.SanjiDaan), this.JiazaiDaan(model.SijiDaan), this.JiazaiDaan(model.WujiDaan), model.Chuangjianren,
             model.ChuangjianShijian, model.Banben);
         lishiZhishiList.Add(zhishi);
     }
     return lishiZhishiList;
 }