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"]);
        }
    }
    protected void btnDelOK_Click(object sender, System.EventArgs e)
    {
        plMain.Visible = true;
        plDelete.Visible = false;

        PccMsg mySrcMsg = new PccMsg(Request.QueryString["Method"]);

        PccMsg myMsg = new PccMsg();
        bs_ApManager mybs = new bs_ApManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strReturn = "";
        switch (mySrcMsg.Query("Method"))
        {
            case "MasterDelFunc":
                myMsg.CreateFirstNode("ap_id", mySrcMsg.Query("Key"));
                strReturn = mybs.DoReturnStr("DeleteProAp", myMsg.GetXmlStr, "");
                break;
            case "DetailDelFunc":
                myMsg.CreateFirstNode("menu_id", mySrcMsg.Query("Key"));
                strReturn = mybs.DoReturnStr("DeleteProMenu", myMsg.GetXmlStr, "");
                break;
        }

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            GenMasterTable();
        }
        else
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>");
        }
    }
    protected void btnDelOK_Click(object sender, System.EventArgs e)
    {
        plMain.Visible = true;
        plDelete.Visible = false;

        PccMsg myMsg = new PccMsg(CheckQueryString("Method"));
        string strGroupID = myMsg.Query("Key");
        myMsg.LoadXml();
        myMsg.CreateFirstNode("group_id", strGroupID);
        myMsg.CreateFirstNode("ap_id", CheckQueryString("ApID"));

        bs_GroupManage mybs = new bs_GroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strReturn = mybs.DoReturnStr("DeleteGroupByGroupID", myMsg.GetXmlStr, "");

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            GenMasterTable();
        }
        else
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>");
        }
    }
    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 btnOK_Click(object sender, System.EventArgs e)
    {
        if (CheckForm("JoinGroupID") == "")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('You not yet select group!');</script>");
            GenMasterTable();
            return;
        }

        string strReturn = "";
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("user_id", ViewState["UserID"].ToString());
        myMsg.CreateFirstNode("ap_id", CheckQueryString("ApID"));
        myMsg.CreateFirstNode("group_str", CheckForm("JoinGroupID"));
        myMsg.CreateFirstNode("group_org", ViewState["group_org"].ToString());

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

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

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") != "0")
        {
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myMsg.Query("errmsg");
            GenMasterTable();
        }
        else
        {
            Response.Redirect(USERMANAGE + "?ApID=" + CheckQueryString("ApID") + "&QueryCondition=" + CheckQueryString("QueryCondition"));
        }
    }
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        if (ViewState["CurrentValue"] == null && tab_fact.Rows.Count == 0) return;

        Temporary();
        string strFactNo = "";
        bs_UserFactManage mybs = new bs_UserFactManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        strFactNo = Session["Facttemporary"].ToString();
        if (strFactNo.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("no_str", strFactNo);
        myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString());
        string strReturn = mybs.DoReturnStr("PickMultiFact", myMsg.GetXmlStr, "");
        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") != "0")
        {
            lblMsg.Font.Size = 12;
            lblMsg.Text = myMsg.Query("errmsg");
        }
        else
        {
            Response.Redirect(USERFACTMANAGE + "?ApID=" + m_ap_id);
        }
    }
Example #7
0
    public string CancelImgConditions(string ID, string user_id)
    {
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("ID",ID);
        myMsg.CreateFirstNode("add_id", user_id);

        return myBs.DoReturnStr("PRO_CANCEL_IMGCONDITIONS", myMsg.GetXmlStr, "");
    }
Example #8
0
    public PccMsg CreateQueryMsg(string queryAction, string queryInput, string procedure)
    {
        PccMsg retMsg = new PccMsg();
        retMsg.CreateFirstNode("QueryAction", queryAction);
        retMsg.CreateFirstNode("QueryInput", queryInput);
        retMsg.CreateFirstNode("Procedure", procedure);

        return retMsg;
    }
