コード例 #1
0
        protected VM_LayoutPicture GetLayoutInfo(MesWeb.Model.T_LayoutPicture layoutPicture)
        {
            var vmLayoutView = new VM_LayoutPicture(layoutPicture);
            var subSpotItems = bllLayout.GetModelList("IsTop = 0 AND ParentLayoutPictureID = " + layoutPicture.LayoutPictureID);

            foreach (var item in subSpotItems)
            {
                var vmItem = new VM_LayoutPicture(item);
                vmLayoutView.SubSpotItems.Add(vmItem);
            }
            return(vmLayoutView);
        }
コード例 #2
0
        public JsonResult GetAxisDetailAction(string axisNumStr)
        {
            log = LogFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.FullName + ":" + MethodBase.GetCurrentMethod().Name);

            var retData        = new VM_Result_Data();
            var procDetailList = new List <VM_ProcDetail>();
            var hisData        = new VM_ProcDetail();

            axisNumStr = axisNumStr.Trim();
            HisMain axisNum = new HisMain(axisNumStr);
            var     tabName = axisNum.GetHisDataTableName();

            if (string.IsNullOrEmpty(tabName))
            {
                retData.Content = "轴号有误";
                return(Json(retData));
            }
            try {
                var bllHisData = new MesWeb.BLL.T_HisMain(tabName);
                var findData   = bllHisData.GetModelList("Axis_No = '" + axisNumStr + "'").FirstOrDefault();
                hisData = new VM_ProcDetail {
                    Axis_No              = findData.Axis_No,
                    CurrentDataID        = findData.CurrentDataID,
                    SpecificationID      = findData.SpecificationID,
                    MachineID            = findData.MachineID,
                    MachineTypeID        = findData.MachineTypeID,
                    EmployeeID_Main      = findData.EmployeeID_Main,
                    EmployeeID_Assistant = findData.EmployeeID_Assistant,
                    Start_Axis_No        = findData.Start_Axis_No,
                    Printcode            = findData.Printcode
                };

                var specID      = hisData.SpecificationID;
                var bllMachine  = new MesWeb.BLL.T_Machine();
                var bllEmp      = new MesWeb.BLL.T_Employee();
                var bllSpec     = new MesWeb.BLL.T_Specification();
                var bllCodeUsed = new MesWeb.BLL.T_CodeUsed();
                var bllLayout   = new MesWeb.BLL.T_LayoutPicture();
                var spec        = bllSpec.GetModel((int)specID);
                hisData.SpecName    = spec.SpecificationName;
                hisData.ODMax       = spec.ODMax.ToString();
                hisData.ODMin       = spec.ODMin.ToString();
                hisData.SpecColor   = spec.SpecificationColor;
                hisData.RolledYield = "100%";

                hisData.GeneratorTime = bllCodeUsed.GetModelList("Axis_No = '" + hisData.Axis_No + "'").FirstOrDefault().GeneratorTime.Value.ToShortDateString();
                var machine       = bllMachine.GetModel((int)hisData.MachineID);
                var machineLayout = bllLayout.GetModelList("LayoutTypeID = " + 1).Find(s => { return(s.TableRowID == machine.MachineID); });
                //   hisData.EmployeeName = bllEmp.GetModel((int)hisData.EmployeeID_Main).EmployeeName;
                hisData.EmployeeName = hisData.EmployeeID_Main;
                var tableName = axisNum.Year + axisNum.Month + ((int)(machine.MachineTypeID)).ToString("00");
                hisData.MachineName = "<a href='/HistoryQuery/HistoryMachine/" + tableName + "," + axisNumStr + "'>" + machine.MachineName + "</a>";
                retData.Code        = RESULT_CODE.OK;
            } catch (Exception e) {
                log.Error("查询轴号信息失败", e);
                retData.Content = "查询失败,请联系管理员";
            }
            procDetailList.Add(hisData);
            retData.Appendix = procDetailList;
            return(Json(retData));
        }