public t_com GetComModel() { t_com res = null; string sql = @"select top (1) * from t_com"; List <t_com> coms = Query <t_com>(sql, null); if (coms.Count > 0) { res = coms.FirstOrDefault(); } return(res); }
protected void Init() { #region 获取公司基本信息 ComBLL _bll = new ComBLL(); t_com item = _bll.GetComModel(); PropertyInfo pinfo = pageModel.GetType().GetProperty("_com"); if (pinfo != null) { pinfo.SetValue(pageModel, item); } #endregion }
public bool SaveCom(t_com model) { t_com temp = GetComModel(); bool res = false; if (temp == null) { //插入公司信息 res = Insert <t_com>(model); } else { //修改公司信息 res = Alter <t_com>(model); } return(res); }
public bool SaveCom(t_com model) { return(_dal.SaveCom(model)); }