예제 #1
0
    protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        e.Cancel = this.InvalidInput();
        if (this.up_sPMNameLower == "yefengpm")
        {
            if (e.OldValues["Number"].ToString() != e.NewValues["Number"].ToString() && inoutType != "内部")
            {
                string[] oldviseids = e.OldValues["Number"].ToString().Split('-');
                string[] newviseids = e.NewValues["Number"].ToString().Split('-');
                if (oldviseids[4] == newviseids[4])
                {
                    string viseid = e.NewValues["Number"].ToString();

                    e.NewValues["Number"] = getcode(viseid);
                }
            }
            RmsPM.BFL.DesignChangeBFL tmpbfl = new RmsPM.BFL.DesignChangeBFL();
            TiannuoPM.MODEL.DesignChangeQueryModel   dcqmdl   = new TiannuoPM.MODEL.DesignChangeQueryModel();
            List <TiannuoPM.MODEL.DesignChangeModel> lisdcmdl = tmpbfl.GetDesignChangeList(dcqmdl);
            int listlenth = lisdcmdl.Count;
            for (int i = 0; i < listlenth; i++)
            {
                if (lisdcmdl[i].Number.Contains(e.NewValues["Number"].ToString()))
                {
                    e.Cancel = true;
                    Response.Write("<script>alert(\" 设计变更编号重复!\");</script>");
                }
            }
        }
    }
예제 #2
0
    protected void btnNoPassAudit_Click(object sender, EventArgs e)
    {
        RmsPM.BFL.DesignChangeBFL dc = new RmsPM.BFL.DesignChangeBFL();
        bool   isYFintel             = false;
        string number = "";

        if (this.up_sPMNameLower == "yefengpm")
        {
            TiannuoPM.MODEL.DesignChangeModel design = dc.GetDesignChange(int.Parse(Request["DesignChangeCode"].ToString()));
            number = design.Number;
            if (design.Type == "1")
            {
                if (number.IndexOf('-') > 0)
                {
                    string[] numbers = number.Split('-');
                    if (numbers.Length == 5)
                    {
                        number    = numbers[0] + "-" + numbers[1] + "-" + numbers[3] + "(审)" + RmsPM.DAL.EntityDAO.SystemManageDAO.GetFormatSysCode("YFID" + Request["projectCode"] + numbers[1], "{####}", 1001);
                        isYFintel = true;
                    }
                }
            }
        }
        if (isYFintel)
        {
            dc.YFNoPass(int.Parse(Request["DesignChangeCode"].ToString()), number);
        }
        else
        {
            dc.NoPass(int.Parse(Request["DesignChangeCode"].ToString()));
        }
        Response.Write("<script>window.opener.location.reload();window.close();</script>");
    }
예제 #3
0
    private void ButtonStatusCtrl()
    {
        Button          btnModify      = ((Button)this.FormView1.Row.FindControl("btnModify"));
        Button          btnDelete      = ((Button)this.FormView1.Row.FindControl("btnDelete"));
        HtmlInputButton btnRequisition = ((HtmlInputButton)this.FormView1.Row.FindControl("btnRequisition"));
        HtmlInputButton btnAudit       = ((HtmlInputButton)this.FormView1.Row.FindControl("btnAudit"));

        RmsPM.BFL.DesignChangeBFL         dc      = new RmsPM.BFL.DesignChangeBFL();
        TiannuoPM.MODEL.DesignChangeModel dcmodel = dc.GetDesignChange((int)FormView1.DataKey.Value);

        //ArrayList ar = user.GetResourceRight(FormView1.DataKey.Value.ToString(), "DesignChange");
        switch (dcmodel.State)
        {
        case "0":
            btnModify.Visible      = true;
            btnDelete.Visible      = true;
            btnAudit.Visible       = true;
            btnRequisition.Visible = true;
            break;

        case "1":
            btnModify.Visible      = false;
            btnDelete.Visible      = false;
            btnAudit.Visible       = true;
            btnRequisition.Visible = false;
            break;

        case "2":
            btnModify.Visible      = false;
            btnDelete.Visible      = false;
            btnAudit.Visible       = false;
            btnRequisition.Visible = false;
            break;

        case "3":
            btnModify.Visible      = false;
            btnDelete.Visible      = false;
            btnAudit.Visible       = true;
            btnRequisition.Visible = true;
            break;
        }
        if (!user.HasRight("2402"))
        {
            btnModify.Visible = false;
        }
        if (!user.HasRight("2404"))
        {
            btnDelete.Visible = false;
        }
        if (!user.HasRight("2405"))
        {
            btnAudit.Visible = false;
        }
        if (!user.HasRight("2406"))
        {
            btnRequisition.Visible = false;
        }
        if (FormView1.CurrentMode == FormViewMode.ReadOnly)
        {
            int iCont = RmsPM.BLL.WorkFlowRule.GetBeginCaseCountByProcedureNameAndApplicationCode("设计变更", Request["DesignChangeCode"] + "");
            if (iCont > 0)
            {
                btnRequisition.Visible = false;
            }
        }
    }