Exemplo n.º 1
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 <ToolNumInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount)
        {
            if (pPageIndex <= 1)
            {
                pPageIndex = 1;
            }
            List <ToolNumInfo> list = new List <ToolNumInfo>();

            Query q = ToolNum.CreateQuery();

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

            collection.LoadAndCloseReader(q.ExecuteReader());

            foreach (ToolNum toolNum  in collection)
            {
                ToolNumInfo toolNumInfo = new ToolNumInfo();
                LoadFromDAL(toolNumInfo, toolNum);
                list.Add(toolNumInfo);
            }
            pRecordCount = q.GetRecordCount();

            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// <returns></returns>
        public static List <ToolNumInfo> GetList()
        {
            string cacheKey = GetCacheKey();

            //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取
            if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)) && CachedEntityCommander.GetCache(cacheKey) != null)
            {
                return(CachedEntityCommander.GetCache(cacheKey) as List <ToolNumInfo>);
            }
            else
            {
                List <ToolNumInfo> list       = new List <ToolNumInfo>();
                ToolNumCollection  collection = new  ToolNumCollection();
                Query qry = new Query(ToolNum.Schema);
                collection.LoadAndCloseReader(qry.ExecuteReader());
                foreach (ToolNum toolNum in collection)
                {
                    ToolNumInfo toolNumInfo = new ToolNumInfo();
                    LoadFromDAL(toolNumInfo, toolNum);
                    list.Add(toolNumInfo);
                }
                //生成缓存
                if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)))
                {
                    CachedEntityCommander.SetCache(cacheKey, list);
                }
                return(list);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 批量装载
 /// </summary>
 internal static void LoadFromDALPatch(List <ToolNumInfo> pList, ToolNumCollection pCollection)
 {
     foreach (ToolNum toolNum in pCollection)
     {
         ToolNumInfo toolNumInfo = new ToolNumInfo();
         LoadFromDAL(toolNumInfo, toolNum);
         pList.Add(toolNumInfo);
     }
 }
Exemplo n.º 4
0
        protected void PageInit()
        {
            int toolid = Convert.ToInt32(Request["ToolApplyId"].ToString());
            ToolInfo tool = new ToolInfo(toolid);
            txtMarketMemo.Text = tool.MarketMemo.ToString();
            txtTechMemo.Text = tool.TechMemo.ToString();
            txtHrMemo.Text = tool.ZongHeMemo.ToString();
            lblDepartName.Text = tool.DepartName.ToString();
            lblDepartView.Text = tool.DepartView.ToString();
            lblManagerView.Text = tool.ManagerView.ToString();

            ToolNumInfo toolnum = new ToolNumInfo(Convert.ToInt32(tool.ToolNumId));
            lbl1.Text = toolnum.Num1.ToString();
            lbl2.Text = toolnum.Num2.ToString();
            lbl3.Text = toolnum.Num3.ToString();
            lbl4.Text = toolnum.Num4.ToString();
            lbl5.Text = toolnum.Num5.ToString();
            lbl6.Text = toolnum.Num6.ToString();
            lbl7.Text = toolnum.Num7.ToString();
            lbl8.Text = toolnum.Num8.ToString();
            lbl9.Text = toolnum.Num9.ToString();
            lbl10.Text = toolnum.Num10.ToString();
            lbl11.Text = toolnum.Num11.ToString();
            lbl12.Text = toolnum.Num12.ToString();
            lbl13.Text = toolnum.Num13.ToString();
            lbl14.Text = toolnum.Num14.ToString();
            lbl15.Text = toolnum.Num15.ToString();
            lbl16.Text = toolnum.Num16.ToString();
            lbl17.Text = toolnum.Num17.ToString();
            lbl18.Text = toolnum.Num18.ToString();
            lbl19.Text = toolnum.Num19.ToString();
            lbl20.Text = toolnum.Num20.ToString();
            lbl21.Text = toolnum.Num21.ToString();
            lbl22.Text = toolnum.Num22.ToString();
            lbl23.Text = toolnum.Num23.ToString();
            lbl24.Text = toolnum.Num24.ToString();
            lbl25.Text = toolnum.Num25.ToString();
            lbl26.Text = toolnum.Num26.ToString();
            lbl27.Text = toolnum.Num27.ToString();
            lbl28.Text = toolnum.Num28.ToString();
            lbl29.Text = toolnum.Num29.ToString();
            lbl30.Text = toolnum.Num30.ToString();
            lbl31.Text = toolnum.Num31.ToString();
            lbl32.Text = toolnum.Num32.ToString();
            lbl33.Text = toolnum.Num33.ToString();
            lbl34.Text = toolnum.Num34.ToString();
            lbl35.Text = toolnum.Num35.ToString();
            lbl36.Text = toolnum.Num36.ToString();
            lbl37.Text = toolnum.Num37.ToString();
            lbl38.Text = toolnum.Num38.ToString();
            lbl39.Text = toolnum.Num39.ToString();
            lbl40.Text = toolnum.Num40.ToString();
        }
Exemplo n.º 5
0
        public ToolNumInfo GetToolNumInfoById(int ToolNumId)
        {
            ToolNumInfo toolNumInfo  = null;//
            try
            {
                 toolNumInfo = new ToolNumInfo(ToolNumId);

            }
            catch (AppException)
            {
                return null;
            }

            return  toolNumInfo;
        }
Exemplo n.º 6
0
        public ToolNumInfo GetToolNumInfoById(int ToolNumId)
        {
            ToolNumInfo toolNumInfo = null;             //

            try
            {
                toolNumInfo = new ToolNumInfo(ToolNumId);
            }
            catch (AppException)
            {
                return(null);
            }

            return(toolNumInfo);
        }
Exemplo n.º 7
0
 //从后台获取数据
 internal static void  LoadFromDAL(ToolNumInfo pToolNumInfo, ToolNum pToolNum)
 {
     pToolNumInfo.toolNumId = pToolNum.ToolNumId;
     pToolNumInfo.num1      = pToolNum.Num1;
     pToolNumInfo.num2      = pToolNum.Num2;
     pToolNumInfo.num3      = pToolNum.Num3;
     pToolNumInfo.num4      = pToolNum.Num4;
     pToolNumInfo.num5      = pToolNum.Num5;
     pToolNumInfo.num6      = pToolNum.Num6;
     pToolNumInfo.num7      = pToolNum.Num7;
     pToolNumInfo.num8      = pToolNum.Num8;
     pToolNumInfo.num9      = pToolNum.Num9;
     pToolNumInfo.num10     = pToolNum.Num10;
     pToolNumInfo.num11     = pToolNum.Num11;
     pToolNumInfo.num12     = pToolNum.Num12;
     pToolNumInfo.num13     = pToolNum.Num13;
     pToolNumInfo.num14     = pToolNum.Num14;
     pToolNumInfo.num15     = pToolNum.Num15;
     pToolNumInfo.num16     = pToolNum.Num16;
     pToolNumInfo.num17     = pToolNum.Num17;
     pToolNumInfo.num18     = pToolNum.Num18;
     pToolNumInfo.num19     = pToolNum.Num19;
     pToolNumInfo.num20     = pToolNum.Num20;
     pToolNumInfo.num21     = pToolNum.Num21;
     pToolNumInfo.num22     = pToolNum.Num22;
     pToolNumInfo.num23     = pToolNum.Num23;
     pToolNumInfo.num24     = pToolNum.Num24;
     pToolNumInfo.num25     = pToolNum.Num25;
     pToolNumInfo.num26     = pToolNum.Num26;
     pToolNumInfo.num27     = pToolNum.Num27;
     pToolNumInfo.num28     = pToolNum.Num28;
     pToolNumInfo.num29     = pToolNum.Num29;
     pToolNumInfo.num30     = pToolNum.Num30;
     pToolNumInfo.num31     = pToolNum.Num31;
     pToolNumInfo.num32     = pToolNum.Num32;
     pToolNumInfo.num33     = pToolNum.Num33;
     pToolNumInfo.num34     = pToolNum.Num34;
     pToolNumInfo.num35     = pToolNum.Num35;
     pToolNumInfo.num36     = pToolNum.Num36;
     pToolNumInfo.num37     = pToolNum.Num37;
     pToolNumInfo.num38     = pToolNum.Num38;
     pToolNumInfo.num39     = pToolNum.Num39;
     pToolNumInfo.num40     = pToolNum.Num40;
     pToolNumInfo.Loaded    = true;
 }
