protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null) return;

        // 將使用者程式碼置於此以初始化網頁
        if (!IsPostBack)
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            SetLabel(ref myLabel);
            BindDdlData(ref myLabel);

            if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "New")
            {
                //設定所選的應用程式
                SetApSelectedData(Request.QueryString["Key"]);
                txtManageMK.Text = "N";
            }
            else
            {
                GenUpdateData();
                txtMenuNo.ReadOnly = true;
                ddlApName.Enabled = false;
            }
        }
    }
    private void SetLabel()
    {
        PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");
        lbType.Text = myLabel.GetErrMsg("lbl0010", "QC/Tilte");
        lbPath.Text = myLabel.GetErrMsg("lbl0016", "QC/Tilte");

        btnOK.Text = myLabel.GetErrMsg("btnOK");
        btnCancel.Text = myLabel.GetErrMsg("btnCancel");
    }
    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");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");

        if (IsPostBack == false)
        {

            LoadData();
            SetLabel();

        }

        LoadUserInfo();
    }
示例#5
0
    public static string GetTypeName(string type_check, PccErrMsg myLabel)
    {
        string CD = myLabel.GetErrMsg("lbl0005", "QC/Tilte");
        string KT = myLabel.GetErrMsg("lbl0006", "QC/Tilte");

        string type_name = "";
        if (type_check == "0")
            type_name = CD + ", " + KT;
        else if (type_check == "1")
            type_name = CD;
        else if (type_check == "2")
            type_name = KT;

        return type_name;
    }
    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");
        }
    }
    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();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // 將使用者程式碼置於此以初始化網頁
        if (Session["UserID"] == null) return;

        lblMsg.Visible = false;

        m_ApID = Request.Params["ApID"];

        if (!IsPostBack)
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            SetLabel(ref myLabel);
            GenMasterTable(ref myLabel);

            GenTree(ref TreeView1);
            //TreeView1.ExpandDepth = 2;
            //TreeView1.ExpandLevel = 2;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null) return;

        // 將使用者程式碼置於此以初始化網頁
        if (!IsPostBack)
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            SetLabel(ref myLabel);
            if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "New")
            {
                lblApNo.Visible = false;
                txtApNo.Visible = false;
            }
            else
            {
                GenUpdateData();
                txtApNo.ReadOnly = true;
            }
        }
    }
示例#10
0
 private void SetLabel()
 {
     PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");
     lbFact_no.Text = myLabel.GetErrMsg("lbl0006", "OrdSignWeb/OrdSign") + ":";
     lbDept_no.Text = myLabel.GetErrMsg("lbl0007", "SysManager/UserManager");
     lbUserDesc.Text = myLabel.GetErrMsg("lbl0013", "SysManager/UserManager");
     btnSearch.Text = myLabel.GetErrMsg("btnQuery");
     btnClear.Value = myLabel.GetErrMsg("btnClear");
 }
示例#11
0
    private void GenTableQCHeader(ref Table dTable, string user_id)
    {
        PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");

        string cssClass = "cssGridHeaderDetails";

        TableRow row = new TableRow();
        row.HorizontalAlign = HorizontalAlign.Center;
        TableCell cell = new TableCell();

        cell.Text = myLabel.GetErrMsg("lbl0006", "OrdSignWeb/OrdSign");// Xưởng
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0004", "QC/Tilte");// Bộ Phận
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0001", "QC/Tilte");// Mã Tổ
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0002", "QC/Tilte");// Tên Tổ
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0003", "QC/Tilte");// Loại Tổ
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        Image imgAdd = new Image();
        imgAdd.ImageUrl = "~/Images/Icon/addItem.gif";
        imgAdd.Style["cursor"] = "pointer";
        imgAdd.Attributes.Add("onclick", "window.location.replace('QCAddFactDept.aspx?user_id=" + user_id + "');");

        cell = new TableCell();
        cell.Controls.Add(imgAdd);
        cell.CssClass = cssClass;

        row.Cells.Add(cell);

        dTable.Rows.Add(row);
    }
示例#12
0
    private void GenTableQCData(ref Table dTable, string user_id, string fact_no, string dept_no)
    {
        string cssClass = "";
        BasicData bd = new BasicData();
        DataTable dtData = bd.GetQCFactDept(user_id, fact_no, dept_no, "");

        PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");

        int i = 0;
        foreach (DataRow dr in dtData.Rows)
        {
            if (i % 2 == 1) cssClass = "cssGridRowDetailsAlternating";
            else cssClass = "cssGridRow";

            i++;
            TableRow row = new TableRow();
            row.HorizontalAlign = HorizontalAlign.Center;
            TableCell cell = new TableCell();

            cell.Text = dr["fact_no"].ToString();// Xưởng
            cell.CssClass = cssClass;
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = dr["dept_name"].ToString();// Bộ Phận
            cell.CssClass = cssClass;
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = dr["sec_no"].ToString();// Mã Tổ
            cell.CssClass = cssClass;
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = dr["sec_name"].ToString();// Tên Tổ
            cell.CssClass = cssClass;
            row.Cells.Add(cell);

            #region type_check

            cell = new TableCell();
            cell.Text = BasicData.GetTypeName(dr["type_Check"].ToString(), myLabel);// Loại Tổ
            cell.Width = Unit.Pixel(200);
            cell.CssClass = cssClass;
            row.Cells.Add(cell);
            #endregion

            string id = user_id.Split('.')[0] + "-" + dr["fact_no"].ToString().Trim() + "-" + dr["dept_no"].ToString().Trim() + "-" + dr["sec_no"].ToString().Trim();

            Image imgDelete = new Image();
            imgDelete.ImageUrl = "~/Images/Icon/delete.gif";
            imgDelete.Style["cursor"] = "pointer";
            imgDelete.Attributes.Add("onclick", "DeleteQCFactDept('" + id + "');");

            cell = new TableCell();
            cell.Controls.Add(imgDelete);
            cell.CssClass = cssClass;

            row.Cells.Add(cell);

            dTable.Rows.Add(row);
        }
        if (dtData.Rows.Count == 0)
        {
            TableRow row = new TableRow();
            row.HorizontalAlign = HorizontalAlign.Center;
            TableCell cell = new TableCell();
            cell.Text = "No Data";
            cell.CssClass = "cssGridRow";
            cell.ColumnSpan = 6;
            row.Cells.Add(cell);
            dTable.Rows.Add(row);

        }
    }
