예제 #1
0
        /// <summary>
        /// 通过成品Id获取成品报表详情
        /// </summary>
        /// <param name="id"> 成品 Id</param>
        /// <returns></returns>
        private VM_Report_Product getProductDetailById(int id)
        {
            var vmPd            = new VM_Report_Product();
            var bllPd           = new MesWeb.BLL.T_Report_Product();
            var bllReportStd    = new MesWeb.BLL.T_Report_Product_Standard();
            var bllReportActual = new MesWeb.BLL.T_Report_Product_Actual();
            var pd = bllPd.GetModel(id);

            if (pd != null)
            {
                try {
                    vmPd.updateReportProduct(pd);
                    if (pd.StandardId.Value > 0)
                    {
                        var std = bllReportStd.GetModel(pd.StandardId.Value);
                        vmPd.updateReportStd(std);
                    }
                    if (pd.ActualId.Value > 0)
                    {
                        var actual = bllReportActual.GetModel(pd.ActualId.Value);
                        vmPd.updateReportActual(actual);
                    }
                } catch (Exception e) {
                    log = LogFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.FullName + ":" + MethodBase.GetCurrentMethod().Name);
                    log.Error(e);
                }
            }
            return(vmPd);
        }
예제 #2
0
        public ActionResult SearchProductByVolNumAction(string volNum)
        {
            var retData         = new VM_Result_Data();
            var vmPd            = new VM_Report_Product();
            var bllReportStd    = new MesWeb.BLL.T_Report_Product_Standard();
            var bllReportActual = new MesWeb.BLL.T_Report_Product_Actual();

            retData.Content = "查询成品报表失败";
            var bllPd = new MesWeb.BLL.T_Report_Product();
            var pd    = bllPd.GetModelList("VolNum = '" + volNum + "'").FirstOrDefault();

            if (pd != null)
            {
                try {
                    vmPd.updateReportProduct(pd);

                    if (pd.StandardId.Value > 0)
                    {
                        var std = bllReportStd.GetModel(pd.StandardId.Value);
                        vmPd.updateReportStd(std);
                    }
                    if (pd.ActualId.Value > 0)
                    {
                        var actual = bllReportActual.GetModel(pd.ActualId.Value);
                        vmPd.updateReportActual(actual);
                    }

                    retData.Code     = RESULT_CODE.OK;
                    retData.Content  = "查询成功";
                    retData.Appendix = vmPd;
                } catch (Exception e) {
                    log = LogFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.FullName + ":" + MethodBase.GetCurrentMethod().Name);
                    log.Error(e);
                }
            }


            return(Json(retData));
        }