Exemplo n.º 8
0
 /// <summary>
 /// 复制一个对象,采用硬编码的方式,避免反射的低效
 /// </summary>
 /// <param name="pIndustryTypeInfoFrom"></param>
 /// <param name="pIndustryTypeInfoTo"></param>
 public static void Copy(ToolNumInfo pToolNumInfoFrom, ToolNumInfo pToolNumInfoTo)
 {
     pToolNumInfoTo.ToolNumId = pToolNumInfoFrom.toolNumId;
     pToolNumInfoTo.Num1      = pToolNumInfoFrom.num1;
     pToolNumInfoTo.Num2      = pToolNumInfoFrom.num2;
     pToolNumInfoTo.Num3      = pToolNumInfoFrom.num3;
     pToolNumInfoTo.Num4      = pToolNumInfoFrom.num4;
     pToolNumInfoTo.Num5      = pToolNumInfoFrom.num5;
     pToolNumInfoTo.Num6      = pToolNumInfoFrom.num6;
     pToolNumInfoTo.Num7      = pToolNumInfoFrom.num7;
     pToolNumInfoTo.Num8      = pToolNumInfoFrom.num8;
     pToolNumInfoTo.Num9      = pToolNumInfoFrom.num9;
     pToolNumInfoTo.Num10     = pToolNumInfoFrom.num10;
     pToolNumInfoTo.Num11     = pToolNumInfoFrom.num11;
     pToolNumInfoTo.Num12     = pToolNumInfoFrom.num12;
     pToolNumInfoTo.Num13     = pToolNumInfoFrom.num13;
     pToolNumInfoTo.Num14     = pToolNumInfoFrom.num14;
     pToolNumInfoTo.Num15     = pToolNumInfoFrom.num15;
     pToolNumInfoTo.Num16     = pToolNumInfoFrom.num16;
     pToolNumInfoTo.Num17     = pToolNumInfoFrom.num17;
     pToolNumInfoTo.Num18     = pToolNumInfoFrom.num18;
     pToolNumInfoTo.Num19     = pToolNumInfoFrom.num19;
     pToolNumInfoTo.Num20     = pToolNumInfoFrom.num20;
     pToolNumInfoTo.Num21     = pToolNumInfoFrom.num21;
     pToolNumInfoTo.Num22     = pToolNumInfoFrom.num22;
     pToolNumInfoTo.Num23     = pToolNumInfoFrom.num23;
     pToolNumInfoTo.Num24     = pToolNumInfoFrom.num24;
     pToolNumInfoTo.Num25     = pToolNumInfoFrom.num25;
     pToolNumInfoTo.Num26     = pToolNumInfoFrom.num26;
     pToolNumInfoTo.Num27     = pToolNumInfoFrom.num27;
     pToolNumInfoTo.Num28     = pToolNumInfoFrom.num28;
     pToolNumInfoTo.Num29     = pToolNumInfoFrom.num29;
     pToolNumInfoTo.Num30     = pToolNumInfoFrom.num30;
     pToolNumInfoTo.Num31     = pToolNumInfoFrom.num31;
     pToolNumInfoTo.Num32     = pToolNumInfoFrom.num32;
     pToolNumInfoTo.Num33     = pToolNumInfoFrom.num33;
     pToolNumInfoTo.Num34     = pToolNumInfoFrom.num34;
     pToolNumInfoTo.Num35     = pToolNumInfoFrom.num35;
     pToolNumInfoTo.Num36     = pToolNumInfoFrom.num36;
     pToolNumInfoTo.Num37     = pToolNumInfoFrom.num37;
     pToolNumInfoTo.Num38     = pToolNumInfoFrom.num38;
     pToolNumInfoTo.Num39     = pToolNumInfoFrom.num39;
     pToolNumInfoTo.Num40     = pToolNumInfoFrom.num40;
     pToolNumInfoTo.Loaded    = pToolNumInfoFrom.Loaded;
 }
Exemplo n.º 9
0
 private void LoadFromId(int toolNumId)
 {
     if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)))
     {
         ToolNumInfo toolNumInfo = Find(GetList(), toolNumId);
         if (toolNumInfo == null)
         {
             throw new AppException("未能在缓存中找到相应的键值对象");
         }
         Copy(toolNumInfo, this);
     }
     else
     {
         ToolNum toolNum = new ToolNum(toolNumId);
         if (toolNum.IsNew)
         {
             throw new AppException("尚未初始化");
         }
         LoadFromDAL(this, toolNum);
     }
 }
Exemplo n.º 10
0
        public void DeleteById(ToolNumInfo pToolNumInfo)
        {
            ToolNumInfo toolNumInfo = new ToolNumInfo(pToolNumInfo.ToolNumId);

            toolNumInfo.Delete();
        }