示例#13
0
    private void GenTableHeader()
    {
        string cssClass = "cssGridHeader";
        PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");

        TableRow row = new TableRow();
        row.HorizontalAlign = HorizontalAlign.Center;
        TableCell cell = new TableCell();

        cell.Text = "No";
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0023", "SysManager/UserManager"); // Số Thẻ
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0032", "SysManager/UserManager");// Tài Khoản
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0019", "SysManager/UserManager");// Họ Tên
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = myLabel.GetErrMsg("lbl0006", "OrdSignWeb/OrdSign");// Xưởng
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = "";
        cell.CssClass = cssClass;
        row.Cells.Add(cell);

        mTable.Rows.Add(row);
    }
    private void GenMasterTableData(ref PccErrMsg myLabel)
    {
        #region 取得Login的使用者是否有刪除的權限

        GetMenuAuth myAuth = new GetMenuAuth();
        myAuth.AspxFile = "FactGroupManage104.aspx";
        bool del_auth = myAuth.IsDeleteAuth();

        #endregion

        #region 取得廠群組的主資料ByUpID

        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"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("StartRecord", PageControl1.StartRecord.ToString());
        myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString());
        myMsg.CreateFirstNode("Up_Id", m_SrcUp_Id);
        myMsg.CreateFirstNode("Ap_Id", m_ApID);
        myMsg.CreateFirstNode("Fgrp_Nm", TxtQueryFgrpNm.Text);
        string strXML = myMsg.GetXmlStr;

        DataSet myDS_FGRPDs = mybs.DoReturnDataSet("Get_DS_FGRPByUpID", strXML, "");
        DataTable myDS_FGRPData = myDS_FGRPDs.Tables["DS_FGRPByUpID"];

        #endregion

        if (myDS_FGRPData != null && myDS_FGRPData.Rows.Count > 0)
        {
            #region 定義基本變數

            int MasterCount = 0;
            string MasterStyle = string.Empty;
            PccMsg myTempMsg;
            PccMsg myMsg1;
            PccRow myRow;
            //取出資料總筆數
            PageControl1.TotalSize = myDS_FGRPDs.Tables["TCounts"].Rows[0]["Counts"].ToString();
            PageControl1.BuildPager();

            #endregion

            #region 明細資料類別之共同參數

            myMsg.LoadXml();
            myMsg.CreateFirstNode("TableClass", "ActDocTB");
            myMsg.CreateFirstNode("RowHeaderClass", "TDShowHeader");
            myMsg.CreateFirstNode("RowClass1", "ffd000");
            myMsg.CreateFirstNode("RowClass2", "fff000");
            string strClassXML = myMsg.GetXmlStr;

            XmlElement myNode;
            //要取得明細資料的Table變數
            DataTable tblUserGroup, tblFactGroup;

            #endregion

            #region 內建廠別明細資料的欄位參數

            string[] FFields = { "編號", "廠別", "廠別名稱", "事業群", "公司編號", "刪除" };
            int[] FFieldsPercent = { 5, 15, 35, 20, 15, 10 };
            string[] FFieldsItem = { "--NO--", "fact_no", "fact_nm", "fgrp_nm", "comp_no", "factgrp_id" };
            string[] FFieldType = new string[6];
            FFieldType[0] = "--NO--";
            FFieldType[1] = "<PccMsg><Type>Text</Type></PccMsg>";
            FFieldType[2] = "<PccMsg><Type>Text</Type></PccMsg>";
            FFieldType[3] = "<PccMsg><Type>Text</Type></PccMsg>";
            FFieldType[4] = "<PccMsg><Type>Text</Type></PccMsg>";

            #endregion

            #region 內建使用者明細資料的欄位參數

            string[] UFields = { "編號", "電子郵件帳號", "姓名", "廠別", "事業群", "分機", "刪除" };
            int[] UFieldsPercent = { 5, 30, 15, 15, 15, 10, 10 };
            string[] UFieldsItem = { "--NO--", "email", "user_desc", "fact_no", "fgrp_nm", "ext", "usergrp_id" };
            string[] UFieldType = new string[7];
            UFieldType[0] = "--NO--";
            UFieldType[1] = "<PccMsg><Type>Text</Type></PccMsg>";
            UFieldType[2] = "<PccMsg><Type>Text</Type></PccMsg>";
            UFieldType[3] = "<PccMsg><Type>Text</Type></PccMsg>";
            UFieldType[4] = "<PccMsg><Type>Text</Type></PccMsg>";
            UFieldType[5] = "<PccMsg><Type>Text</Type></PccMsg>";

            #endregion

            //再利用此Table再取得其每一列的資料,再Gen出主要的Table Row.
            foreach (DataRow myMasterRow in myDS_FGRPData.Rows)
            {
                #region 主要廠群組的資料列設定

                if (MasterCount % 2 == 0) MasterStyle = "eee000"; else MasterStyle = "fff000";
                myRow = new PccRow("", HorizontalAlign.Center, 0, 0);
                myRow.SetRowCss(MasterStyle);
                //編號
                myRow.AddTextCell(PageControl1.ListCount, 5);
                //廠群組名稱
                if (myAuth.IsAddAuth())
                {
                    myTempMsg = new PccMsg();
                    myTempMsg.CreateFirstNode("Href", PICKFACT + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString() + "&Method=" + GetMethod("PickFactToFgrpFunc", "Fgrp_Id", "Fgrp_Nm", myMasterRow) + "&QueryCondition=" + GetQueryCondition());
                    myTempMsg.CreateFirstNode("Text", myMasterRow["Fgrp_Nm"].ToString().Trim());
                    myRow.AddLinkHrefCell(myTempMsg.GetXmlStr, 56);
                }
                else
                {
                    myRow.AddTextCell(myMasterRow["Fgrp_Nm"].ToString(), 56);
                }

                //廠別檢視
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", "檢視所屬廠別");
                myTempMsg.CreateFirstNode("LinkID", "HLinkView" + myMasterRow["Fgrp_Id"].ToString());
                myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
                myTempMsg.CreateFirstNode("ClickFun", "doSection(view_F" + MasterCount.ToString() + ")");
                myRow.AddLinkCell(myTempMsg.GetXmlStr, 12);
                //使用者檢視
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", "檢視所屬使用者");
                myTempMsg.CreateFirstNode("LinkID", "HLinkView" + myMasterRow["Fgrp_Id"].ToString());
                myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
                myTempMsg.CreateFirstNode("ClickFun", "doSection(view_U" + MasterCount.ToString() + ")");
                myRow.AddLinkCell(myTempMsg.GetXmlStr, 12);
                //管理
                myTempMsg = new PccMsg();
                //判斷是否和上層ID是一樣的
                if (myMasterRow["Fgrp_Id"].ToString() != Request.Params["SrcUp_Id"])
                {
                    //先加入修改的Item
                    if (myAuth.IsUpdateAuth())
                    {
                        myTempMsg.CreateNode("LinkButton");
                        myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/edit.gif");
                        myTempMsg.AddToNode("ToolTip", myLabel.GetErrMsg("lbl0014", "SysManager/ApManager"));
                        myTempMsg.AddToNode("href", MYURL + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString());
                        myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                        myTempMsg.AddToNode("Method", GetMethod("MasterUpdateFunc", "Fgrp_Id", "Fgrp_Nm", myMasterRow));
                        myTempMsg.UpdateNode();
                    }
                    if (del_auth)
                    {
                        //再加入刪除的Item
                        myTempMsg.CreateNode("LinkButton");
                        myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/del.gif");
                        myTempMsg.AddToNode("ToolTip", myLabel.GetErrMsg("lbl0015", "SysManager/ApManager"));
                        myTempMsg.AddToNode("href", MYURL + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString());
                        myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                        myTempMsg.AddToNode("Method", GetMethod("MasterDelFunc", "Fgrp_Id", "Fgrp_Nm", myMasterRow));
                        myTempMsg.UpdateNode();
                    }
                    //再加入加入使用者的Item
                    if (myAuth.IsAddAuth())
                    {
                        myTempMsg.CreateNode("LinkButton");
                        myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/add.gif");
                        myTempMsg.AddToNode("ToolTip", "加入使用者");
                        myTempMsg.AddToNode("href", PICKUSER + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString());
                        myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                        myTempMsg.AddToNode("Method", GetMethod("AddUserFunc", "Fgrp_Id", "Fgrp_Nm", myMasterRow));
                        myTempMsg.UpdateNode();
                    }
                }

                myRow.AddMultiLinkCell(myTempMsg.GetXmlStr, 15);
                TblDs_Fgrp.Rows.Add(myRow.Row);

                #endregion

                #region 內建廠別明細資料的欄位參數,此處會取得資料,並設定給主表格

                //設定廠別明細欄位中多個Link Image的參數
                myMsg1 = new PccMsg();

                if (del_auth && myMasterRow["Fgrp_Id"].ToString() != Request.Params["SrcUp_Id"])
                {
                    myMsg1.CreateFirstNode("Type", "MultiLink");

                    myMsg1.CreateNode("LinkButton");
                    myMsg1.AddToNode("Image", Session["PageLayer"] + "images/del.gif");
                    myMsg1.AddToNode("ToolTip", "刪除此廠別與此廠群組之關係");
                    myMsg1.AddToNode("href", MYURL + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString() + "&Fgrp_Nm=" + myMasterRow["Fgrp_Nm"].ToString());
                    myMsg1.AddToNode("QueryCondition", GetQueryCondition());
                    myNode = myMsg1.CreateParentNode("Method");
                    myMsg1.AddToNode("MethodName", "FactDelFunc", ref myNode);
                    myMsg1.AddToNode("Key", "factgrp_id", ref myNode);
                    myMsg1.AddToNode("KeyOther", "fact_no", ref myNode);
                    myMsg1.UpdateNode(myNode);
                    myMsg1.UpdateNode();

                }
                else
                {
                    myMsg1.CreateFirstNode("Type", "Space");
                }

                FFieldType[5] = myMsg1.GetXmlStr;

                //設定要取得廠別資料的XML
                myMsg1.LoadXml();
                myMsg1.CreateFirstNode("Fgrp_Id", myMasterRow["Fgrp_Id"].ToString());
                tblFactGroup = mybs.DoReturnDataSet("get_DS_FACTGRPByFgrpID", myMsg1.GetXmlStr, string.Empty).Tables["DS_FACTGRP"];

                PccDetailTable myFDTable = new PccDetailTable("FDT" + myMasterRow["Fgrp_Id"].ToString());
                myFDTable.ClassXML = strClassXML;
                myFDTable.Fields = FFields;
                myFDTable.FieldsPercent = FFieldsPercent;
                myFDTable.FieldsItem = FFieldsItem;
                myFDTable.FieldsType = FFieldType;
                myFDTable.NewDataTable = tblFactGroup;

                myFDTable.Create();

                myRow.Reset();
                myRow.SetRowCss("off");
                myRow.SetRowID("view_F" + MasterCount);
                myRow.SetDefaultCellData("DGridTD", HorizontalAlign.Center, 0, 10);
                myRow.AddControl(myFDTable.NewTable, 100);

                TblDs_Fgrp.Rows.Add(myRow.Row);

                #endregion

                #region 內建使用者明細資料的欄位參數,此處會取得資料,並設定給主表格

                //設定廠別明細欄位中多個Link Image的參數
                myMsg1 = new PccMsg();

                if (del_auth && myMasterRow["Fgrp_Id"].ToString() != Request.Params["SrcUp_Id"])
                {
                    myMsg1.CreateFirstNode("Type", "MultiLink");

                    myMsg1.CreateNode("LinkButton");
                    myMsg1.AddToNode("Image", Session["PageLayer"] + "images/del.gif");
                    myMsg1.AddToNode("ToolTip", "刪除此使用者與此廠群組之關係");
                    myMsg1.AddToNode("href", MYURL + "?ApID=" + m_ApID + "&SrcUp_Id=" + m_SrcUp_Id + "&Up_Id=" + myMasterRow["Up_Id"].ToString() + "&Fgrp_Nm=" + myMasterRow["Fgrp_Nm"].ToString());
                    myMsg1.AddToNode("QueryCondition", GetQueryCondition());
                    myNode = myMsg1.CreateParentNode("Method");
                    myMsg1.AddToNode("MethodName", "UserDelFunc", ref myNode);
                    myMsg1.AddToNode("Key", "usergrp_id", ref myNode);
                    myMsg1.AddToNode("KeyOther", "user_desc", ref myNode);
                    myMsg1.UpdateNode(myNode);
                    myMsg1.UpdateNode();

                }
                else
                {
                    myMsg1.CreateFirstNode("Type", "Space");
                }

                UFieldType[6] = myMsg1.GetXmlStr;

                //設定要取得廠別資料的XML
                myMsg1.LoadXml();
                myMsg1.CreateFirstNode("Fgrp_Id", myMasterRow["Fgrp_Id"].ToString());
                tblUserGroup = mybs.DoReturnDataSet("get_DS_USERGRPByFgrpID", myMsg1.GetXmlStr, string.Empty).Tables["DS_USERGRP"];

                PccDetailTable myUDTable = new PccDetailTable("UDT" + myMasterRow["Fgrp_Id"].ToString());
                myUDTable.ClassXML = strClassXML;
                myUDTable.Fields = UFields;
                myUDTable.FieldsPercent = UFieldsPercent;
                myUDTable.FieldsItem = UFieldsItem;
                myUDTable.FieldsType = UFieldType;
                myUDTable.NewDataTable = tblUserGroup;

                myUDTable.Create();

                myRow.Reset();
                myRow.SetRowCss("off");
                myRow.SetRowID("view_U" + MasterCount);
                myRow.SetDefaultCellData("DGridTD", HorizontalAlign.Center, 0, 10);
                myRow.AddControl(myUDTable.NewTable, 100);

                TblDs_Fgrp.Rows.Add(myRow.Row);

                #endregion

                MasterCount += 1;
            } // end of foreach datarow
        }// end of if table count is 0
        else
        {
            PageControl1.TotalSize = "0";
            PageControl1.BuildPager();
        }
    }
