예제 #1
0
        protected void PageInit()
        {
            int wkid = Convert.ToInt32(Request["SpecialExpId"].ToString());
            SpecialExpInfo sp = new SpecialExpInfo(wkid);
            lblApplyDate.Text = sp.ApplyDate.ToString();
            lblApplyPeople.Text = sp.ApplyPeople.ToString();

                MainProjectCreateInfo project = new MainProjectCreateInfo(Convert.ToInt32(sp.MainProjectCreateId));
                lblMoneyNum.Text = project.PreMoney.ToString();
                lblProject.Text = project.ProjectName.ToString();

            txtReason.Text = sp.ApplyReason.ToString();
            if (sp.ProjectStepId.ToString() != "")
            {
                ProjectStepInfo step = new ProjectStepInfo(Convert.ToInt32(sp.ProjectStepId));
                lblStep.Text = step.ProjectStepName.ToString();
            }
            lblApplyMoney.Text = sp.ApplyMoney.ToString();
            lblSheetNum.Text = sp.SheetNum.ToString();

            if (sp.SignName == 1)
            {
                imgMarket.Visible = true;
            }
            else if (sp.SignName == 2)
            {
                imgMarket.Visible = true;
                imgManager.Visible = true;
            }
        }
예제 #2
0
        //数据持久化
        internal static void  SaveToDb(ProjectStepInfo pProjectStepInfo, ProjectStep pProjectStep, bool pIsNew)
        {
            pProjectStep.ProjectStepId   = pProjectStepInfo.projectStepId;
            pProjectStep.ProjectStepName = pProjectStepInfo.projectStepName;
            pProjectStep.IsNew           = pIsNew;
            string UserName = SubsonicHelper.GetUserName();

            try
            {
                pProjectStep.Save(UserName);
            }
            catch (Exception ex)
            {
                LogManager.getInstance().getLogger(typeof(ProjectStepInfo)).Error(ex);
                if (ex.Message.Contains("插入重复键"))               //违反了唯一键
                {
                    throw new AppException("此对象已经存在");          //此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示
                }
                throw new AppException("保存失败");
            }
            pProjectStepInfo.projectStepId = pProjectStep.ProjectStepId;
            //如果缓存存在,更新缓存
            if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)))
            {
                ResetCache();
            }
        }
예제 #3
0
        /// <summary>
        /// 获得分页列表,无论是否是缓存实体都从数据库直接拿取数据
        /// </summary>
        /// <param name="pPageIndex">页数</param>
        /// <param name="pPageSize">每页列表</param>
        /// <param name="pOrderBy">排序</param>
        /// <param name="pSortExpression">排序字段</param>
        /// <param name="pRecordCount">列表行数</param>
        /// <returns>数据分页</returns>
        public static List <ProjectStepInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount)
        {
            if (pPageIndex <= 1)
            {
                pPageIndex = 1;
            }
            List <ProjectStepInfo> list = new List <ProjectStepInfo>();

            Query q = ProjectStep.CreateQuery();

            q.PageIndex = pPageIndex;
            q.PageSize  = pPageSize;
            q.ORDER_BY(pSortExpression, pOrderBy.ToString());
            ProjectStepCollection collection = new  ProjectStepCollection();

            collection.LoadAndCloseReader(q.ExecuteReader());

            foreach (ProjectStep projectStep  in collection)
            {
                ProjectStepInfo projectStepInfo = new ProjectStepInfo();
                LoadFromDAL(projectStepInfo, projectStep);
                list.Add(projectStepInfo);
            }
            pRecordCount = q.GetRecordCount();

            return(list);
        }