Exemplo n.º 11
0
        protected void PageInit()
        {
            int toolid = Convert.ToInt32(Request["ToolApplyId"].ToString());
            ToolInfo tool = new ToolInfo(toolid);

            txtMarketMemo.Text = tool.MarketMemo.ToString();
            txtTechMemo.Text = tool.TechMemo.ToString();
            txtHrMemo.Text = tool.ZongHeMemo.ToString();
            txtDepartView.Text = tool.DepartView.ToString();
            lblDepartName.Text = tool.DepartName.ToString();

            ToolNumInfo toolnum = new ToolNumInfo(Convert.ToInt32(tool.ToolNumId));
            txt1.Text = toolnum.Num1.ToString();
            txt2.Text = toolnum.Num2.ToString();
            txt3.Text = toolnum.Num3.ToString();
            txt4.Text = toolnum.Num4.ToString();
            txt5.Text = toolnum.Num5.ToString();
            txt6.Text = toolnum.Num6.ToString();
            txt7.Text = toolnum.Num7.ToString();
            txt8.Text = toolnum.Num8.ToString();
            txt9.Text = toolnum.Num9.ToString();
            txt10.Text = toolnum.Num10.ToString();
            txt11.Text = toolnum.Num11.ToString();
            txt12.Text = toolnum.Num12.ToString();
            txt13.Text = toolnum.Num13.ToString();
            txt14.Text = toolnum.Num14.ToString();
            txt15.Text = toolnum.Num15.ToString();
            txt16.Text = toolnum.Num16.ToString();
            txt17.Text = toolnum.Num17.ToString();
            txt18.Text = toolnum.Num18.ToString();
            txt19.Text = toolnum.Num19.ToString();
            txt20.Text = toolnum.Num20.ToString();
            txt21.Text = toolnum.Num21.ToString();
            txt22.Text = toolnum.Num22.ToString();
            txt23.Text = toolnum.Num23.ToString();
            txt24.Text = toolnum.Num24.ToString();
            txt25.Text = toolnum.Num25.ToString();
            txt26.Text = toolnum.Num26.ToString();
            txt27.Text = toolnum.Num27.ToString();
            txt28.Text = toolnum.Num28.ToString();
            txt29.Text = toolnum.Num29.ToString();
            txt30.Text = toolnum.Num30.ToString();
            txt31.Text = toolnum.Num31.ToString();
            txt32.Text = toolnum.Num32.ToString();
            txt33.Text = toolnum.Num33.ToString();
            txt34.Text = toolnum.Num34.ToString();
            txt35.Text = toolnum.Num35.ToString();
            txt36.Text = toolnum.Num36.ToString();
            txt37.Text = toolnum.Num37.ToString();
            txt38.Text = toolnum.Num38.ToString();
            txt39.Text = toolnum.Num39.ToString();
            txt40.Text = toolnum.Num40.ToString();
        }
Exemplo n.º 12
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
                {

                    int toolid = Convert.ToInt32(Request["ToolApplyId"].ToString());
                        ToolInfo tool = new ToolInfo(toolid);

                        ToolNumInfo toolnum = new ToolNumInfo(Convert.ToInt32(tool.ToolNumId));
                        toolnum.Num1 = txt1.Text.ToString();
                        toolnum.Num2 = txt2.Text.ToString();
                        toolnum.Num3 = txt3.Text.ToString();
                        toolnum.Num4 = txt4.Text.ToString();
                        toolnum.Num5 = txt5.Text.ToString();
                        toolnum.Num6 = txt6.Text.ToString();
                        toolnum.Num7 = txt7.Text.ToString();
                        toolnum.Num8 = txt8.Text.ToString();
                        toolnum.Num9 = txt9.Text.ToString();
                        toolnum.Num10 = txt10.Text.ToString();
                        toolnum.Num11 = txt11.Text.ToString();
                        toolnum.Num12 = txt12.Text.ToString();
                        toolnum.Num13 = txt13.Text.ToString();
                        toolnum.Num14 = txt14.Text.ToString();
                        toolnum.Num15 = txt15.Text.ToString();
                        toolnum.Num16 = txt16.Text.ToString();
                        toolnum.Num17 = txt17.Text.ToString();
                        toolnum.Num18 = txt18.Text.ToString();
                        toolnum.Num19 = txt19.Text.ToString();
                        toolnum.Num20 = txt20.Text.ToString();
                        toolnum.Num21 = txt21.Text.ToString();
                        toolnum.Num22 = txt22.Text.ToString();
                        toolnum.Num23 = txt23.Text.ToString();
                        toolnum.Num24 = txt24.Text.ToString();
                        toolnum.Num25 = txt25.Text.ToString();
                        toolnum.Num26 = txt26.Text.ToString();
                        toolnum.Num27 = txt27.Text.ToString();
                        toolnum.Num28 = txt28.Text.ToString();
                        toolnum.Num29 = txt29.Text.ToString();
                        toolnum.Num30 = txt30.Text.ToString();
                        toolnum.Num31 = txt31.Text.ToString();
                        toolnum.Num32 = txt32.Text.ToString();
                        toolnum.Num33 = txt33.Text.ToString();
                        toolnum.Num34 = txt34.Text.ToString();
                        toolnum.Num35 = txt35.Text.ToString();
                        toolnum.Num36 = txt36.Text.ToString();
                        toolnum.Num37 = txt37.Text.ToString();
                        toolnum.Num38 = txt38.Text.ToString();
                        toolnum.Num39 = txt39.Text.ToString();
                        toolnum.Num40 = txt40.Text.ToString();
                        toolnum.Save();

                        tool.MarketMemo = txtMarketMemo.Text.ToString();
                        tool.TechMemo = txtTechMemo.Text.ToString();
                        tool.ZongHeMemo = txtHrMemo.Text.ToString();
                        tool.DepartView = txtDepartView.Text.ToString();
                        tool.Save();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('����ɹ���');</script>");

                }
                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true);
                }
        }
