protected void BtnAddNewOK_ServerClick(object sender, System.EventArgs e)
    {
        PccMsg myMsg = new PccMsg();
        bs_FactGroupManage mybs = new bs_FactGroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strReturn = string.Empty;
        string strMsg = string.Empty;
        if (ViewState["ActionType"] != null && ViewState["ActionType"].ToString() == "New")
        {
            strReturn = mybs.DoReturnStr("Insert_DS_FGRP", GenDBXML(), string.Empty);
            strMsg = "新增成功";
        }
        else
        {
            strReturn = mybs.DoReturnStr("Update_DS_FGRP", GenDBXML(), string.Empty);
            strMsg = "修改成功";
        }
        myMsg.LoadXml(strReturn);
        string strUrl = FACTGROUPMAANGE + "?ApID=" + m_ApID + "&SelectedNode=" + TreeView1.SelectedValue;
        //string strUrl = FACTGROUPMAANGE + "?ApID=" + m_ApID + "&SelectedNode=" + TreeView1.SelectedNodeIndex;

        if (myMsg.Query("returnValue") == "0")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + strMsg + "');window.parent.location.href='" + strUrl + "';</script>");
        }
        else
        {
            LblErrMsg.Font.Size = FontUnit.Large;
            LblErrMsg.Text = myMsg.Query("errmsg");
        }
    }
    protected void btnDelOK1_Click(object sender, System.EventArgs e)
    {
        string strReturn = "";
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("User_Id", Request.Params["User_ID"]);
        myMsg.CreateFirstNode("Ap_Id", CheckQueryString("ApID"));
        myMsg.CreateFirstNode("Fgrp_Id", m_Fgrp_Id);
        myMsg.CreateFirstNode("Upd_Id", Session["UserID"].ToString());

        bs_FactGroupManage mybs = new bs_FactGroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);

        strReturn = mybs.DoReturnStr("deleteUserGrpByFgrpIDAndUserID", myMsg.GetXmlStr, "");

        myMsg.LoadXml(strReturn);
        if (myMsg.Query("returnValue") == "0")
        {
            lblMsg.Text = "";
            // ting
            Response.Redirect(MYURL + "?ApID=" + m_ap_id + "&QueryCondition=" + GetQueryCondition());
        }
        else
        {
            lblMsg.Font.Size = 12;
            lblMsg.Text = myMsg.Query("errmsg");
        }
    }
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        if (ViewState["CurrentValue"] == null && tab_fact.Rows.Count == 0) return;

        Temporary();
        string strFact = "";
        bs_FactGroupManage mybs = new bs_FactGroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        strFact = Session["FactFgrpTemporary"].ToString();
        if (strFact.Length == 0)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('您還未選擇任何廠別唷!');</script>");
            GenMasterTable();
            return;
        }

        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("Ap_Id", m_Ap_Id);
        myMsg.CreateFirstNode("Fgrp_Id", m_Fgrp_Id);
        myMsg.CreateFirstNode("Fact_Str", strFact);
        myMsg.CreateFirstNode("Upd_Id", Session["UserID"].ToString());
        string strReturn = mybs.DoReturnStr("PickMultiFactToFgrp", myMsg.GetXmlStr, string.Empty);
        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") != "0")
        {
            lblMsg.Font.Size = 12;
            lblMsg.Text = myMsg.Query("errmsg");
            return;
        }
        else
        {
            Session["FactFgrpTemporary"] = string.Empty;
            Response.Redirect(FACTGROUPDETAIL + "?ApID=" + m_Ap_Id + "&SrcUp_Id=" + Request.QueryString["SrcUp_Id"] + "&Up_Id=" + Request.QueryString["Up_Id"] + "&QueryCondition=" + Request.QueryString["QueryCondition"]);
        }
    }
Ejemplo n.º 4
0
    protected void BtnOK_Click(object sender, System.EventArgs e)
    {
        if (CheckForm("JoinFgrpID") == "")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('You not yet select Fact group!');</script>");
            GenMasterTable();
            return;
        }

        string strReturn = "";
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("User_Id", Request.Params["UserID"]);
        myMsg.CreateFirstNode("Ap_Id", CheckQueryString("ApID"));
        myMsg.CreateFirstNode("Fgrp_Str", CheckForm("JoinFgrpID"));
        myMsg.CreateFirstNode("Fgrp_Org", ViewState["Fgrp_Org"].ToString());
        myMsg.CreateFirstNode("Upd_Id", Session["UserID"].ToString());

        bs_FactGroupManage mybs = new bs_FactGroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);

        strReturn = mybs.DoReturnStr("joinFgrpByUserID", myMsg.GetXmlStr, "");

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") != "0")
        {
            lblMsg.Visible = true;
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myMsg.Query("errmsg");
            GenMasterTable();
        }
        else
        {
            Response.Redirect(USERFGRPVIEW + "?ApID=" + m_ApID + "&QueryCondition=" + CheckQueryString("QueryCondition"));
        }
    }
    protected void BtnDelFactOK_Click(object sender, System.EventArgs e)
    {
        PccMsg myMsg = new PccMsg();
        bs_FactGroupManage mybs = new bs_FactGroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strReturn = string.Empty;
        string strMsg = string.Empty;
        strReturn = mybs.DoReturnStr("delete_DS_FACTGRP", GenDBXML(), string.Empty);
        strMsg = "刪除成功";

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + strMsg + "');</script>");
            Response.Redirect(MYURL + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + m_Up_Id + "&QueryCondition=" + GetQueryCondition());
        }
        else
        {
            LblErrMsg.Font.Size = FontUnit.Large;
            LblErrMsg.Text = myMsg.Query("errmsg");
        }
    }