Beispiel #1
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="sw"></param>
        /// <returns></returns>
        public static IEnumerable <DC_EQUIP_NEW_Model> getModelList(DC_EQUIP_NEW_SW sw)
        {
            var result = new List <DC_EQUIP_NEW_Model>();

            DataTable dt = BaseDT.DC_EQUIP_NEW.getDT(sw);//列表

            DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                                               //获取单位
            DataTable dt32 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW {
                DICTTYPEID = "32"
            });                                                                              //数据中心装备类型
            DataTable dt36 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW {
                DICTTYPEID = "36"
            });                                                                              //使用现状

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DC_EQUIP_NEW_Model m = new DC_EQUIP_NEW_Model();

                m.DC_EQUIP_NEW_ID = dt.Rows[i]["DC_EQUIP_NEW_ID"].ToString();
                m.EQUIPTYPE       = dt.Rows[i]["EQUIPTYPE"].ToString();
                m.EQUIPTYPEName   = BaseDT.T_SYS_DICT.getName(dt32, m.EQUIPTYPE);
                m.NUMBER          = dt.Rows[i]["NUMBER"].ToString();
                m.NAME            = dt.Rows[i]["NAME"].ToString();
                m.BYORGNO         = dt.Rows[i]["BYORGNO"].ToString();
                m.ORGName         = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO);
                m.MODEL           = dt.Rows[i]["MODEL"].ToString();
                m.BUYYEAR         = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUYYEAR"].ToString());
                m.USESTATE        = dt.Rows[i]["USESTATE"].ToString();
                m.USESTATEName    = BaseDT.T_SYS_DICT.getName(dt36, m.USESTATE);
                m.STOREADDR       = dt.Rows[i]["STOREADDR"].ToString();
                m.MARK            = dt.Rows[i]["MARK"].ToString();
                m.JD            = dt.Rows[i]["JD"].ToString();
                m.WD            = dt.Rows[i]["WD"].ToString();
                m.WORTH         = dt.Rows[i]["WORTH"].ToString();
                m.EQUIPAMOUNT   = dt.Rows[i]["EQUIPAMOUNT"].ToString();
                m.REPID         = dt.Rows[i]["REPID"].ToString();
                m.DCSUPPROPUNIT = dt.Rows[i]["DCSUPPROPUNIT"].ToString();
                m.PRICE         = dt.Rows[i]["PRICE"].ToString();
                if (string.IsNullOrEmpty(m.REPID) == false)
                {
                    m.REPNAME = DC_REPOSITORYCls.getdepotname(m.REPID);
                }
                else
                {
                    m.REPNAME = "";
                }
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            dtORG.Clear();
            dtORG.Dispose();
            dt32.Clear();
            dt32.Dispose();
            dt36.Clear();
            dt36.Dispose();
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 获取列表分页
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public static IEnumerable <DC_DETAILS_Model> getModelPager(DC_DETAILS_SW sw, out int total)
        {
            var       result = new List <DC_DETAILS_Model>();
            DataTable dtUser = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW {
            });
            DataTable dt     = BaseDT.DC_DETAILS.getDT(sw, out total);//列表

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DC_DETAILS_Model m = new DC_DETAILS_Model();
                m.DCDETAILSID    = dt.Rows[i]["DCDETAILSID"].ToString();
                m.SUPID          = dt.Rows[i]["SUPID"].ToString();
                m.SUPNAME        = DC_SUPPLIESPROPCls.getsupname(m.SUPID);
                m.DCSUPPROPMODEL = BaseDT.DC_SUPPLIESPROP.getmodel(new DC_SUPPLIESPROP_SW {
                    DC_SUPPLIESPROP_ID = m.SUPID
                });
                m.DCSUPPROPUNIT = BaseDT.DC_SUPPLIESPROP.getunit(new DC_SUPPLIESPROP_SW {
                    DC_SUPPLIESPROP_ID = m.SUPID
                });
                m.REPID          = dt.Rows[i]["REPID"].ToString();
                m.DPNAME         = DC_REPOSITORYCls.getdepotname(m.REPID);
                m.DCREPTIME      = ClsSwitch.SwitDate(dt.Rows[i]["DCREPTIME"].ToString());;
                m.DCREPFLAG      = dt.Rows[i]["DCREPFLAG"].ToString();
                m.DCREPSUPCOUNT  = dt.Rows[i]["DCREPSUPCOUNT"].ToString();
                m.DCENTYMANID    = dt.Rows[i]["DCENTYMANID"].ToString();
                m.DCUSERID       = dt.Rows[i]["DCUSERID"].ToString();
                m.DCCUSTODIANID  = dt.Rows[i]["DCCUSTODIANID"].ToString();
                m.DCUSERORG      = dt.Rows[i]["DCUSERORG"].ToString();
                m.PRICE          = dt.Rows[i]["PRICE"].ToString();
                m.MARK           = dt.Rows[i]["MARK"].ToString();
                m.REPERTORYCOUNT = dt.Rows[i]["REPERTORYCOUNT"].ToString();
                m.DCFAFANGREN    = dt.Rows[i]["DCFAFANGREN"].ToString();
                m.DCZHIBIAOREN   = dt.Rows[i]["DCZHIBIAOREN"].ToString();
                //m.DCENTYMANNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCENTYMANID);
                //m.DCUSERNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCUSERID);
                //m.DCCUSTODIANNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCCUSTODIANID);
                m.NUMBER = dt.Rows[i]["NUMBER"].ToString();
                m.SUM    = (float.Parse(m.DCREPSUPCOUNT) * float.Parse(m.PRICE)).ToString("F2");
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            dtUser.Clear();
            dtUser.Dispose();
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// 根据查询条件获取某一条信息记录
        /// </summary>
        /// <param name="sw">参见模型</param>
        /// <returns>参见模型</returns>
        public static DC_DETAILS_Model getModel(DC_DETAILS_SW sw)
        {
            DataTable dt       = BaseDT.DC_DETAILS.getDT(sw);//列表
            DataTable dtUser   = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW {
            });
            DC_DETAILS_Model m = new DC_DETAILS_Model();

            if (dt.Rows.Count > 0)
            {
                int i = 0;
                m.DCDETAILSID    = dt.Rows[i]["DCDETAILSID"].ToString();
                m.SUPID          = dt.Rows[i]["SUPID"].ToString();
                m.SUPNAME        = DC_SUPPLIESPROPCls.getsupname(m.SUPID); //获取物资的名称
                m.REPID          = dt.Rows[i]["REPID"].ToString();
                m.DPNAME         = DC_REPOSITORYCls.getdepotname(m.REPID); //获取仓库的名称
                m.DCSUPPROPMODEL = BaseDT.DC_SUPPLIESPROP.getmodel(new DC_SUPPLIESPROP_SW {
                    DC_SUPPLIESPROP_ID = m.SUPID
                });                                                                                                         //获取物资的型号
                m.DCSUPPROPUNIT = BaseDT.DC_SUPPLIESPROP.getunit(new DC_SUPPLIESPROP_SW {
                    DC_SUPPLIESPROP_ID = m.SUPID
                });                                                       //获取物资的单位
                m.RESPONSIBLEMAN = DC_REPOSITORYCls.getdepotman(m.REPID); //获取仓库负责人
                m.DCREPTIME      = ClsSwitch.SwitDate(dt.Rows[i]["DCREPTIME"].ToString());;
                m.DCREPFLAG      = dt.Rows[i]["DCREPFLAG"].ToString();
                m.DCREPSUPCOUNT  = dt.Rows[i]["DCREPSUPCOUNT"].ToString();
                m.DCENTYMANID    = dt.Rows[i]["DCENTYMANID"].ToString();
                m.DCUSERID       = dt.Rows[i]["DCUSERID"].ToString();
                m.DCCUSTODIANID  = dt.Rows[i]["DCCUSTODIANID"].ToString();
                m.DCUSERORG      = dt.Rows[i]["DCUSERORG"].ToString();
                m.PRICE          = dt.Rows[i]["PRICE"].ToString();
                m.MARK           = dt.Rows[i]["MARK"].ToString();
                m.REPERTORYCOUNT = dt.Rows[i]["REPERTORYCOUNT"].ToString();
                m.DCFAFANGREN    = dt.Rows[i]["DCFAFANGREN"].ToString();
                m.DCZHIBIAOREN   = dt.Rows[i]["DCZHIBIAOREN"].ToString();
                m.NUMBER         = dt.Rows[i]["NUMBER"].ToString();
                //m.DCENTYMANNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCENTYMANID);
                //m.DCUSERNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCUSERID);
                //m.DCCUSTODIANNAME = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.DCCUSTODIANID);
                m.SUM = (float.Parse(m.DCREPSUPCOUNT) * float.Parse(m.PRICE)).ToString("F2");//金额
            }
            dt.Clear();
            dt.Dispose();
            return(m);
        }