示例#15
0
    private void SetLabel(ref PccErrMsg myLabel)
    {
        btnQuery.Text = myLabel.GetErrMsg("btnQuery");
        //lblTitle.Text = myLabel.GetErrMsg("lbl0006","SysManager/ApManager");

        lblApName.Text = myLabel.GetErrMsg("lbl0004", "SysManager/ApManager");
        lbtnAddAp.Text = myLabel.GetErrMsg("lbl0002", "SysManager/ApManager");
    }
    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 void GenMasterTableHeader(ref PccErrMsg myLabel)
    {
        PccRow myRow = new PccRow("DListHeaderTD", HorizontalAlign.Center, VerticalAlign.Middle, 0);

        myRow.AddTextCell("編號", 5);
        myRow.AddTextCell("使用者名稱", 10);
        myRow.AddTextCell("廠別", 35);
        myRow.AddTextCell("事業群", 15);
        myRow.AddTextCell("電子郵件帳號", 30);
        myRow.AddTextCell("挑選", 5);

        tab_user.CssClass = "ActDocTB";
        tab_user.Width = Unit.Percentage(100);
        tab_user.HorizontalAlign = HorizontalAlign.Center;
        tab_user.CellPadding = 2;
        tab_user.CellSpacing = 1;

        tab_user.Rows.Add(myRow.Row);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // 將使用者程式碼置於此以初始化網頁
        if (Session["UserID"] == null) return;

        GetMenuAuth myAuth = new GetMenuAuth();
        myAuth.AspxFile = "FactGroupManage104.aspx";

        //設定所要做的動作
        string strAction = string.Empty;

        if (myAuth.IsAddAuth())
            LbtnAddNewFgrp.Visible = true;

        m_ApID = Request.Params["ApID"];

        if (CheckQueryString("SrcUp_Id") != "")
        {
            m_SrcUp_Id = Request.Params["SrcUp_Id"];
        }

        if (CheckQueryString("Up_Id") != "")
        {
            m_Up_Id = Request.Params["Up_Id"];
        }

        PccMsg myMsg = new PccMsg();
        PccMsg myQueryMsg = new PccMsg();

        PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");

        if (CheckQueryString("Method") != "")
        {
            myMsg.LoadXml(Request.QueryString["Method"]);
            strAction = myMsg.Query("Method");
            switch (strAction)
            {
                case ("MasterUpdateFunc"):
                    m_FgrpId = myMsg.Query("Key");
                    break;
                case ("MasterDelFunc"):
                    m_FgrpId = myMsg.Query("Key");
                    break;
                case ("UpdFgrpFact"):
                    m_FgrpFactId = myMsg.Query("Key");
                    break;
                case "FactDelFunc":
                    m_FactGrpId = myMsg.Query("Key");
                    break;
                case "UserDelFunc":
                    m_UserGrpId = myMsg.Query("Key");
                    break;
            }

        }

        if (!IsPostBack)
        {
            string SrcUp_Id = string.Empty;
            if (Request.Params["SrcUp_Id"] != null)
            {
                SrcUp_Id = Request.Params["SrcUp_Id"].ToString();
                GenTree(ref TreeView1);
                //利用GetNodeIndex去設定m_CurrentNodeIndex的值,不需要再去設定一次Selected Lemor 20080312
                string aaa = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                //TreeView1.FindNode(GetNodeIndex(TreeView1.Nodes, SrcUp_Id)).Selected = true;
                //TreeView1.SelectedValue = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                //TreeView1.SelectedNodeIndex = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                if (m_CurrentNodeIndex != null)
                {
                    string[] a;
                    a = m_CurrentNodeIndex.Split('/');
                    TreeView1.ExpandDepth = a.Length - 1;
                    //TreeView1.ExpandLevel = a.Length - 1;
                    TreeView1.FindNode(m_CurrentNodeIndex).Selected = true;
                    TreeView1.FindNode(m_CurrentNodeIndex).Expand();

                    //TreeView1.SelectedValue = m_CurrentNodeIndex;
                    //TreeView1.SelectedNodeIndex = m_CurrentNodeIndex;
                }
            }

            //設定之前User鍵入的查詢資料。 2005/5/23
            if (CheckQueryString("QueryCondition") != "")
            {
                myQueryMsg.LoadXml(CheckQueryString("QueryCondition"));
                TxtQueryFgrpNm.Text = myQueryMsg.Query("QueryCondition/TxtQueryFgrpNm");
            }

            SetLabel(ref myLabel);
            switch (strAction)
            {
                case ("MasterUpdateFunc"):
                    ViewState["ActionType"] = "MasterUpdateFunc";
                    PalFgrp.Visible = false;
                    PalAddFgrp.Visible = true;
                    TxtFgrpNm.Text = myMsg.Query("KeyOther");
                    break;
                case ("MasterDelFunc"):
                    ViewState["ActionType"] = "MasterDeleteFunc";
                    PalFgrp.Visible = false;
                    PalAddFgrp.Visible = false;
                    PalDelFgrp.Visible = true;
                    LblDelMsg.Text = "注意:此動作會刪除此廠群組(<b>" + myMsg.Query("KeyOther") + "</b>)以下的所有廠群組及其相關之廠別和使用者!";
                    break;
                case ("UpdFgrpFact"):
                    m_FgrpFactId = myMsg.Query("Key");
                    break;
                case "FactDelFunc":
                    ViewState["ActionType"] = "FactDelFunc";
                    PalFgrp.Visible = false;
                    PalAddFgrp.Visible = false;
                    PalDelFgrp.Visible = false;
                    PalDelFact.Visible = true;
                    LblDelFactMsg.Text = "注意:此動作會刪除此廠群組(<b>" + CheckQueryString("Fgrp_Nm") + "</b>)以下的廠別(<b>" + myMsg.Query("KeyOther") + "</b>)!";
                    break;
                case "UserDelFunc":
                    ViewState["ActionType"] = "UserDelFunc";
                    PalFgrp.Visible = false;
                    PalAddFgrp.Visible = false;
                    PalDelFgrp.Visible = false;
                    PalDelFact.Visible = false;
                    PalDelUser.Visible = true;
                    LblDelUserMsg.Text = "注意:此動作會刪除此廠群組(<b>" + CheckQueryString("Fgrp_Nm") + "</b>)以下的使用者(<b>" + myMsg.Query("KeyOther") + "</b>)之權限!";
                    break;
                default:
                    GenMasterTable();
                    break;
            }

        }
        else
        {
            string SrcUp_Id = string.Empty;
            if (Request.Params["SrcUp_Id"] != null)
            {
                SrcUp_Id = Request.Params["SrcUp_Id"].ToString();
                GenTree(ref TreeView1);
                //利用GetNodeIndex去設定m_CurrentNodeIndex的值,不需要再去設定一次Selected Lemor 20080312
                string aaa = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                //TreeView1.FindNode(GetNodeIndex(TreeView1.Nodes, SrcUp_Id)).Selected = true;
                //TreeView1.SelectedValue = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                //TreeView1.SelectedNodeIndex = GetNodeIndex(TreeView1.Nodes, SrcUp_Id);
                if (m_CurrentNodeIndex != null)
                {
                    string[] a;
                    a = m_CurrentNodeIndex.Split('/');
                    TreeView1.ExpandDepth = a.Length - 1;
                    //TreeView1.ExpandLevel = a.Length - 1;
                    TreeView1.FindNode(m_CurrentNodeIndex).Selected = true;
                    TreeView1.FindNode(m_CurrentNodeIndex).Expand();
                    //TreeView1.SelectedValue = m_CurrentNodeIndex;
                    //TreeView1.SelectedNodeIndex = m_CurrentNodeIndex;
                }
            }
        }
    }
    private void GenMasterTable()
    {
        if (tab_user.Rows.Count > 0)
            tab_user.Rows.Clear();

        PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
        GenMasterTableHeader(ref myLabel);
        GenMasterTableData(ref myLabel);
    }