Example #9
0
    // 摘要描述
    // 函數名稱:
    // 函數類別:
    // 函數功能:
    // 函數說明:UI層經常用的函數
    // 輸入資料:
    // 輸出資料:
    // 注意事項:
    // 原設計者:Leo.Tang
    // 設立日期:開發中
    public PccMsg CreateQueryMsg(string QueryAction, string QueryReturns, string QuerySource, string QueryCondition)
    {
        PccMsg retMsg = new PccMsg();
        retMsg.CreateFirstNode("QueryAction", QueryAction);
        retMsg.CreateFirstNode("QueryReturns", QueryReturns);
        retMsg.CreateFirstNode("QuerySource", QuerySource);
        retMsg.CreateFirstNode("QueryCondition", QueryCondition);

        return retMsg;
    }
Example #10
0
    public string DeleteQCFactDept(string user_id, string fact_no, string dept_no, string sec_no)
    {
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("user_id", user_id);
        myMsg.CreateFirstNode("fact_no", fact_no);
        myMsg.CreateFirstNode("dept_no", dept_no);
        myMsg.CreateFirstNode("sec_no", sec_no);

        return myBs.DoReturnStr("PRO_DELETE_QCFACTDEPT", myMsg.GetXmlStr, "");
    }
    public static DataSet GetStatistics(string fact_no, string start_date, string end_date)
    {
        bs_Statistics mybs = new bs_Statistics(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);

        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("fact_no", fact_no);
        myMsg.CreateFirstNode("start_date", start_date);
        myMsg.CreateFirstNode("end_date", end_date);

        return mybs.DoReturnDataSet("GETSTATISTICS", myMsg.GetXmlStr, "");
    }
    private string GenDBXML()
    {
        PccMsg myMsg = new PccMsg();
        if (Request.Params["Type"] == null || Request.Params["Type"].ToString() != "New")
        {
            myMsg.CreateFirstNode("ap_id", GetApID());
        }

        myMsg.CreateFirstNode("ap_name", txtApName.Text);
        myMsg.CreateFirstNode("ap_link", txtApLink.Text);
        myMsg.CreateFirstNode("ap_vpath", txtVpath.Text);

        return myMsg.GetXmlStr;
    }
Example #13
0
    public static string GetFactByUser(string user_id)
    {
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("UserID", user_id);

        bs_UserInfo bs = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);
        return bs.DoReturnStr("GETFACTNOBYUSERID", myMsg.GetXmlStr, "").Trim();
    }
    public static DataSet GetFact(string fact_no)
    {
        bs_Statistics mybs = new bs_Statistics(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);

        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("fact_no", fact_no);

        return mybs.DoReturnDataSet("GETFACT", myMsg.GetXmlStr, "");
    }
    //,string dept_no
    public static DataSet GetDept(string fact_no)
    {
        bs_UserInfo mybs = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);

        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("fact_no", fact_no);
          //  myMsg.CreateFirstNode("dept_no", dept_no);
        return mybs.DoReturnDataSet("GETDEPTBYFACT", myMsg.GetXmlStr, "");
    }
Example #16
0
    public static string GetFactNoByUserID(string UserID)
    {
        bs_UserInfo mybs = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);

        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("UserID", UserID);

        string sReturn = mybs.DoReturnStr("GetFactNoByUserID", myMsg.GetXmlStr, "");
        return sReturn.Trim();
    }
    protected void btnAddComeOn_Click(object sender, System.EventArgs e)
    {
        bs_GroupManage mybs = new bs_GroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        PccMsg myMsg = new PccMsg();
        string strUserID = "", strReturn = "";

        for (int i = 0; i < DataGrid1.Items.Count; i++)
        {
            if (((CheckBox)DataGrid1.Items[i].Cells[6].Controls[1]).Checked)
            {
                strUserID += DataGrid1.Items[i].Cells[1].Text + ",";
            }
        }

        if (strUserID != "")
        {
            strUserID = strUserID.Substring(0, strUserID.Length - 1);

            myMsg.LoadXml();
            myMsg.CreateFirstNode("group_id", CheckQueryString("GroupID"));
            myMsg.CreateFirstNode("user_str", strUserID);
            strReturn = mybs.DoReturnStr("InsertUGrp", myMsg.GetXmlStr, "");

            myMsg.LoadXml(strReturn);

            if (myMsg.Query("returnValue") == "0")
            {
                Response.Redirect(GROUPMANAGE + "?ApID=" + CheckQueryString("ApID") + "&QueryCondition=" + CheckQueryString("QueryCondition"));
            }
            else
            {
                lblMsg.Font.Size = FontUnit.Large;
                lblMsg.Text = myMsg.Query("errmsg");
            }
        }
        else
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myLabel.GetErrMsg("lbl0014", "SysManager/UserManager");
        }
    }