예제 #4
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// <returns></returns>
        public static List <ProjectStepInfo> GetList()
        {
            string cacheKey = GetCacheKey();

            //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取
            if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)) && CachedEntityCommander.GetCache(cacheKey) != null)
            {
                return(CachedEntityCommander.GetCache(cacheKey) as List <ProjectStepInfo>);
            }
            else
            {
                List <ProjectStepInfo> list       = new List <ProjectStepInfo>();
                ProjectStepCollection  collection = new  ProjectStepCollection();
                Query qry = new Query(ProjectStep.Schema);
                collection.LoadAndCloseReader(qry.ExecuteReader());
                foreach (ProjectStep projectStep in collection)
                {
                    ProjectStepInfo projectStepInfo = new ProjectStepInfo();
                    LoadFromDAL(projectStepInfo, projectStep);
                    list.Add(projectStepInfo);
                }
                //生成缓存
                if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)))
                {
                    CachedEntityCommander.SetCache(cacheKey, list);
                }
                return(list);
            }
        }
예제 #5
0
 /// <summary>
 /// 批量装载
 /// </summary>
 internal static void LoadFromDALPatch(List <ProjectStepInfo> pList, ProjectStepCollection pCollection)
 {
     foreach (ProjectStep projectStep in pCollection)
     {
         ProjectStepInfo projectStepInfo = new ProjectStepInfo();
         LoadFromDAL(projectStepInfo, projectStep);
         pList.Add(projectStepInfo);
     }
 }
예제 #6
0
        public ProjectStepInfo GetProjectStepInfoById(int ProjectStepId)
        {
            ProjectStepInfo projectStepInfo  = null;//
            try
            {
                 projectStepInfo = new ProjectStepInfo(ProjectStepId);

            }
            catch (AppException)
            {
                return null;
            }

            return  projectStepInfo;
        }
예제 #7
0
        public ProjectStepInfo GetProjectStepInfoById(int ProjectStepId)
        {
            ProjectStepInfo projectStepInfo = null;             //

            try
            {
                projectStepInfo = new ProjectStepInfo(ProjectStepId);
            }
            catch (AppException)
            {
                return(null);
            }

            return(projectStepInfo);
        }
예제 #8
0
        protected void SpecialBind()
        {
            int wkid = Convert.ToInt32(Request["SpecialExpId"].ToString());
            SpecialExpInfo sp = new SpecialExpInfo(wkid);
            lblApplyDate.Text = sp.ApplyDate.ToString();
            lblApplyPeople.Text = sp.ApplyPeople.ToString();
            lblApplyMoney.Text = sp.ApplyMoney.ToString();
            lblSheetNum.Text = sp.SheetNum.ToString();

                MainProjectCreateInfo project = new MainProjectCreateInfo(Convert.ToInt32(sp.MainProjectCreateId));
                lblMoneyNum.Text = project.PreMoney.ToString();
                lblProject.Text = project.ProjectName.ToString();

            lblReason.Text = sp.ApplyReason.ToString();
            if (sp.ProjectStepId.ToString() != "")
            {
                ProjectStepInfo step = new ProjectStepInfo(Convert.ToInt32(sp.ProjectStepId));
                lblStep.Text = step.ProjectStepName.ToString();
            }
        }
예제 #9
0
 private void LoadFromId(int projectStepId)
 {
     if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)))
     {
         ProjectStepInfo projectStepInfo = Find(GetList(), projectStepId);
         if (projectStepInfo == null)
         {
             throw new AppException("未能在缓存中找到相应的键值对象");
         }
         Copy(projectStepInfo, this);
     }
     else
     {
         ProjectStep projectStep = new ProjectStep(projectStepId);
         if (projectStep.IsNew)
         {
             throw new AppException("尚未初始化");
         }
         LoadFromDAL(this, projectStep);
     }
 }