Exemplo n.º 13
0
 public object SaveToolNumInfo(ToolNumInfo toolNumInfo)
 {
     toolNumInfo.Save();
     return toolNumInfo . ToolNumId;
 }
Exemplo n.º 14
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<ToolNumInfo> GetPagedList(int pPageIndex,int pPageSize,SortDirection pOrderBy,string pSortExpression,out int pRecordCount)
        {
            if(pPageIndex<=1)
            pPageIndex=1;
            List< ToolNumInfo> list = new List< ToolNumInfo>();

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

            foreach (ToolNum  toolNum  in collection)
            {
                ToolNumInfo toolNumInfo = new ToolNumInfo();
                LoadFromDAL(toolNumInfo,   toolNum);
                list.Add(toolNumInfo);
            }
            pRecordCount=q.GetRecordCount();

            return list;
        }
Exemplo n.º 15
0
 public void DeleteById(ToolNumInfo pToolNumInfo)
 {
     ToolNumInfo toolNumInfo = new ToolNumInfo(pToolNumInfo.ToolNumId);
     toolNumInfo.Delete();
 }
Exemplo n.º 16
0
 /// <summary>
 /// 复制为另一个对象
 /// </summary>
 /// <param name="pIndustryTypeInfoTo"></param>
 public void CopyTo(ToolNumInfo pToolNumInfoTo)
 {
     Copy(this, pToolNumInfoTo);
 }
Exemplo n.º 17
0
 //从后台获取数据
 internal static void LoadFromDAL(ToolNumInfo pToolNumInfo, ToolNum  pToolNum)
 {
     pToolNumInfo.toolNumId = pToolNum.ToolNumId;
      		pToolNumInfo.num1 = pToolNum.Num1;
      		pToolNumInfo.num2 = pToolNum.Num2;
      		pToolNumInfo.num3 = pToolNum.Num3;
      		pToolNumInfo.num4 = pToolNum.Num4;
      		pToolNumInfo.num5 = pToolNum.Num5;
      		pToolNumInfo.num6 = pToolNum.Num6;
      		pToolNumInfo.num7 = pToolNum.Num7;
      		pToolNumInfo.num8 = pToolNum.Num8;
      		pToolNumInfo.num9 = pToolNum.Num9;
      		pToolNumInfo.num10 = pToolNum.Num10;
      		pToolNumInfo.num11 = pToolNum.Num11;
      		pToolNumInfo.num12 = pToolNum.Num12;
      		pToolNumInfo.num13 = pToolNum.Num13;
      		pToolNumInfo.num14 = pToolNum.Num14;
      		pToolNumInfo.num15 = pToolNum.Num15;
      		pToolNumInfo.num16 = pToolNum.Num16;
      		pToolNumInfo.num17 = pToolNum.Num17;
      		pToolNumInfo.num18 = pToolNum.Num18;
      		pToolNumInfo.num19 = pToolNum.Num19;
      		pToolNumInfo.num20 = pToolNum.Num20;
      		pToolNumInfo.num21 = pToolNum.Num21;
      		pToolNumInfo.num22 = pToolNum.Num22;
      		pToolNumInfo.num23 = pToolNum.Num23;
      		pToolNumInfo.num24 = pToolNum.Num24;
      		pToolNumInfo.num25 = pToolNum.Num25;
      		pToolNumInfo.num26 = pToolNum.Num26;
      		pToolNumInfo.num27 = pToolNum.Num27;
      		pToolNumInfo.num28 = pToolNum.Num28;
      		pToolNumInfo.num29 = pToolNum.Num29;
      		pToolNumInfo.num30 = pToolNum.Num30;
      		pToolNumInfo.num31 = pToolNum.Num31;
      		pToolNumInfo.num32 = pToolNum.Num32;
      		pToolNumInfo.num33 = pToolNum.Num33;
      		pToolNumInfo.num34 = pToolNum.Num34;
      		pToolNumInfo.num35 = pToolNum.Num35;
      		pToolNumInfo.num36 = pToolNum.Num36;
      		pToolNumInfo.num37 = pToolNum.Num37;
      		pToolNumInfo.num38 = pToolNum.Num38;
      		pToolNumInfo.num39 = pToolNum.Num39;
      		pToolNumInfo.num40 = pToolNum.Num40;
     pToolNumInfo.Loaded=true;
 }