Example #18
0
        //Nickel 20130320
        public string db_DEL_SHR_AREA(string strXML)
        {
            PccMsg myMsg = new PccMsg(strXML);
            string myStrConFactNo = myMsg.Query("area_id");

            SqlParameter[] paraValue= {
                                          new SqlParameter("@area_id", SqlDbType.Decimal,12),
                                          new SqlParameter("@ErrMsg",SqlDbType.Int)
                                      };
            int rowsAffected = 0,returnValue;
            paraValue[0].Value = myMsg.Query("area_id");
            paraValue[1].Direction = ParameterDirection.Output;

            returnValue = RunProcedure("pro_Del_shr_area", paraValue, ref rowsAffected);
            myMsg = new PccMsg();

            myMsg.CreateFirstNode("returnValue",returnValue.ToString());
            myMsg.CreateFirstNode("rowsAffected",rowsAffected.ToString());
            myMsg.CreateFirstNode("MsgReturn",paraValue[1].Value.ToString());
            return myMsg.GetXmlStr;
        }
    protected void btnDelOK_Click(object sender, System.EventArgs e)
    {
        plMain.Visible = true;
        plDelete.Visible = false;

        PccMsg myMsg = new PccMsg(CheckRequestQueryString("Method"));
        PccMsg myReturnMsg = new PccMsg();
        string strUserID = myMsg.Query("Key");
        myMsg.LoadXml();
        myMsg.CreateFirstNode("user_id", strUserID);
        myMsg.CreateFirstNode("ap_id", CheckRequestQueryString("ApID"));

        //增加一個刪除e_userfact的關連 20040924
        myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString());
        myMsg.CreateFirstNode("fact_id", "0");
        myMsg.CreateFirstNode("uf_id", "0");
        bs_UserFactManage mybs1 = new bs_UserFactManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strReturn = mybs1.DoReturnStr("DeleteUserFactByUser", myMsg.GetXmlStr, "");
        myReturnMsg.LoadXml(strReturn);

        if (myReturnMsg.Query("returnValue") != "0")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>");
            return;
        }

        bs_UserManager mybs = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        strReturn = mybs.DoReturnStr("DeleteUserByApID", myMsg.GetXmlStr, "");

        myReturnMsg.LoadXml(strReturn);

        if (myReturnMsg.Query("returnValue") == "0")
        {
            GenMasterTable();
        }
        else
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>");
        }
    }
