Exemplo n.º 1
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        CriterionAction criterionAction = new CriterionAction();

        criterionAction.DelFiles(this.Hidden1.Value, this.Session["CriterionFlageCode"].ToString());
        List <string> list = new List <string>();

        if (this.Hidden1.Value.Contains("["))
        {
            list = JsonHelper.GetListFromJson(this.Hidden1.Value);
        }
        else
        {
            list.Add(this.Hidden1.Value);
        }
        try
        {
            foreach (string current in list)
            {
                CriterionAction.Del(new Guid(current.ToString()), this.Session["CriterionFlageCode"].ToString());
            }
            this.JS.Text = "alert('操作成功!');";
            this.Data_Bind();
        }
        catch (Exception)
        {
            this.JS.Text = "alert('操作失败,网络连接故障,请稍候再试')";
        }
    }
Exemplo n.º 2
0
    protected void Btn_Save_Click(object sender, EventArgs e)
    {
        if (this.TxtPublisher.Text == "")
        {
            base.RegisterScript("top.ui.alert('发布单位不能为空');");
            return;
        }
        if (this.txtClass.Text == "")
        {
            base.RegisterScript("top.ui.alert('记录类型不能为空');");
            return;
        }
        if (this.TxtCriterionName.Text == "")
        {
            base.RegisterScript("top.ui.alert('规范名称不能为空');");
            return;
        }
        CriterionModel cM = new CriterionModel();

        cM = this.GetValueFromPage();
        if (base.Request.QueryString["Type"] == "Add")
        {
            int num = this.Add(cM);
            if (num != 1)
            {
                base.RegisterScript("top.ui.alert('增加失败');");
                return;
            }
            base.RegisterScript("top.ui.tabSuccess({parentName: '_criterionlist'});");
            return;
        }
        else
        {
            if (CriterionAction.Update(cM) != 1)
            {
                base.RegisterScript("top.ui.alert('修改失败');");
                return;
            }
            base.RegisterScript("top.ui.tabSuccess({parentName: '_criterionlist'});");
            return;
        }
    }
Exemplo n.º 3
0
    private void SetValueFromTable()
    {
        CriterionModel criterionModel = new CriterionModel();

        criterionModel = CriterionAction.GetSingle(new Guid(this.Session["CriterionCODE"].ToString()));
        DataTable type = DatumClass.GetType(criterionModel.Flage.ToString());

        if (type != null && type.Rows.Count > 0)
        {
            foreach (DataRow dataRow in type.Rows)
            {
                object obj = dataRow["TypeName"];
                if (obj != null)
                {
                    this.txtClass.Text = dataRow["TypeName"].ToString();
                }
            }
        }
        this.PublisherYhmc.Text    = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, criterionModel.PublishYhdm.Trim());
        this.TxtCriterionName.Text = criterionModel.CriterionName;
        if (CriterionEdit.IsNumber(criterionModel.Publisher))
        {
            this.TxtPublisher.Text = com.jwsoft.pm.entpm.PageHelper.QueryDept(this, Convert.ToInt32(criterionModel.Publisher));
        }
        this.Textbox1.Text  = criterionModel.Remark;
        this.hdnClass.Value = KnowledgeTypeAction.GetSingleType(criterionModel.Flage).TypeName;
        this.hdnDept.Value  = criterionModel.Publisher.ToString();
        CriterionLogic criterionLogic = new CriterionLogic();
        DataTable      dtModelByID    = criterionLogic.getDtModelByID(criterionModel.CriterionCode.ToString());

        foreach (DataRow dataRow2 in dtModelByID.Rows)
        {
            if (dataRow2["mark"].ToString() == "3")
            {
                this.HiddenField1.Value = "3";
            }
            string value = dataRow2["mark"].ToString();
            this.hdnmark.Value = value;
        }
    }
Exemplo n.º 4
0
    protected void Data_Bind()
    {
        string text  = string.Empty;
        string text2 = string.Empty;

        text = this.Session["DATUMCLASS"].ToString();
        if (this.Session["DATUMCLASS"].ToString() == "2")
        {
            new datumClass();
            text2 = this.getlistTypeID("ParentId=2");
            if (!string.IsNullOrEmpty(text2))
            {
                text2 = text2.Substring(1);
                text  = text2;
            }
            else
            {
                text = "null";
            }
            text += ",2";
        }
        else
        {
            if (this.Session["DATUMCLASS"].ToString() == "1")
            {
                this.BtnAdd.Enabled = false;
                new datumClass();
                if (this.QS.Value == "S")
                {
                    text2 = this.getlistTypeID("ParentId=3");
                }
                else
                {
                    text2 = this.getlistTypeID("ParentId=2");
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    text2 = text2.Substring(1);
                    text  = text2;
                }
                else
                {
                    text = "null";
                }
                if (this.QS.Value == "S")
                {
                    text += ",3";
                }
                else
                {
                    text += ",2";
                }
            }
        }
        if (this.Session["DATUMCLASS"].ToString() == "3")
        {
            new datumClass();
            text2 = this.getlistTypeID("ParentId=3");
            if (!string.IsNullOrEmpty(text2))
            {
                text2 = text2.Substring(1);
                text  = text2;
                text += ",3";
            }
            else
            {
                text = "null";
            }
        }
        DataTable pageData = CriterionAction.GetPageData(text, this.DDLLookup.SelectedValue, this.TxtLookup.Text);

        this.ViewState[CriterionList.resourceTable] = pageData;
        this.GridViewCriterion.DataSource           = pageData.DefaultView;
        this.GridViewCriterion.DataBind();
    }