Exemplo n.º 18
0
 /// <summary>
 /// 复制一个对象,采用硬编码的方式,避免反射的低效
 /// </summary>
 /// <param name="pIndustryTypeInfoFrom"></param>
 /// <param name="pIndustryTypeInfoTo"></param>
 public static void Copy(ToolNumInfo pToolNumInfoFrom, ToolNumInfo pToolNumInfoTo)
 {
     pToolNumInfoTo.ToolNumId = pToolNumInfoFrom.toolNumId;
      		pToolNumInfoTo.Num1 = pToolNumInfoFrom.num1;
      		pToolNumInfoTo.Num2 = pToolNumInfoFrom.num2;
      		pToolNumInfoTo.Num3 = pToolNumInfoFrom.num3;
      		pToolNumInfoTo.Num4 = pToolNumInfoFrom.num4;
      		pToolNumInfoTo.Num5 = pToolNumInfoFrom.num5;
      		pToolNumInfoTo.Num6 = pToolNumInfoFrom.num6;
      		pToolNumInfoTo.Num7 = pToolNumInfoFrom.num7;
      		pToolNumInfoTo.Num8 = pToolNumInfoFrom.num8;
      		pToolNumInfoTo.Num9 = pToolNumInfoFrom.num9;
      		pToolNumInfoTo.Num10 = pToolNumInfoFrom.num10;
      		pToolNumInfoTo.Num11 = pToolNumInfoFrom.num11;
      		pToolNumInfoTo.Num12 = pToolNumInfoFrom.num12;
      		pToolNumInfoTo.Num13 = pToolNumInfoFrom.num13;
      		pToolNumInfoTo.Num14 = pToolNumInfoFrom.num14;
      		pToolNumInfoTo.Num15 = pToolNumInfoFrom.num15;
      		pToolNumInfoTo.Num16 = pToolNumInfoFrom.num16;
      		pToolNumInfoTo.Num17 = pToolNumInfoFrom.num17;
      		pToolNumInfoTo.Num18 = pToolNumInfoFrom.num18;
      		pToolNumInfoTo.Num19 = pToolNumInfoFrom.num19;
      		pToolNumInfoTo.Num20 = pToolNumInfoFrom.num20;
      		pToolNumInfoTo.Num21 = pToolNumInfoFrom.num21;
      		pToolNumInfoTo.Num22 = pToolNumInfoFrom.num22;
      		pToolNumInfoTo.Num23 = pToolNumInfoFrom.num23;
      		pToolNumInfoTo.Num24 = pToolNumInfoFrom.num24;
      		pToolNumInfoTo.Num25 = pToolNumInfoFrom.num25;
      		pToolNumInfoTo.Num26 = pToolNumInfoFrom.num26;
      		pToolNumInfoTo.Num27 = pToolNumInfoFrom.num27;
      		pToolNumInfoTo.Num28 = pToolNumInfoFrom.num28;
      		pToolNumInfoTo.Num29 = pToolNumInfoFrom.num29;
      		pToolNumInfoTo.Num30 = pToolNumInfoFrom.num30;
      		pToolNumInfoTo.Num31 = pToolNumInfoFrom.num31;
      		pToolNumInfoTo.Num32 = pToolNumInfoFrom.num32;
      		pToolNumInfoTo.Num33 = pToolNumInfoFrom.num33;
      		pToolNumInfoTo.Num34 = pToolNumInfoFrom.num34;
      		pToolNumInfoTo.Num35 = pToolNumInfoFrom.num35;
      		pToolNumInfoTo.Num36 = pToolNumInfoFrom.num36;
      		pToolNumInfoTo.Num37 = pToolNumInfoFrom.num37;
      		pToolNumInfoTo.Num38 = pToolNumInfoFrom.num38;
      		pToolNumInfoTo.Num39 = pToolNumInfoFrom.num39;
      		pToolNumInfoTo.Num40 = pToolNumInfoFrom.num40;
     pToolNumInfoTo.Loaded=pToolNumInfoFrom.Loaded;
 }
Exemplo n.º 19
0
 public List <ToolNumInfo> GetPagedList(int pPageIndex, int pPageSize, SortDirection pOrderBy, string pSortExpression, out int pRecordCount)
 {
     return(ToolNumInfo.GetPagedList(pPageIndex, pPageSize, pOrderBy, pSortExpression, out pRecordCount));
 }