示例#20
0
    private void SetLabel(ref PccErrMsg myLabel)
    {
        //設定只能新增或修改此Vpath中的應用程式 2004/3/9
        if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "New")
        {
            //設定抬頭 20040607
            for (int i = 0; i < Header1.Controls.Count; i++)
            {
                if (Header1.Controls[i].ID == "PccTitle")
                {
                    Label mylblTitle = (Label)(Header1.Controls[i]);
                    mylblTitle.Text = myLabel.GetErrMsg("lbl0006", "SysManager/ApManager");
                }
            }
            txtVpath.Text = System.Configuration.ConfigurationManager.AppSettings["vpath"];
        }
        else
        {
            for (int i = 0; i < Header1.Controls.Count; i++)
            {
                if (Header1.Controls[i].ID == "PccTitle")
                {
                    Label mylblTitle = (Label)(Header1.Controls[i]);
                    mylblTitle.Text = myLabel.GetErrMsg("lbl0016", "SysManager/ApManager");
                }
            }
        }
        txtVpath.ReadOnly = true;

        lblApNo.Text = myLabel.GetErrMsg("lbl0003", "SysManager/ApManager");
        lblApName.Text = myLabel.GetErrMsg("lbl0004", "SysManager/ApManager");
        lblApLink.Text = myLabel.GetErrMsg("lbl0005", "SysManager/ApManager");
        lblApVpath.Text = myLabel.GetErrMsg("lbl0011", "SysManager/ApManager");

        btnOK.Text = myLabel.GetErrMsg("btnOK");
        btnCancel.Text = myLabel.GetErrMsg("btnCancel");
    }
 private void SetLabel(ref PccErrMsg myLabel)
 {
     //LblFgrp_Nm.Text = myLabel.GetErrMsg("lbl0002","SysManager/ApManager");
     BtnQuery.Text = myLabel.GetErrMsg("btnQuery");
 }
    private void GenMasterTableHader(ref PccErrMsg myLabel)
    {
        PccRow myRow = new PccRow("DListHeaderTD", HorizontalAlign.Center, VerticalAlign.Middle, 0);
        //編號
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0007", "SysManager/ApManager"), 5);
        //廠群組名稱
        myRow.AddTextCell("廠群組名稱(點選群組名稱可加入廠別)", 56);
        //廠別檢視
        myRow.AddTextCell("廠別檢視", 12);
        //使用者檢視
        myRow.AddTextCell("使用者檢視", 12);
        //管理
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0013", "SysManager/ApManager"), 15);

        TblDs_Fgrp.CssClass = "ActDocTB";
        TblDs_Fgrp.Width = Unit.Percentage(100);
        TblDs_Fgrp.HorizontalAlign = HorizontalAlign.Center;
        TblDs_Fgrp.CellPadding = 2;
        TblDs_Fgrp.CellSpacing = 1;
        TblDs_Fgrp.Rows.Add(myRow.Row);
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (Session["UserID"] == null) return;

            // 將使用者程式碼置於此以初始化網頁
            m_apid = Request.QueryString["ApID"].ToString();
            if (! IsPostBack)
            {
                PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"),Session["CodePage"].ToString() ,"Label");
                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"]);
                SetLabel(ref myLabel);
                //SetddlDept(ref myLabel,ref mybs);
                BindFactData(ref myLabel,ref mybs);
            //	BindDataGrid("user_desc",string.Empty,string.Empty,"0",ref mybs);
            }
            else
            {
                PanelGrid.Visible = true;
            }
    }
 private void SetLabel(ref PccErrMsg myLabel)
 {
     PccMsg myMsg = new PccMsg();
     btnQuery.Text = myLabel.GetErrMsg("btnQuery");
     btnClear.Value = myLabel.GetErrMsg("btnClear");
 }
    private void SetLabel(ref PccErrMsg myLabel)
    {
        //lblTitle.Text = "加入使用者至應用程式";
            //設定抬頭 20040607
            for(int i = 0 ; i < Header1.Controls.Count ; i++)
            {
                if (Header1.Controls[i].ID == "PccTitle")
                {
                    Label mylblTitle = (Label)(Header1.Controls[i]);
                    mylblTitle.Text = "加入使用者至應用程式";
                }
            }
            btnAddComeOn.Text = myLabel.GetErrMsg("lbl0002","SysManager/UserManager");
            btnQuery.Text = myLabel.GetErrMsg("btnQuery");
            btnCancel.Text = myLabel.GetErrMsg("btnCancel");

            lblFact.Text = "廠別:";
            //lblUserDesc.Text = myLabel.GetErrMsg("lbl0013","SysManager/UserManager");

            //Set DataGrid HeaderText
            DataGrid1.Columns[0].HeaderText = myLabel.GetErrMsg("lbl0004","ADTPurDoc/GroupManage");//編號
            DataGrid1.Columns[2].HeaderText = myLabel.GetErrMsg("lbl0030","ADTPurDoc/GroupManage");//電子郵件帳號
            DataGrid1.Columns[4].HeaderText = myLabel.GetErrMsg("lbl0005","ADTPurDoc/GroupManage");//使用者名稱
            DataGrid1.Columns[5].HeaderText = myLabel.GetErrMsg("lbl0006","ADTPurDoc/GroupManage");//廠別
            //DataGrid1.Columns[5].HeaderText = myLabel.GetErrMsg("lbl0007","ADTPurDoc/GroupManage");//部門別
            DataGrid1.Columns[3].HeaderText = myLabel.GetErrMsg("lbl0031","ADTPurDoc/GroupManage");//帳號
            DataGrid1.Columns[6].HeaderText = myLabel.GetErrMsg("lbl0008","ADTPurDoc/GroupManage");//選取
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null) return;

        // 將使用者程式碼置於此以初始化網頁
        for (int i = 0; i < Header1.Controls.Count; i++)
        {
            if (Header1.Controls[i].ID == TITLE)
            {
                Label mylblTitle = (Label)(Header1.Controls[i]);
                mylblTitle.Text = "挑選使用者至<font color=red><b>" + Request.Params["FactName"] + "</b></font>中";
            }
        }
        m_ap_id = Request.Params["ApID"];
        m_fact_id = Request.Params["FactID"];

        if (!IsPostBack)
        {
            //清除Session
            Session["Usertemporary"] = string.Empty;

            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            bs_UserManager mybsS = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
            BindFactData(ref myLabel, ref mybsS);
            SetLabel(ref myLabel);
            GenMasterTable();
        }
    }
    private void SetLabel(ref PccErrMsg myLabel)
    {
        //設定只能新增或修改此Vpath中的應用程式 2004/3/9
        if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "New")
        {
            //設定抬頭 20040607
            for (int i = 0; i < Header1.Controls.Count; i++)
            {
                if (Header1.Controls[i].ID == "PccTitle")
                {
                    Label mylblTitle = (Label)(Header1.Controls[i]);
                    mylblTitle.Text = myLabel.GetErrMsg("lbl0004", "SysManager/MenuManage");
                }
            }
        }
        else
        {
            for (int i = 0; i < Header1.Controls.Count; i++)
            {
                if (Header1.Controls[i].ID == "PccTitle")
                {
                    Label mylblTitle = (Label)(Header1.Controls[i]);
                    mylblTitle.Text = myLabel.GetErrMsg("lbl0019", "SysManager/MenuManage");
                }
            }
        }

        lblMenuNo.Text = myLabel.GetErrMsg("lbl0014", "SysManager/MenuManage");
        lblMenuName.Text = myLabel.GetErrMsg("lbl0003", "SysManager/MenuManage");
        lblMenuLink.Text = myLabel.GetErrMsg("lbl0015", "SysManager/MenuManage");
        lblApName.Text = myLabel.GetErrMsg("lbl0016", "SysManager/MenuManage");
        lblCheckMK.Text = myLabel.GetErrMsg("lbl0017", "SysManager/MenuManage");
        lblManageMK.Text = myLabel.GetErrMsg("lbl0018", "SysManager/MenuManage");

        btnOK.Text = myLabel.GetErrMsg("btnOK");
        btnCancel.Text = myLabel.GetErrMsg("btnCancel");
    }