Example #20
0
    public string SaveApplyCheckDataQC(string ac_id, string fact_no, string dept_no, string sec_no, string type_check, string vou_no, string total, string floor, string build_no, string myType)
    {
        bs_ApplyData myBs = new bs_ApplyData(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"], "", ConfigurationSettings.AppSettings["EventLogPath"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("ac_id", ac_id);
        myMsg.CreateFirstNode("fact_no", fact_no);
        myMsg.CreateFirstNode("dept_no", dept_no);
        myMsg.CreateFirstNode("sec_no", sec_no);
        myMsg.CreateFirstNode("type_check", type_check);
        myMsg.CreateFirstNode("vou_no", vou_no);
        myMsg.CreateFirstNode("total", total);
        myMsg.CreateFirstNode("floor", floor);
        myMsg.CreateFirstNode("build_no", build_no);
        myMsg.CreateFirstNode("Type", myType);

        string strXML = myMsg.GetXmlStr;
        string strReturn = myBs.DoReturnStr("INSUPDAPPLYCHECKQ", strXML, "");
        myMsg.LoadXml(strReturn);
        return strReturn;

        //return myMsg.Query("Err");
    }
Example #21
0
    public static void _Get_ControlDeptByfact(DropDownList ddl, string fact_no)
    {
        bs_UserInfo mybs = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("fact_no", fact_no);
        DataSet dsReturn = mybs.DoReturnDataSet("GETDEPTBYFACT", myMsg.GetXmlStr, "");

        DataTable dt = dsReturn.Tables[0];
        ddl.SelectedIndex = -1;
        ddl.DataSource = dt;

        ddl.DataTextField = "dept_no";
        ddl.DataValueField = "dept_no";
        ddl.DataBind();
          //  ddl.Items.Insert(0, new ListItem("--All--", ""));
    }
    protected void btnOK_Click(object sender, System.EventArgs e)
    {
        if (txtGroupName.Text == "")
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            lblMsg.Text = myLabel.GetErrMsg("lbl0010", "ADTPurDoc/GroupManage");
            return;
        }

        //先判斷是Insert or Update
        bool bUpdate = false;
        string group_id = "";
        PccMsg myMsg = new PccMsg();

        if (Request.Params["Method"] != null)
        {
            bUpdate = true;
            myMsg.LoadXml(Request.Params["Method"].ToString());
            group_id = myMsg.Query("Key");
        }

        myMsg.ClearContext();
        myMsg.CreateFirstNode("group_id", group_id);
        myMsg.CreateFirstNode("ap_id", CheckQueryString("ApID"));
        myMsg.CreateFirstNode("group_nm", txtGroupName.Text);
        myMsg.CreateFirstNode("group_type", ddlGroupType.SelectedItem.Value);

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

        if (bUpdate)
        {
            myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString());
            strReturn = mybs.DoReturnStr("UpdateGroupByGroupID", myMsg.GetXmlStr, "");
        }
        else
        {
            myMsg.CreateFirstNode("add_id", Session["UserID"].ToString());
            strReturn = mybs.DoReturnStr("InsertGroupByApID", myMsg.GetXmlStr, "");
        }

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            Response.Redirect(GROUPMANAGE + "?ApID=" + CheckQueryString("ApID"));
        }
        else
        {
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myMsg.Query("errmsg");
        }
    }
Example #23
0
    //web.huuminh 20140416
    // lây dept dua vào uer_id
    public static void _Get_ControlDept(DropDownList ddl, string UserID,string Type)
    {
        bs_UserInfo mybs = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("UserID", UserID);
        DataSet dsReturn = mybs.DoReturnDataSet("GETDEPTBYUSERID", myMsg.GetXmlStr, "");

        DataTable dt = dsReturn.Tables[0];
        ddl.SelectedIndex = -1;
        ddl.DataSource = dt;
        if (Type == "1")
        {
            ddl.DataTextField = "dept_name";
            ddl.DataValueField = "dept_no";
        }
        ddl.DataBind();
        //if (dt.Rows.Count > 1 || dt.Rows.Count == 0)
        //    ddl.Items.Insert(0, new ListItem("--All--", ""));
    }
