Пример #1
0
        /// <summary>
        /// 物资名称下拉框
        /// </summary>
        /// <param name="sw"></param>
        /// <returns></returns>
        public static string getnameSelectOption(DC_SUPPLIES_SW sw)
        {
            StringBuilder sb = new StringBuilder();
            DataTable     dt = BaseDT.DC_SUPPLIES.getDT(sw);

            if (sw.isShowAll == "1")
            {
                sb.AppendFormat("<option value=\"\">{0}</option>", "--所有--");
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string SUPID         = dt.Rows[i]["SUPID"].ToString();
                string DCSUPPROPNAME = DC_SUPPLIESPROPCls.getsupname(SUPID);
                string DCmodel       = DC_SUPPLIESPROPCls.getsupmodel(SUPID);
                if (string.IsNullOrEmpty(DCmodel) == false)
                {
                    sb.AppendFormat("<option value=\"{0}\">{1}【{2}】</option>", SUPID, DCSUPPROPNAME, DCmodel);
                }
                else
                {
                    sb.AppendFormat("<option value=\"{0}\">{1}</option>", SUPID, DCSUPPROPNAME);
                }
            }
            dt.Clear();
            dt.Dispose();
            return(sb.ToString());
        }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
        /// <summary>
        /// 获取物资表
        /// </summary>
        /// <param name="sw"></param>
        /// <returns></returns>
        public static IEnumerable <DC_SUPPLIES_Model> getModelList(DC_SUPPLIES_SW sw)
        {
            var       result = new List <DC_SUPPLIES_Model>();
            DataTable dt     = BaseDT.DC_SUPPLIES.getDT(sw);//列表

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DC_SUPPLIES_Model m = new DC_SUPPLIES_Model();
                m.DCSUPPLIESID  = dt.Rows[i]["DCSUPPLIESID"].ToString();
                m.REPID         = dt.Rows[i]["REPID"].ToString();
                m.SUPID         = dt.Rows[i]["SUPID"].ToString();
                m.SUPNAME       = DC_SUPPLIESPROPCls.getsupname(m.SUPID);
                m.DCSUPCOUNT    = dt.Rows[i]["DCSUPCOUNT"].ToString();
                m.EQUIPTYPEName = DC_EQUIP_NEWCls.getEQUIPTYPEName(m.DCSUPPLIESID);
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }