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");
        }
    }
Exemplo n.º 2
0
    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>");
        }
    }
Exemplo n.º 3
0
    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);
        }
    }
Exemplo n.º 4
0
        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 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 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 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 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 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"]);
        }
    }
Exemplo n.º 10
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;
        }
Exemplo n.º 11
0
    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");
        }
    }
Exemplo n.º 12
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);
    }
Exemplo n.º 13
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;
        }
Exemplo n.º 14
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);
    }
Exemplo n.º 15
0
        public DataSet pro_GetLogBookStatistics(string strXML)
        {
            PccMsg myMsg = new PccMsg(strXML);
            string sFactNo = myMsg.Query("fact_no");
            string sStartDate = myMsg.Query("start_date");
            string sEndDate = myMsg.Query("end_date");

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

                                      };
            paraValue[0].Value = sFactNo;
            paraValue[1].Value = sStartDate;
            paraValue[2].Value = sEndDate;

            return RunProcedure("pro_GetLogBookStatistics", paraValue, "pro_GetLogBookStatistics");
        }
    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"]);
        }
    }
    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");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(DialogContentPage));
        if (Session["UserID"] == null) return;
        // 將使用者程式碼置於此以初始化網頁
        string xmlLoginInfo = Session["XmlLoginInfo"].ToString();
        PccMsg myInfoMsg = new PccMsg(xmlLoginInfo);
        xmlUserID = myInfoMsg.Query("UserID").ToString().Trim();
        xmlUserName = myInfoMsg.Query("UserName").ToString().Trim();

        if (!IsPostBack)
        {

             xmlFact_no = _DropDownList.GetFactNoByUserID(Session["UserID"].ToString().Trim());
            lblFactNo.Text = xmlFact_no;
          //lay Dpet
            _DropDownList._Get_ControlDeptByfact(ddlDeptNo, xmlFact_no);
            _DropDownList._Get_ControlSecByDept(ddlSec, xmlFact_no, ddlDeptNo.SelectedValue.ToString());
            GetSec();
        }
    }
Exemplo n.º 19
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;
        }
Exemplo n.º 20
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;
        }
Exemplo n.º 21
0
    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>");
        }
    }
Exemplo n.º 22
0
    protected void btnApply_Click(object sender, System.EventArgs e)
    {
        if (!CheckVerifyNumber()) 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"]);
        string strReturn = GetSendXML();
        strReturn = mybs.DoReturnStr("InsertAskUser", strReturn, "");

        PccMsg myMsg = new PccMsg(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            lblMsg.Font.Size = FontUnit.Medium;
            lblMsg.Text = "申請成功,請等待管理者Mail通知!";
            txtusr_pas.Attributes["value"] = txtusr_pas.Text;
            txtReusr_pas.Attributes["value"] = txtusr_pas.Text;
            SetTextColor();
            ddlApplcation.Enabled = false;
            btnApply.Enabled = false;
            //20050630新增可以給多個管理者
            string ap_id = ddlApplcation.SelectedItem.Value;
            string[] arrEmail = System.Configuration.ConfigurationManager.AppSettings[ap_id + "-Email"].ToString().Split(';');
            string[] arrName = System.Configuration.ConfigurationManager.AppSettings[ap_id + "-Name"].ToString().Split(';');

            for (int i = 0; i < arrEmail.Length; i++)
            {
                if (!SendMailToManager(arrEmail[i], arrName[i]))
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(),"new", "<script language=javascript>alert('寄送郵件失敗!');</script>");
                }
            }
            //-------------------------------

        }
        else
        {
            lblMsg.Font.Size = FontUnit.Medium;
            lblMsg.Text = myMsg.Query("errmsg");
        }
    }
Exemplo n.º 23
0
        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");
        }
Exemplo n.º 24
0
        public string db_pro_cancel_ImgConditions(string strXML)
        {
            SqlParameter[] para = {
                                     new SqlParameter("@ID",SqlDbType.Decimal,18)
                                     ,new SqlParameter("@add_id",SqlDbType.Decimal, 18)
                                    ,new SqlParameter("@close_date",SqlDbType.VarChar,8)
                                   };
            PccMsg myMsg = new PccMsg(strXML);
            para[0].Value = decimal.Parse(myMsg.Query("ID"));
            para[1].Value = decimal.Parse(myMsg.Query("add_id"));
            para[2].Value = DateTime.Now.ToString("yyyyMMdd");

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

            return errMsg;
        }
Exemplo n.º 25
0
    protected void btnOK_Click(object sender, System.EventArgs e)
    {
        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 = "";

        if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "New")
            strReturn = mybs.DoReturnStr("InsertProMenu", GenDBXML(), "");
        else
            strReturn = mybs.DoReturnStr("UpdateProMenu", GenDBXML(), "");

        myMsg.LoadXml(strReturn);

        if (myMsg.Query("returnValue") == "0")
        {
            Response.Redirect(APMANAGE + "?ApID=" + Request.QueryString["ApID"] + "&QueryCondition=" + Request.QueryString["QueryCondition"]);
        }
        else
        {
            lblMsg.Font.Size = FontUnit.Large;
            lblMsg.Text = myMsg.Query("errmsg");
        }
    }
    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);
        }
    }
Exemplo n.º 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null) return;

        m_ap_id = Request.Params["ApID"];
        PccMsg myMsg = new PccMsg();
        if (CheckQueryString("Method") != "")
        {
            myMsg.LoadXml(Request.QueryString["Method"]);
            string method = myMsg.Query("Method");
            if (method == "DetailDelFunc")
            {
                panelDelUser.Visible = true;
                PanelGrid.Visible = false;
                m_Fgrp_Id = myMsg.Query("Key");
                txtuser.Value = m_Fgrp_Id;
                m_Fgrp_Nm = myMsg.Query("KeyOther");
                lblDelMsg1.Text = "您是否要將<font color=green><b>" + m_Fgrp_Nm + "</b></font>此廠群組從此使用者(<font color=green><b>" + CheckQueryString("User_Desc") + "</b>)中移除?";
            }

        }
        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");
            }

            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            SetLabel(ref myLabel);
            GenMasterTable(ref myLabel);
        }
    }
Exemplo n.º 28
0
 private string GetMenuID()
 {
     PccMsg myMsg = new PccMsg();
     try
     {
         if (Request.Params["Method"] != null)
             myMsg.LoadXml(Request.Params["Method"].ToString());
         return myMsg.Query("Key");
     }
     catch
     {
         return "0";
     }
 }
Exemplo n.º 29
0
    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");
        }
    }
Exemplo n.º 30
0
    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;

            }
    }