示例#28
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (Session["UserID"] == null) return;

        // 將使用者程式碼置於此以初始化網頁

        //設定抬頭 20040607
        //			for(int i = 0 ; i < Header1.Controls.Count ; i++)
        //			{
        //				if (Header1.Controls[i].ID == "PccTitle")
        //				{
        //					Label mylblTitle = (Label)(Header1.Controls[i]);
        //					mylblTitle.Text = "應用程式管理";
        //				}
        //			}

        if (!IsPostBack)
        {
            //Calendar1.Text = "20000101";
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
            PccMsg myMsg = new PccMsg();
            SetLabel(ref myLabel);

            //設定之前User鍵入的查詢資料。 2004/3/8
            if (Request.Params["QueryCondition"] != null && Request.Params["QueryCondition"].ToString() != "")
            {
                myMsg.LoadXml(Request.Params["QueryCondition"].ToString());
                txtApName.Text = myMsg.Query("QueryCondition/txtApName");
            }

            GenMasterTable(ref myLabel);

            if (Request.Params["Method"] != null && Request.Params["Method"].ToString() != "")
            {
                myMsg.LoadXml(Request.Params["Method"].ToString());
                switch (myMsg.Query("Method"))
                {
                    case "MasterDelFunc":
                        MasterDelFunc(myMsg.Query("Key"), myMsg.Query("KeyOther"), ref myLabel);
                        break;
                    case "DetailDelFunc":
                        DetailDelFunc(myMsg.Query("Key"), myMsg.Query("KeyOther"), ref myLabel);
                        break;
                }
            }

        }
    }
    private void GenMasterTableData(ref PccErrMsg myLabel)
    {
        PccErrMsg myErrMsg = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Error");

        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"]);
        PccMsg myMsg = new PccMsg();
        myMsg.CreateFirstNode("ap_id", m_ap_id);
        myMsg.CreateFirstNode("fact_id", m_fact_id);
        myMsg.CreateFirstNode("Ufact_id", listfact.SelectedItem.Value.ToString());
        myMsg.CreateFirstNode("user_desc", txtuser.Text);
        if (ConfigurationManager.AppSettings[m_ap_id + "-UserMultiFact"] != null)
            myMsg.CreateFirstNode("UserMultiFact", ConfigurationManager.AppSettings[m_ap_id + "-UserMultiFact"]);
        else
            myMsg.CreateFirstNode("UserMultiFact", "Y");
        myMsg.CreateFirstNode("StartRecord", PageControl1.StartRecord.ToString());
        myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString());
        myMsg.CreateFirstNode("user_id", Session["UserID"].ToString());

        DataSet ds;

        //判斷是否要利用事業群來分設權限 20041125

        GetMenuAuth myAuth = new GetMenuAuth();
        myAuth.AspxFile = PICKUSER;

        myMsg.CreateFirstNode("order", "");

        if (ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"] != null && ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"].ToString() == "Y")
        {
            //判斷此使用者是否可以分配不同的事業群權限
            if (!myAuth.IsReportAuth())
            {
                //表示他必須區分事業群
                myMsg.CreateFirstNode("GroupFilter", "Y");
            }
            else
            {
                myMsg.CreateFirstNode("GroupFilter", "N");
            }
        }
        else
        {
            myMsg.CreateFirstNode("GroupFilter", "N");
        }

        if (ConfigurationManager.AppSettings[m_ap_id + "-FactFilter"] != null && ConfigurationManager.AppSettings[m_ap_id + "-FactFilter"].ToString() == "Y")
        {
            //表示他必須區分廠管理 20041125 注意要區別廠管理的先決條件是要區分事業群
            if (myAuth.IsSendAuth())  //表示若有Report及Send的權限則其為群管理者
            {
                myMsg.CreateFirstNode("FactFilter", "N");
            }
            else
            {
                myMsg.CreateFirstNode("FactFilter", "Y");
            }
        }
        else
        {
            myMsg.CreateFirstNode("FactFilter", "N");
        }

        ds = mybs.DoReturnDataSet("GetUserByApIDAndUserGroupIn", myMsg.GetXmlStr, "");

        /*string strSp = "";
        //判斷是否要利用事業群來分設權限
        if (ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"] != null && ConfigurationManager.AppSettings[m_ap_id + "-FactByGroup"].ToString() == "Y")
        {
            //判斷此使用者是否可以分配不同的事業群權限
            if (myAuth.IsReportAuth())
                strSp = "GetUserForAp";
            else
                strSp = "GetUserForUserGroupAndAp";
        }
        else
        {
            strSp = "GetUserForAp";
        }

        ds = mybs.DoReturnDataSet(strSp, myMsg.GetXmlStr, "");*/

        DataTable myTable = ds.Tables["User"];

        PccRow myRow;

        if (myTable.Rows.Count > 0)
        {
            int MasterCount = 1;
            string MasterStyle = "";

            //取出資料總筆數
            PageControl1.TotalSize = ds.Tables["GetUserCount"].Rows[0]["Counts"].ToString();
            PageControl1.BuildPager();
            string cVal = "";
            foreach (DataRow myMasterRow in myTable.Rows)
            {
                if (MasterCount % 2 == 0) MasterStyle = "eee000"; else MasterStyle = "fff000";
                myRow = new PccRow(MasterStyle, HorizontalAlign.Center, VerticalAlign.Middle, 0);

                //勾選值 ==
                string chk = "";
                string userid = "";

                //session("")不是Nothing 也不是 ""時則執行
                if (Session["Usertemporary"] != null && Session["Usertemporary"].ToString() != "")
                {
                    string[] chkarray = Session["Usertemporary"].ToString().Split(',');
                    userid = ((int)decimal.Parse(myMasterRow["user_id"].ToString())).ToString();
                    for (int i = 0; i < chkarray.Length; i++)
                    {
                        if (userid == chkarray[i].ToString())
                        {
                            chk = "checked";
                            cVal += userid + ",";

                        }
                    }

                }
                //編號
                myRow.AddTextCell(PageControl1.ListCount, 5);
                //管理者名稱
                myRow.AddTextCell(myMasterRow["user_desc"].ToString(), 10);
                //廠別
                myRow.AddTextCell(myMasterRow["fact_nm"].ToString(), 35);
                //事業群
                myRow.AddTextCell(myMasterRow["fgrp_nm"].ToString(), 15);
                //Email
                myRow.AddTextCell(myMasterRow["email"].ToString(), 30);
                //選取
                myRow.AddTextCell("<input type=checkbox name=user_id id=user_id" + MasterCount + " value=" + ((int)decimal.Parse(myMasterRow["user_id"].ToString())).ToString() + " " + chk + ">", 5);

                tab_user.Controls.Add(myRow.Row);
                MasterCount += 1;
            }
            Session["chkcount"] = MasterCount;
            ViewState["CurrentValue"] = "";
            if (cVal != "")
            {
                ViewState["CurrentValue"] = cVal.Substring(0, cVal.Length - 1);
            }
        }
        else
        {
            PageControl1.TotalSize = "0";
            Session["chkcount"] = 0;
            PageControl1.BuildPager();
            myRow = new PccRow("DGridTD", HorizontalAlign.Center, VerticalAlign.Middle, 5);
            myRow.AddTextCell("<b><font color='darkred'>" + myErrMsg.GetErrMsg("AdtWeb/msg0073") + "</font></b>", 100);
            tab_user.Controls.Add(myRow.Row);
        }
    }
 private void GenMasterTable(ref PccErrMsg myLabel)
 {
     if (TblDs_Fgrp.Rows.Count > 0)
         TblDs_Fgrp.Rows.Clear();
     GenMasterTableHader(ref myLabel);
     GenMasterTableData(ref myLabel);
 }