public List <WorkingPostViewInfo> SearchWorkingPostViewList(WorkingPostSearchInfo workingPostSearch) { MssqlCondition mssqlCondition = new MssqlCondition(); this.PrepareCondition(mssqlCondition, workingPostSearch); List <WorkingPostViewInfo> workingPostViewList = new List <WorkingPostViewInfo>(); SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) }; pt[0].Value = mssqlCondition.ToString(); using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchWorkingPostViewList", pt)) { while (dr.Read()) { WorkingPostViewInfo info = new WorkingPostViewInfo(); { info.PostId = int.Parse(dr["PostId"].ToString()); info.PostName = dr["PostName"].ToString(); info.KPIContent = dr["KPIContent"].ToString(); info.CompanyId = int.Parse(dr["CompanyId"].ToString()); } workingPostViewList.Add(info); } } return(workingPostViewList); }
public WorkingPostViewInfo ReadWorkingPostView(int id) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.NVarChar) }; pt[0].Value = id; WorkingPostViewInfo info = new WorkingPostViewInfo(); using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadWorkingPostView", pt)) { if (dr.Read()) { info.PostId = int.Parse(dr["PostId"].ToString()); info.PostName = dr["PostName"].ToString(); info.KPIContent = dr["KPIContent"].ToString(); info.CompanyId = int.Parse(dr["CompanyId"].ToString()); } } return(info); }