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);
        }
    }
    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)
    {
        PccMsg myMsg = new PccMsg(Request.Params["Method"].ToString());
        string strKey = myMsg.Query("Key");
        string strXML = "<PccMsg><user_id>" + Session["UserID"].ToString() + "</user_id><ask_id>" + strKey + "</ask_id></PccMsg>";

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

        DataTable dt;

        string strReturn = mybs.DoReturnStr("DeleteAskUser", strXML, "");
        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            //要送信給被駁回的申請者 20040418
            dt = mybs.DoReturnDataSet("GetAskByAskID", "", strKey).Tables["Ask"];

            if (!SendMailToApply(dt.Rows[0]["ap_id"].ToString(), dt.Rows[0]["ap_name"].ToString(), dt.Rows[0]["user_desc"].ToString(), dt.Rows[0]["email"].ToString()))
            {
                return;
            }
            Response.Redirect(CHECKUSERMANAGE + "?ApID=" + Request.Params["ApID"].ToString());
        }
        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");
        }
    }
        public string db_pro_delete_QCFactDept(string strXML)
        {
            SqlParameter[] para = {
               								new SqlParameter("@user_id", SqlDbType.Decimal,18)
                                    ,new SqlParameter("@fact_no",SqlDbType.Char,4)
                                    ,new SqlParameter("@dept_no",SqlDbType.Char, 10)
                                    ,new SqlParameter("@sec_no",SqlDbType.Char, 10)
                                   };

            PccMsg myMsg = new PccMsg(strXML);
            para[0].Value = decimal.Parse(myMsg.Query("user_id"));
            para[1].Value = myMsg.Query("fact_no");
            para[2].Value = myMsg.Query("dept_no");
            para[3].Value = myMsg.Query("sec_no");

            int rowsAffected = 0;
            string errMsg = "";
            try
            {
                RunProcedure("pro_delete_QCFactDept", para, ref rowsAffected);
            }
            catch (Exception ex) { errMsg = ex.Message; }

            return errMsg;
        }
    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");
        }
    }
Beispiel #10
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, "");
    }
Beispiel #11
0
    public static string GetImgConditionsType(string type)
    {
        string dataPath = System.Web.HttpContext.Current.Server.MapPath("~") + "/XmlDoc/Data.xml";

        PccMsg myMsg = new PccMsg();
        myMsg.Load(dataPath);
        return myMsg.Query("IMGConditions/" + type);
    }
Beispiel #12
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();
    }
Beispiel #13
0
        //web.huuminh 2014/04/19
        //insert data_qc_web erp
        public string db_insupd_data_qc_web(string strXML)
        {
            PccMsg myMsg = new PccMsg();
            myMsg.LoadXml(strXML);

            string fact_no = myMsg.Query("fact_no");
            string rec_date = myMsg.Query("rec_date");
            string vou_no = myMsg.Query("vou_no");
            string sec_no = myMsg.Query("sec_no");
            string bad_no = myMsg.Query("bad_no");
            string time_no = myMsg.Query("time_no");
            string kind_mk = myMsg.Query("kind_mk");
            string upd_user = myMsg.Query("upd_user");
            string upd_time = myMsg.Query("upd_time");
            string qty = myMsg.Query("qty");
            string qty_chk = myMsg.Query("qty_chk");
            string dept_no = myMsg.Query("dept_no");
            string Type = myMsg.Query("Type");

            int num = int.Parse(qty);
            string strReturn;

            string txt = "";
            string txt2 = "";
            if (Type == "0")
            {
                txt = "insert into data_qc_web(fact_no,rec_date,fact_odr_no,sec_no,bad_no,time_no,kind_mk,upd_user,upd_time,qty,qty_chk,dept_no)";
                txt +=
                    "  VALUES('" + fact_no + "','" + rec_date + "','" + vou_no + "','" + sec_no + "','" + bad_no + "','" + time_no + "','" + kind_mk + "','" + upd_user + "','" + upd_time + "','" + qty + "','" + qty_chk + "','" + dept_no + "')";
            }
            else
            {
                txt = "update data_qc_web set qty=NVL(qty,0)+"+qty+" , qty_chk='" + qty_chk + "'";
                txt += " where fact_odr_no='" + vou_no + "'"
                            + " and fact_no = '" + fact_no + "' "
                            + " AND rec_date = '" + rec_date + "' "
                            + " AND sec_no = '" + sec_no + "' "
                            + " AND bad_no = '" + bad_no + "' "
                            + " AND kind_mk = '" + kind_mk + "' "
                            + " AND time_no = '" + time_no + "' "
                            + " AND upd_user = '******' "
                            + " AND dept_no = '" + dept_no + "' "
                            + " AND dept_no = '" + dept_no + "' ";
            }

            try
            {
                int iCount;
                ExcuteSQL(txt, out iCount);
               // ExcuteSQL(txt2, out iCount);
                strReturn = "OK";
            }
            catch (Exception e)
            {
                strReturn = e.ToString();
            }
            return strReturn;
        }
    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, "");
    }
Beispiel #16
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;
    }
    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();
    }
Beispiel #18
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, "");
    }
Beispiel #19
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;
    }