Example #24
0
    public void GetImageFile(string IdImage)
    {
        //if (Session["IdImage"].ToString() != null)
        //{

            bs_UserInfo bs_Route = new bs_UserInfo(ConfigurationSettings.AppSettings["AppConnectionType"], ConfigurationSettings.AppSettings["AppConnectionServer"], ConfigurationSettings.AppSettings["AppConnectionDB"], ConfigurationSettings.AppSettings["AppConnectionUser"], ConfigurationSettings.AppSettings["AppConnectionPwd"], "", ConfigurationSettings.AppSettings["EventLogPath"]);
            PccMsg myMsg = new PccMsg();
            myMsg.CreateFirstNode("user_id", IdImage.ToString().Trim());
            string strXML = myMsg.GetXmlStr;
            DataTable ImageTable = bs_Route.DoReturnDataSet("GETUSERNAMESIGN", strXML, "").Tables[0];
            //return dt;
            byte[] byteReturn = { };

            if (ImageTable.Rows.Count > 0)
            {
                byteReturn = (byte[])ImageTable.Rows[0]["sign_pic"];
                Response.BinaryWrite(byteReturn);
            }

          //  }
    }
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        if (ViewState["CurrentValue"] == null && tab_user.Rows.Count == 0) return;

        Temporary();
        string strUser = "";
        bs_UserFactManage mybs = new bs_UserFactManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        strUser = Session["Usertemporary"].ToString();
        if (strUser.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("fact_id", m_fact_id);
        myMsg.CreateFirstNode("user_str", strUser);
        if (ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"] != null)
            //myMsg.CreateFirstNode("FactByGroup",ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"].ToString());
            // ting
            myMsg.CreateFirstNode("FactByGroup", ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"].ToString() + "&QueryCondition=" + Request.QueryString["QueryCondition"]);
        else
            myMsg.CreateFirstNode("FactByGroup", "N");

        myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString());
        string strReturn = mybs.DoReturnStr("PickMultiUserFact", myMsg.GetXmlStr, "");
        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") != "0")
        {
            lblMsg.Font.Size = 12;
            lblMsg.Text = myMsg.Query("errmsg");
            return;
        }
        else
        {
            //Response.Redirect(PICKUSER + "?ApID=" + m_ap_id);
            // ting
            Response.Redirect(PICKUSER + "?ApID=" + m_ap_id + "&QueryCondition=" + Request.QueryString["QueryCondition"]);
        }
    }
    private void BindDdlData(ref PccErrMsg myLabel)
    {
        bs_ApManager mybs = new bs_ApManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("vpath", System.Configuration.ConfigurationManager.AppSettings["vpath"].ToString());
        DataTable dt = mybs.DoReturnDataSet("GetAllApByVpath", myMsg.GetXmlStr, "").Tables["AllApByVpath"];

        DataRow myRow = dt.NewRow();
        myRow["ap_id"] = 0;
        myRow["ap_name"] = myLabel.GetErrMsg("SelectPlease");
        myRow["ap_link"] = "bbb";
        myRow["ap_vpath"] = "All";

        dt.Rows.InsertAt(myRow, 0);

        ddlApName.DataSource = dt.DefaultView;
        ddlApName.DataValueField = "ap_id";
        ddlApName.DataTextField = "ap_name";
        ddlApName.DataBind();
    }
    private void GenUpdateData()
    {
        bs_ApManager mybs = new bs_ApManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("menu_id", GetMenuID());
        string strReturn = mybs.DoReturnStr("GetMenuByMenuID", myMsg.GetXmlStr, "");

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("Return") == "OK")
        {
            txtMenuNo.Text = myMsg.Query("menu_no");
            txtMenuName.Text = myMsg.Query("menu_nm");
            txtMenuLink.Text = myMsg.Query("menu_link");
            ddlApName.Items.FindByValue(myMsg.Query("ap_id")).Selected = true;
            if (myMsg.Query("check_mk") == "Y") chkCheckMK.Checked = true; else chkCheckMK.Checked = false;
            txtManageMK.Text = myMsg.Query("manage_mk");
        }
        else
        {
            btnOK.Visible = false;
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myMsg.Query("Return");
        }
    }
    private string GenDBXML()
    {
        PccMsg myMsg = new PccMsg();
        if (Request.Params["Type"] == null || Request.Params["Type"].ToString() != "New")
        {
            myMsg.CreateFirstNode("menu_id", GetMenuID());
        }

        myMsg.CreateFirstNode("ap_id", ddlApName.SelectedItem.Value);

        myMsg.CreateFirstNode("menu_no", txtMenuNo.Text);
        myMsg.CreateFirstNode("menu_nm", txtMenuName.Text);
        myMsg.CreateFirstNode("menu_link", txtMenuLink.Text);

        if (chkCheckMK.Checked) myMsg.CreateFirstNode("check_mk", "Y"); else myMsg.CreateFirstNode("check_mk", "N");

        myMsg.CreateFirstNode("manage_mk", txtManageMK.Text.ToString().ToUpper());

        return myMsg.GetXmlStr;
    }
    protected void btnAddComeOn_Click(object sender, System.EventArgs e)
    {
        bs_UserManager mybs = new bs_UserManager(ConfigurationSettings.AppSettings["ConnectionType"] , ConfigurationSettings.AppSettings["ConnectionServer"], ConfigurationSettings.AppSettings["ConnectionDB"], ConfigurationSettings.AppSettings["ConnectionUser"], ConfigurationSettings.AppSettings["ConnectionPwd"],Session["UserIDAndName"].ToString(),ConfigurationSettings.AppSettings["EventLogPath"]);
            PccMsg myMsg = new PccMsg();
            string strUserID,strReturn,errormsg = "",strXML = "";
            bool bSelect = false;

            for (int i = 0; i < DataGrid1.Items.Count ; i++)
            {
                if (((CheckBox)DataGrid1.Items[i].Cells[6].Controls[1]).Checked)
                {
                    strUserID = DataGrid1.Items[i].Cells[1].Text;
                    myMsg.LoadXml();
                    myMsg.CreateFirstNode("ap_id",Request.QueryString["ApID"]);
                    myMsg.CreateFirstNode("user_id",strUserID);
                    myMsg.CreateFirstNode("mana_mk","N");
                    myMsg.CreateFirstNode("upd_id",Session["UserID"].ToString());

                    //strXML = GetUserXML(strUserID);

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

                    myMsg.LoadXml(strReturn);

                    if (myMsg.Query("returnValue") != "0")
                    {
                        lblMsg.Font.Size = FontUnit.Large;
                        lblMsg.Text = myMsg.Query("errmsg");
                        break;
                    }

                    bSelect = true;
                }
            }

            if (bSelect)
            {
                if (myMsg.Query("returnValue") == "0")
                {
                    Response.Redirect(USERMANAGE + "?ApID=" + Request.QueryString["ApID"] + "&QueryCondition=" + Request.QueryString["QueryCondition"]);
                }
                else
                {
                    lblMsg.Font.Size = FontUnit.Large;
                    if (errormsg == "")
                        lblMsg.Text = myMsg.Query("errmsg");
                    else
                        lblMsg.Text = errormsg;

                }
            }
            else
            {
                PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"),Session["CodePage"].ToString() ,"Label");
                lblMsg.Font.Size = FontUnit.Large;
                if (errormsg == "")
                    lblMsg.Text = myLabel.GetErrMsg("lbl0014","SysManager/UserManager");
                else
                    lblMsg.Text = errormsg;

            }
    }
    private string GetUserXML(string user_id)
    {
        PccBsSystemForC.bs_UserManager mybs = new PccBsSystemForC.bs_UserManager(ConfigurationSettings.AppSettings["ConnectionType"] , ConfigurationSettings.AppSettings["ConnectionServer"], ConfigurationSettings.AppSettings["ConnectionDB"], ConfigurationSettings.AppSettings["ConnectionUser"], ConfigurationSettings.AppSettings["ConnectionPwd"],Session["UserIDAndName"].ToString(),ConfigurationSettings.AppSettings["EventLogPath"]);
            PccCommonForC.PccMsg myMsg = new PccCommonForC.PccMsg();
            myMsg.CreateFirstNode("user_id",user_id);

            PccMsg myReturnMsg = new PccMsg();
            myReturnMsg.LoadXml(mybs.DoReturnStr("GetUserData",myMsg.GetXmlStr,""));

            //10/6還要繼續做XML的方法 20041006
            string fact_id = myReturnMsg.Query("fact_id");
            myReturnMsg.CreateFirstNode("fact_no", GetFactNoByFactID(fact_id));

            return myReturnMsg.GetXmlStr;
    }