Exemplo n.º 20
0
 /// <summary>
 /// 批量装载
 /// </summary>
 internal static void LoadFromDALPatch(List< ToolNumInfo> pList, ToolNumCollection pCollection)
 {
     foreach (ToolNum toolNum in pCollection)
     {
         ToolNumInfo toolNumInfo = new ToolNumInfo();
         LoadFromDAL(toolNumInfo, toolNum );
         pList.Add(toolNumInfo);
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 /// <returns></returns>
 public static List<ToolNumInfo> GetList()
 {
     string cacheKey = GetCacheKey();
     //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取
     if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)) && CachedEntityCommander.GetCache(cacheKey) != null)
     {
         return CachedEntityCommander.GetCache(cacheKey) as List< ToolNumInfo>;
     }
     else
     {
         List< ToolNumInfo>  list =new List< ToolNumInfo>();
         ToolNumCollection  collection=new  ToolNumCollection();
         Query qry = new Query(ToolNum.Schema);
         collection.LoadAndCloseReader(qry.ExecuteReader());
         foreach(ToolNum toolNum in collection)
         {
             ToolNumInfo toolNumInfo= new ToolNumInfo();
             LoadFromDAL(toolNumInfo,toolNum);
             list.Add(toolNumInfo);
         }
       	//生成缓存
         if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)))
         {
             CachedEntityCommander.SetCache(cacheKey, list);
         }
         return list;
     }
 }
Exemplo n.º 22
0
 /// <summary>
 /// 复制为另一个对象
 /// </summary>
 /// <param name="pIndustryTypeInfoTo"></param>
 public void CopyTo(ToolNumInfo pToolNumInfoTo)
 {
     Copy(this,  pToolNumInfoTo);
 }
Exemplo n.º 23
0
 public List <ToolNumInfo> GetToolNumInfoList()
 {
     return(ToolNumInfo.GetList());
 }
Exemplo n.º 24
0
 //数据持久化
 internal static void SaveToDb(ToolNumInfo pToolNumInfo, ToolNum  pToolNum,bool pIsNew)
 {
     pToolNum.ToolNumId = pToolNumInfo.toolNumId;
      		pToolNum.Num1 = pToolNumInfo.num1;
      		pToolNum.Num2 = pToolNumInfo.num2;
      		pToolNum.Num3 = pToolNumInfo.num3;
      		pToolNum.Num4 = pToolNumInfo.num4;
      		pToolNum.Num5 = pToolNumInfo.num5;
      		pToolNum.Num6 = pToolNumInfo.num6;
      		pToolNum.Num7 = pToolNumInfo.num7;
      		pToolNum.Num8 = pToolNumInfo.num8;
      		pToolNum.Num9 = pToolNumInfo.num9;
      		pToolNum.Num10 = pToolNumInfo.num10;
      		pToolNum.Num11 = pToolNumInfo.num11;
      		pToolNum.Num12 = pToolNumInfo.num12;
      		pToolNum.Num13 = pToolNumInfo.num13;
      		pToolNum.Num14 = pToolNumInfo.num14;
      		pToolNum.Num15 = pToolNumInfo.num15;
      		pToolNum.Num16 = pToolNumInfo.num16;
      		pToolNum.Num17 = pToolNumInfo.num17;
      		pToolNum.Num18 = pToolNumInfo.num18;
      		pToolNum.Num19 = pToolNumInfo.num19;
      		pToolNum.Num20 = pToolNumInfo.num20;
      		pToolNum.Num21 = pToolNumInfo.num21;
      		pToolNum.Num22 = pToolNumInfo.num22;
      		pToolNum.Num23 = pToolNumInfo.num23;
      		pToolNum.Num24 = pToolNumInfo.num24;
      		pToolNum.Num25 = pToolNumInfo.num25;
      		pToolNum.Num26 = pToolNumInfo.num26;
      		pToolNum.Num27 = pToolNumInfo.num27;
      		pToolNum.Num28 = pToolNumInfo.num28;
      		pToolNum.Num29 = pToolNumInfo.num29;
      		pToolNum.Num30 = pToolNumInfo.num30;
      		pToolNum.Num31 = pToolNumInfo.num31;
      		pToolNum.Num32 = pToolNumInfo.num32;
      		pToolNum.Num33 = pToolNumInfo.num33;
      		pToolNum.Num34 = pToolNumInfo.num34;
      		pToolNum.Num35 = pToolNumInfo.num35;
      		pToolNum.Num36 = pToolNumInfo.num36;
      		pToolNum.Num37 = pToolNumInfo.num37;
      		pToolNum.Num38 = pToolNumInfo.num38;
      		pToolNum.Num39 = pToolNumInfo.num39;
      		pToolNum.Num40 = pToolNumInfo.num40;
     pToolNum.IsNew=pIsNew;
     string UserName = SubsonicHelper.GetUserName();
     try
     {
         pToolNum.Save(UserName);
     }
     catch(Exception ex)
     {
         LogManager.getInstance().getLogger(typeof(ToolNumInfo)).Error(ex);
         if(ex.Message.Contains("插入重复键"))//违反了唯一键
         {
             throw new AppException("此对象已经存在");//此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示
         }
         throw new AppException("保存失败");
     }
     pToolNumInfo.toolNumId = pToolNum.ToolNumId;
     //如果缓存存在,更新缓存
     if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)))
     {
         ResetCache();
     }
 }
