Exemplo n.º 1
0
    //检索部门
    protected void Button1_Kil(object sender, EventArgs e)
    {
        string condition = GetCondition_Org();

        BindGridview3(condition);
        UpdatePanel_Org.Update();
    }
Exemplo n.º 2
0
    //提交选择会签部门
    protected void Button_ComSPP(object sender, EventArgs e)
    {
        bool   temp = false;
        string Dep  = "";

        foreach (GridViewRow item in Gridview3.Rows)
        {
            CheckBox rb = item.FindControl("CheckMarkup") as CheckBox;
            if (rb.Checked)
            {
                Dep = Gridview3.Rows[item.RowIndex].Cells[2].Text.ToString();
                string    condition = "and PT_ID='" + label_PT_ID.Text.ToString() + "'" + "and PTC_Dep='" + Dep + "'";
                DataSet   ds        = psd.SelectPTCountersign(condition);
                DataTable dt        = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    ScriptManager.RegisterClientScriptBlock(Page, GetType(), "aa", "alert('会签部门不能重复!')", true);
                    return;
                }
                else
                {
                    int p = psd.InsertPTCountersign(new Guid(label_PT_ID.Text.ToString()), Dep);
                    temp = true;
                }
            }
        }
        if (!temp)
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel_Org, GetType(), "aa", "alert('请选择部门')", true);
            return;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, GetType(), "aa", "alert('提交成功!')", true);
            Panel_Org.Visible = false;
            UpdatePanel_Org.Update();
            //string dep = "";
            //foreach (GridViewRow q in Gridview4.Rows)
            //{
            //    dep += q.Cells[1].Text.ToString() + ",";
            //}
            //dep = dep.Substring(0, dep.Length - 1);

            label_RTX.Text = "ERP系统信息:" + Session["UserRole"].ToString() + "于" + DateTime.Now + "提交了" + Gridview2.Rows[Gridview2.SelectedIndex].Cells[1].ToString() + "的特殊产品申请单";
            string message = label_RTX.Text;
            string sErr    = RTXhelper.Send(message, "特殊产品申请制定");
            if (!string.IsNullOrEmpty(sErr))
            {
                ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('" + sErr + "')", true);
            }
        }
    }
Exemplo n.º 3
0
 //关闭选择部门
 protected void Button_CancelSPP(object sender, EventArgs e)
 {
     TextBox22.Text    = "";
     Panel_Org.Visible = false;
     UpdatePanel_Org.Update();
 }
Exemplo n.º 4
0
 //重置检索部门
 protected void Button_CoMl(object sender, EventArgs e)
 {
     TextBox22.Text = "";
     BindGridview3("");
     UpdatePanel_Org.Update();
 }
Exemplo n.º 5
0
    protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit1")//编辑
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            string    condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'";
            DataSet   ds        = psd.SelectProType_Special(condition);
            DataTable dt        = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                label_Change.Text = dt.Rows[0][28].ToString() + "申请单修改";
                TextBox4.Text     = dt.Rows[0][12].ToString();
                TextBox2.Text     = dt.Rows[0][19].ToString();
            }
            Panel_NewProjectInfo.Visible = true;
            UpdatePanel_NewProjectInfo.Update();
        }

        if (e.CommandName == "Cancel1")//删除
        {
            try
            {
                GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
                Gridview2.SelectedIndex = row.RowIndex;
                label_PT_ID.Text        = e.CommandArgument.ToString();
                psd.DeleteProType_Special(new Guid(label_PT_ID.Text));
                BindGriview2("");
                UpdatePanel_Preserve.Update();
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('已经选择了会签部门或制定了下一步信息,无法删除只能修改!')", true);
                return;
            }
        }
        if (e.CommandName == "SelectDept")//选择会签部门
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            BindGridview3("");
            Panel_Org.Visible = true;
            UpdatePanel_Org.Update();
        }
        if (e.CommandName == "Design")//会签
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'";
            BindGridview4(condition);
            Gridview4.Columns[8].Visible = false;
            Gridview4.Columns[7].Visible = true;
            Panel_Sign.Visible           = true;
            UpdatePanel_Sign.Update();
        }
        if (e.CommandName == "Look")//查看会签
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'";
            BindGridview4(condition);
            //this.Gridview4.Columns[7].Visible = false;
            //this.Gridview4.Columns[8].Visible = true;
            Panel_Sign.Visible = true;
            UpdatePanel_Sign.Update();
        }
        if (e.CommandName == "Make")//制作
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Response.Redirect("../ProductionBasicInfo/PBProType.aspx?state=specialmake&PT_ID=" + new Guid(label_PT_ID.Text));
        }
        if (e.CommandName == "Lookinfo")//查看基础数据
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_PT_ID.Text        = e.CommandArgument.ToString();
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Response.Redirect("../ProductionBasicInfo/PBProType.aspx?state=speciallook&PT_ID=" + new Guid(label_PT_ID.Text));
        }
        if (e.CommandName == "MAcc")//制定时上传附件
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            label_Acc.Text          = "制定";
            label_PT_ID.Text        = e.CommandArgument.ToString();
            ShowPanel();
            UpdatePanel4.Update();
        }
        if (e.CommandName == "printpreview")//打印报表
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Gridview2.SelectedIndex = row.RowIndex;
            try
            {
                Response.Redirect("../REPORT_cc/ProSpecialPrint.aspx?" + "&PT_ID=" + Gridview2.DataKeys[row.RowIndex].Values["PT_ID"].ToString());
            }
            catch (Exception)
            {
                throw;
            }
        }
    }