예제 #10
0
 /// <summary>
 /// 复制一个对象,采用硬编码的方式,避免反射的低效
 /// </summary>
 /// <param name="pIndustryTypeInfoFrom"></param>
 /// <param name="pIndustryTypeInfoTo"></param>
 public static void Copy(ProjectStepInfo pProjectStepInfoFrom, ProjectStepInfo pProjectStepInfoTo)
 {
     pProjectStepInfoTo.ProjectStepId = pProjectStepInfoFrom.projectStepId;
      		pProjectStepInfoTo.ProjectStepName = pProjectStepInfoFrom.projectStepName;
     pProjectStepInfoTo.Loaded=pProjectStepInfoFrom.Loaded;
 }
예제 #11
0
        /// <summary>
        /// 获得分页列表,无论是否是缓存实体都从数据库直接拿取数据
        /// </summary>
        /// <param name="pPageIndex">页数</param>
        /// <param name="pPageSize">每页列表</param>
        /// <param name="pOrderBy">排序</param>
        /// <param name="pSortExpression">排序字段</param>
        /// <param name="pRecordCount">列表行数</param>
        /// <returns>数据分页</returns>
        public static List<ProjectStepInfo> GetPagedList(int pPageIndex,int pPageSize,SortDirection pOrderBy,string pSortExpression,out int pRecordCount)
        {
            if(pPageIndex<=1)
            pPageIndex=1;
            List< ProjectStepInfo> list = new List< ProjectStepInfo>();

            Query q = ProjectStep .CreateQuery();
            q.PageIndex = pPageIndex;
            q.PageSize = pPageSize;
            q.ORDER_BY(pSortExpression,pOrderBy.ToString());
            ProjectStepCollection  collection=new  ProjectStepCollection();
             	collection.LoadAndCloseReader(q.ExecuteReader());

            foreach (ProjectStep  projectStep  in collection)
            {
                ProjectStepInfo projectStepInfo = new ProjectStepInfo();
                LoadFromDAL(projectStepInfo,   projectStep);
                list.Add(projectStepInfo);
            }
            pRecordCount=q.GetRecordCount();

            return list;
        }
예제 #12
0
 /// <summary>
 /// 复制为另一个对象
 /// </summary>
 /// <param name="pIndustryTypeInfoTo"></param>
 public void CopyTo(ProjectStepInfo pProjectStepInfoTo)
 {
     Copy(this, pProjectStepInfoTo);
 }
예제 #13
0
 //从后台获取数据
 internal static void LoadFromDAL(ProjectStepInfo pProjectStepInfo, ProjectStep  pProjectStep)
 {
     pProjectStepInfo.projectStepId = pProjectStep.ProjectStepId;
      		pProjectStepInfo.projectStepName = pProjectStep.ProjectStepName;
     pProjectStepInfo.Loaded=true;
 }
예제 #14
0
 /// <summary>
 /// 复制为另一个对象
 /// </summary>
 /// <param name="pIndustryTypeInfoTo"></param>
 public void CopyTo(ProjectStepInfo pProjectStepInfoTo)
 {
     Copy(this,  pProjectStepInfoTo);
 }
예제 #15
0
 /// <summary>
 /// 批量装载
 /// </summary>
 internal static void LoadFromDALPatch(List< ProjectStepInfo> pList, ProjectStepCollection pCollection)
 {
     foreach (ProjectStep projectStep in pCollection)
     {
         ProjectStepInfo projectStepInfo = new ProjectStepInfo();
         LoadFromDAL(projectStepInfo, projectStep );
         pList.Add(projectStepInfo);
     }
 }
예제 #16
0
 //从后台获取数据
 internal static void  LoadFromDAL(ProjectStepInfo pProjectStepInfo, ProjectStep pProjectStep)
 {
     pProjectStepInfo.projectStepId   = pProjectStep.ProjectStepId;
     pProjectStepInfo.projectStepName = pProjectStep.ProjectStepName;
     pProjectStepInfo.Loaded          = true;
 }