Exemplo n.º 25
0
 public object  SaveToolNumInfo(ToolNumInfo toolNumInfo)
 {
     toolNumInfo.Save();
     return(toolNumInfo.ToolNumId);
 }
Exemplo n.º 26
0
        //数据持久化
        internal static void  SaveToDb(ToolNumInfo pToolNumInfo, ToolNum pToolNum, bool pIsNew)
        {
            pToolNum.ToolNumId = pToolNumInfo.toolNumId;
            pToolNum.Num1      = pToolNumInfo.num1;
            pToolNum.Num2      = pToolNumInfo.num2;
            pToolNum.Num3      = pToolNumInfo.num3;
            pToolNum.Num4      = pToolNumInfo.num4;
            pToolNum.Num5      = pToolNumInfo.num5;
            pToolNum.Num6      = pToolNumInfo.num6;
            pToolNum.Num7      = pToolNumInfo.num7;
            pToolNum.Num8      = pToolNumInfo.num8;
            pToolNum.Num9      = pToolNumInfo.num9;
            pToolNum.Num10     = pToolNumInfo.num10;
            pToolNum.Num11     = pToolNumInfo.num11;
            pToolNum.Num12     = pToolNumInfo.num12;
            pToolNum.Num13     = pToolNumInfo.num13;
            pToolNum.Num14     = pToolNumInfo.num14;
            pToolNum.Num15     = pToolNumInfo.num15;
            pToolNum.Num16     = pToolNumInfo.num16;
            pToolNum.Num17     = pToolNumInfo.num17;
            pToolNum.Num18     = pToolNumInfo.num18;
            pToolNum.Num19     = pToolNumInfo.num19;
            pToolNum.Num20     = pToolNumInfo.num20;
            pToolNum.Num21     = pToolNumInfo.num21;
            pToolNum.Num22     = pToolNumInfo.num22;
            pToolNum.Num23     = pToolNumInfo.num23;
            pToolNum.Num24     = pToolNumInfo.num24;
            pToolNum.Num25     = pToolNumInfo.num25;
            pToolNum.Num26     = pToolNumInfo.num26;
            pToolNum.Num27     = pToolNumInfo.num27;
            pToolNum.Num28     = pToolNumInfo.num28;
            pToolNum.Num29     = pToolNumInfo.num29;
            pToolNum.Num30     = pToolNumInfo.num30;
            pToolNum.Num31     = pToolNumInfo.num31;
            pToolNum.Num32     = pToolNumInfo.num32;
            pToolNum.Num33     = pToolNumInfo.num33;
            pToolNum.Num34     = pToolNumInfo.num34;
            pToolNum.Num35     = pToolNumInfo.num35;
            pToolNum.Num36     = pToolNumInfo.num36;
            pToolNum.Num37     = pToolNumInfo.num37;
            pToolNum.Num38     = pToolNumInfo.num38;
            pToolNum.Num39     = pToolNumInfo.num39;
            pToolNum.Num40     = pToolNumInfo.num40;
            pToolNum.IsNew     = pIsNew;
            string UserName = SubsonicHelper.GetUserName();

            try
            {
                pToolNum.Save(UserName);
            }
            catch (Exception ex)
            {
                LogManager.getInstance().getLogger(typeof(ToolNumInfo)).Error(ex);
                if (ex.Message.Contains("插入重复键"))               //违反了唯一键
                {
                    throw new AppException("此对象已经存在");          //此处等待优化可以从唯一约束中直接取出提示来,如果没有的话,默认为原始的出错提示
                }
                throw new AppException("保存失败");
            }
            pToolNumInfo.toolNumId = pToolNum.ToolNumId;
            //如果缓存存在,更新缓存
            if (CachedEntityCommander.IsTypeRegistered(typeof(ToolNumInfo)))
            {
                ResetCache();
            }
        }