Beispiel #20
0
        //web.huuminh lay dieu kien hinh anh
        public DataSet db_getImgConditions(string strXML)
        {
            DataSet dsReturn = new DataSet();
            PccMsg myMsg = new PccMsg(strXML);
            SqlParameter[] parameters = {

                                        };

            dsReturn = RunProcedure("pro_GetImgConditions", parameters, "etImgConditions");
            return dsReturn;
        }
    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, "");
    }
Beispiel #22
0
        //Lấy toàn bộ mã bộ phận của 1 xưởng
        public DataSet db_GetDeparment(string strXML)
        {
            PccMsg myMsg = new PccMsg(strXML);
            string myApID = myMsg.Query("ApID");
            string myFact_id = myMsg.Query("Fact_id");
            string strSQL = "  Select dept_id,(ltrim(rtrim(dept_no))+'---'+dept_nm)dept_nm From  SHR_DEPT Where  ltrim(rtrim(fact_id))='"+myFact_id+"'  Order by dept_no";

            SqlDataAdapter objUserFact=new SqlDataAdapter(strSQL,m_Conn);
            DataSet dsReturn = new DataSet();
            objUserFact.Fill(dsReturn,"SHR_DEPT");
            return dsReturn;
        }
Beispiel #23
0
        //Lấy toàn bộ mã xưởng
        public DataSet db_GetFactory(string strXML)
        {
            PccMsg myMsg = new PccMsg(strXML);
            string myApID = myMsg.Query("ApID");

            string strSQL = " Select ltrim(rtrim(fact_id))fact_id,(ltrim(rtrim(fact_no))+'---'+fact_nm)fact_nm From  SHR_FACT Where ap_id='"+myApID+"' Order by fact_no";

            SqlDataAdapter objUserFact=new SqlDataAdapter(strSQL,m_Conn);
            DataSet dsReturn = new DataSet();
            objUserFact.Fill(dsReturn,"SHR_FACT");
            return dsReturn;
        }
    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");
        }
    }
        public DataSet pro_GetFactStatistics(string strXML)
        {
            PccMsg myMsg = new PccMsg(strXML);
            string sFactNo = myMsg.Query("fact_no");

            SqlParameter[] paraValue = {
                                          new SqlParameter("@fact_no", SqlDbType.Char,4)

                                      };
            paraValue[0].Value = sFactNo;

            return RunProcedure("pro_GetFactStatistics", paraValue, "pro_GetLogBookStatistics");
        }
Beispiel #26
0
    private void SetDataToDdl(DataRow myRow, DropDownList ddl, string myStr)
    {
        PccMsg myMsg = new PccMsg(myStr);

        ListItem ddlItem = new ListItem();
        int col = int.Parse(myMsg.Query("col"));

        for (int i = 0; i < col; i++)
            ddlItem.Text += myRow[myMsg.Query("col" + i.ToString())].ToString() + ":";

        ddlItem.Value = myRow[myMsg.Query("ID")].ToString();
        ddl.Items.Add(ddlItem);
    }
Beispiel #27
0
        public DataSet db_get_UserQc(string strXML)
        {
            DataSet dsReturn = new DataSet();
            PccMsg myMsg = new PccMsg(strXML);
            SqlParameter[] parameters = {
                                            new SqlParameter("@dept_no",SqlDbType.Char,10),
                                            new SqlParameter("@sec_no",SqlDbType.Char,10)

                                        };
            parameters[0].Value = myMsg.Query("dept_no");
            parameters[1].Value = myMsg.Query("sec_no");
            dsReturn = RunProcedure("pro_Get_UserQc", parameters, "UserQc");
            return dsReturn;
        }
    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;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null) return;

        //設定Title 20041104
        for (int i = 0; i < Header1.Controls.Count; i++)
        {
            if (Header1.Controls[i].ID == TITLE)
            {
                Label mylblTitle = (Label)(Header1.Controls[i]);
                mylblTitle.Text = "使用者的廠別權限";
            }
        }
        m_ap_id = Request.Params["ApID"];
        PccMsg myMsg = new PccMsg();
        if (!IsPostBack)
        {
            //設定之前User鍵入的查詢資料。 ...ting...
            if (Request.Params["QueryCondition"] != null && Request.Params["QueryCondition"].ToString() != "")
            {
                myMsg.LoadXml(Request.Params["QueryCondition"]);
                txtusernm.Text = myMsg.Query("QueryCondition/txtusernm");
                txtfactno.Text = myMsg.Query("QueryCondition/txtfactno");
            }

            Session["Usertemporary"] = "";
            Session["Facttemporary"] = "";

            if (CheckQueryString("Method") != "")
            {
                myMsg.LoadXml(Request.QueryString["Method"]);
                string method = myMsg.Query("Method");
                if (method == "MasterDelFunc")
                {
                    panelDelUser.Visible = true;
                    PanelGrid.Visible = false;
                    m_uf_id = myMsg.Query("Key");
                    txtuser.Value = m_uf_id;
                    m_fact_nm = myMsg.Query("KeyOther");
                    lblDelMsg1.Text = "您是否要將<font color=green><b>" + m_fact_nm + "</b></font>此廠別從此使用者移除?";
                }

            }
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            SetLabel(ref myLabel);
            GenMasterTable(ref myLabel);
        }
    }
    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--", ""));
    }