Example #1
0
    public void InitPageParameter(string inspectNo, bool isWorkShop)
    {
        InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo);

        this.lbInspectNo.Text  = inspectOrder.InspectNo;
        this.lbCreateUser.Text = inspectOrder.CreateUser.Name;
        this.lbCreateDate.Text = inspectOrder.CreateDate.ToString("yyyy-MM-dd");
        this.lbStatus.Text     = inspectOrder.Status;

        this.IsPartQualified = bool.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_ALLOW_PART_QUALIFIED).Value);

        this.btnQualified.Visible        = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && !this.IsPartQualified && inspectOrder.IsDetailHasHu && !isWorkShop;
        this.btnUnqalified.Visible       = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && !this.IsPartQualified && inspectOrder.IsDetailHasHu && !isWorkShop;
        this.btnInspect.Visible          = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && (this.IsPartQualified || !inspectOrder.IsDetailHasHu) && !isWorkShop;
        this.btnUnqualifiedPrint.Visible = !isWorkShop;

        this.ucDetailList.IsPartQualified = this.IsPartQualified;
        this.ucDetailList.InitPageParameter(inspectNo, isWorkShop);
    }
Example #2
0
    protected void btnUnqualifiedPrint_Click(object sender, EventArgs e)
    {
        string                inspectNo         = this.lbInspectNo.Text;
        IList <object>        list              = new List <object>();
        IList <InspectResult> inspectResultList = this.ucDetailList.PopulateUnqualifiedInspectOrder();

        if (inspectResultList == null || inspectResultList.Count == 0)
        {
            ShowWarningMessage("MasterData.Inventory.InspectOrder.Unqualified.Empty");
            return;
        }
        InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo);

        list.Add(inspectOrder);
        list.Add(inspectResultList);
        string printUrl = TheReportMgr.WriteToFile("BelowBrade.xls", list);

        Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>");
        this.ShowSuccessMessage("MasterData.Inventory.InspectOrder.Unqualified.Print.Successful");
    }
    public void InitPageParameter(string inspectNo, bool isWorkShop)
    {
        this.InspectNo = inspectNo;
        InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo, true);

        this.GV_List.DataSource = inspectOrder.InspectOrderDetails;
        this.GV_List.DataBind();

        this.GV_List.Columns[7].Visible = inspectOrder.IsDetailHasHu;

        this.IsDetailHasHu = inspectOrder.IsDetailHasHu;

        if (this.IsPartQualified || !inspectOrder.IsDetailHasHu)
        {
            this.GV_List.Columns[13].Visible = true;
            this.GV_List.Columns[14].Visible = true;
            //  this.GV_List.Columns[0].Visible = false;
        }
        else
        {
            //this.GV_List.Columns[0].Visible = true;
            this.GV_List.Columns[13].Visible = false;
            this.GV_List.Columns[14].Visible = false;
        }

        if (isWorkShop)
        {
            this.GV_List.Columns[0].Visible  = false;
            this.GV_List.Columns[9].Visible  = false;
            this.GV_List.Columns[10].Visible = false;
            this.GV_List.Columns[11].Visible = false;
            this.GV_List.Columns[12].Visible = false;
            this.GV_List.Columns[13].Visible = false;
            this.GV_List.Columns[14].Visible = false;
            this.GV_List.Columns[17].Visible = false;
        }
    }