예제 #17
0
 //数据持久化
 internal static void SaveToDb(ProjectStepInfo pProjectStepInfo, ProjectStep  pProjectStep,bool pIsNew)
 {
     pProjectStep.ProjectStepId = pProjectStepInfo.projectStepId;
      		pProjectStep.ProjectStepName = pProjectStepInfo.projectStepName;
     pProjectStep.IsNew=pIsNew;
     string UserName = SubsonicHelper.GetUserName();
     try
     {
         pProjectStep.Save(UserName);
     }
     catch(Exception ex)
     {
         LogManager.getInstance().getLogger(typeof(ProjectStepInfo)).Error(ex);
         if(ex.Message.Contains("插入重复键"))//违反了唯一键
         {
             throw new AppException("此对象已经存在");//此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示
         }
         throw new AppException("保存失败");
     }
     pProjectStepInfo.projectStepId = pProjectStep.ProjectStepId;
     //如果缓存存在,更新缓存
     if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)))
     {
         ResetCache();
     }
 }
예제 #18
0
 /// <summary>
 /// 复制一个对象,采用硬编码的方式,避免反射的低效
 /// </summary>
 /// <param name="pIndustryTypeInfoFrom"></param>
 /// <param name="pIndustryTypeInfoTo"></param>
 public static void Copy(ProjectStepInfo pProjectStepInfoFrom, ProjectStepInfo pProjectStepInfoTo)
 {
     pProjectStepInfoTo.ProjectStepId   = pProjectStepInfoFrom.projectStepId;
     pProjectStepInfoTo.ProjectStepName = pProjectStepInfoFrom.projectStepName;
     pProjectStepInfoTo.Loaded          = pProjectStepInfoFrom.Loaded;
 }
예제 #19
0
 public List <ProjectStepInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount)
 {
     return(ProjectStepInfo.GetPagedList(pPageIndex, pPageSize, pOrderBy, pSortExpression, out pRecordCount));
 }
예제 #20
0
 public object  SaveProjectStepInfo(ProjectStepInfo projectStepInfo)
 {
     projectStepInfo.Save();
     return(projectStepInfo.ProjectStepId);
 }
예제 #21
0
 public List <ProjectStepInfo> GetProjectStepInfoList()
 {
     return(ProjectStepInfo.GetList());
 }
예제 #22
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 /// <returns></returns>
 public static List<ProjectStepInfo> GetList()
 {
     string cacheKey = GetCacheKey();
     //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取
     if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)) && CachedEntityCommander.GetCache(cacheKey) != null)
     {
         return CachedEntityCommander.GetCache(cacheKey) as List< ProjectStepInfo>;
     }
     else
     {
         List< ProjectStepInfo>  list =new List< ProjectStepInfo>();
         ProjectStepCollection  collection=new  ProjectStepCollection();
         Query qry = new Query(ProjectStep.Schema);
         collection.LoadAndCloseReader(qry.ExecuteReader());
         foreach(ProjectStep projectStep in collection)
         {
             ProjectStepInfo projectStepInfo= new ProjectStepInfo();
             LoadFromDAL(projectStepInfo,projectStep);
             list.Add(projectStepInfo);
         }
       	//生成缓存
         if (CachedEntityCommander.IsTypeRegistered(typeof(ProjectStepInfo)))
         {
             CachedEntityCommander.SetCache(cacheKey, list);
         }
         return list;
     }
 }
예제 #23
0
        public void DeleteById(ProjectStepInfo pProjectStepInfo)
        {
            ProjectStepInfo projectStepInfo = new ProjectStepInfo(pProjectStepInfo.ProjectStepId);

            projectStepInfo.Delete();
        }
예제 #24
0
 public void DeleteById(ProjectStepInfo pProjectStepInfo)
 {
     ProjectStepInfo projectStepInfo = new ProjectStepInfo(pProjectStepInfo.ProjectStepId);
     projectStepInfo.Delete();
 }
예제 #25
0
 public object SaveProjectStepInfo(ProjectStepInfo projectStepInfo)
 {
     projectStepInfo.Save();
     return projectStepInfo . ProjectStepId;
 }