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");
    }
Пример #2
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 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 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");
        }
    }
Пример #5
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("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");
    }
Пример #6
0
    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");//選取
    }
Пример #7
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);
    }
 private void SetLabel(ref PccErrMsg myLabel)
 {
     PccMsg myMsg = new PccMsg();
     btnQuery.Text = myLabel.GetErrMsg("btnQuery");
     btnClear.Value = myLabel.GetErrMsg("btnClear");
 }
Пример #9
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 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);
    }
Пример #11
0
    private string GetWelcome(string strLayer, string strApID, ref PccErrMsg myLabel)
    {
        string strReturn = string.Empty;

        bs_Security mySecurity = new bs_Security(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
        string strCount = "0";
        PccCommonForC.PccMsg myMsg1 = new PccCommonForC.PccMsg();

        if (strApID != null && int.Parse(strApID) > 0)
        {
            //新增這個系統的前置詞
            myMsg1.CreateFirstNode("ap_id", strApID);
            myMsg1.CreateFirstNode("user_id", Session["UserID"].ToString());

            if (((Hashtable)Session["APCounts"]).ContainsKey(strApID))
            {
                strCount = ((Hashtable)Session["APCounts"])[strApID].ToString();
            }
            else
            {
                strCount = mySecurity.DoReturnStr("GetAndUpdateApCounts", myMsg1.GetXmlStr, "");
                ((Hashtable)Session["APCounts"]).Add(strApID, strCount);
            }
        }

        //060306 將原本Hard code的Menu內容改由LabelMsg_TC.xml抓取
        string strWel = myLabel.GetErrMsg("M000001", "MenuItem");
        string strCome = myLabel.GetErrMsg("M000002", "MenuItem");
        string strUpdateUser = myLabel.GetErrMsg("M000011", "MenuItem");
        string strAddSystem = myLabel.GetErrMsg("M000012", "MenuItem");
        string strTransfer = myLabel.GetErrMsg("M000013", "MenuItem");

        //strReturn += "\"歡迎" + Session["UserName"].ToString() + "光臨(" + strCount + ")\","; //第一個分區的圖形或文字
        strReturn += "\"" + strWel + Session["UserName"].ToString() + strCome + "(" + strCount + ")\","; //第一個分區的圖形或文字
        strReturn += "3,"; //第一個大項次的開始
        //第一個分區的第一個小Item參數
        //strReturn += "\"個人資料修改\","; //選單名稱
        strReturn += "\"" + strUpdateUser + "\","; //選單名稱
        strReturn += "\"" + strLayer + "images/MenuArea/DgyyWebWinNew/sFile1.gif\","; //選單的前置圖形
        strReturn += "\"" + ConfigurationManager.AppSettings["PFSBaseWeb"] + "usermanage/UpdateUser.aspx?UserID=" + Session["UserID"].ToString() + "&AcctionType=Upd&UserAccount=" + Session["UserAccount"].ToString() + "\",";//選單的連結網頁
        strReturn += "\"1\","; //型態表示開啟一個頁面在IFrame上,若為2表示呼叫一個函式。

        //第一個分區的第二個小Item參數
        //strReturn += "\"加入系統\","; //選單名稱
        strReturn += "\"" + strAddSystem + "\","; //選單名稱
        strReturn += "\"" + strLayer + "images/MenuArea/DgyyWebWinNew/sFile1.gif\","; //選單的前置圖形
        strReturn += "\"ApplyAccount.aspx?Type=Update\",";//選單的連結網頁
        strReturn += "\"1\","; //型態表示開啟一個頁面在IFrame上,若為2表示呼叫一個函式。

        //第一個分區的第三個小Item參數
        //strReturn += "\"中英文轉換\","; //選單名稱
        strReturn += "\"" + strTransfer + "\","; //選單名稱
        strReturn += "\"" + strLayer + "images/MenuArea/DgyyWebWinNew/sFile1.gif\","; //選單的前置圖形
        strReturn += "\"ChangeLanguage.aspx?ApID=0\",";//選單的連結網頁
        strReturn += "\"1\""; //型態表示開啟一個頁面在IFrame上,若為2表示呼叫一個函式。

        return strReturn;
    }
Пример #12
0
    private void SetLabel(ref PccErrMsg myLabel)
    {
        btnQuery.Text = myLabel.GetErrMsg("btnQuery");
        btnClear.Text = myLabel.GetErrMsg("btnClear");

        //lblTitle.Text = myLabel.GetErrMsg("lbl0001","ADTPurDoc/GroupManage");
        lblGroupName.Text = myLabel.GetErrMsg("lbl0002", "ADTPurDoc/GroupManage");
        lbtnAddGroup.Text = myLabel.GetErrMsg("lbl0003", "ADTPurDoc/GroupManage");
    }
Пример #13
0
    private void MasterDelFunc(string strKey, string strKeyOther)
    {
        plDelete.Visible = true;
        plMain.Visible = false;
        PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
        PccErrMsg myErrMsg = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Error");

        string[] strParameters = { "<b>" + strKeyOther + "</b>" };
        lblDelMsg.Text = myErrMsg.GetErrMsgWithParam("msg0039", strParameters);
        btnDelOK.Text = myLabel.GetErrMsg("btnOK");
        btnDelCancel.Text = myLabel.GetErrMsg("btnCancel");
        ViewState["Flag"] = "MasterDelFunc";
    }
Пример #14
0
    private void GenMasterTableHader(ref PccErrMsg myLabel)
    {
        PccRow myRow = new PccRow("cssGridHeader", HorizontalAlign.Center, VerticalAlign.Middle, 0);
        //編號
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0004", "ADTPurDoc/GroupManage"), 10);
        //群組名稱(點選群組名稱可把使用者加入此群組)
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0022", "ADTPurDoc/GroupManage"), 60);
        //檢視使用者
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0020", "ADTPurDoc/GroupManage"), 10);
        //檢視選單
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0021", "ADTPurDoc/GroupManage"), 10);
        //群組管理
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0001", "ADTPurDoc/GroupManage"), 10);

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

        tblGroup.Rows.Add(myRow.Row);
    }
Пример #15
0
    private void GenMasterTableData(ref PccErrMsg myLabel)
    {
        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();
        myMsg.CreateFirstNode("StartRecord", PageControl1.StartRecord.ToString());
        myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString());
        myMsg.CreateFirstNode("ap_id", Request.QueryString["ApID"]);
        myMsg.CreateFirstNode("group_nm", txtGroupName.Text);

        //加入判斷是否要有事業群之判斷20041116
        string strGroupFilter = "N", strFactFilter = "N";
        string strTemp = "";
        myMsg.CreateFirstNode("user_id", Session["UserID"].ToString());
        GetMenuAuth myAuth = new GetMenuAuth();

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

        if (ConfigurationManager.AppSettings[m_apid + "-FactFilter"] != null && ConfigurationManager.AppSettings[m_apid + "-FactFilter"].ToString() == "Y")
        {
            //表示他必須區分廠管理 20041118 注意要區別廠管理的先決條件是要區分事業群
            myMsg.CreateFirstNode("FactFilter", "Y");
            strFactFilter = "Y";
        }

        string strXML = myMsg.GetXmlStr;
        DataSet myGroupDs = mybs.DoReturnDataSet("GetGroupbyApID", strXML, "");

        DataTable myGroupData = myGroupDs.Tables["Group"];

        if (myGroupData.Rows.Count > 0)
        {
            int MasterCount = 0;
            string MasterStyle = "";
            PccMsg myTempMsg;

            PccRow myRow;
            //取出資料總筆數
            PageControl1.TotalSize = myGroupDs.Tables["TCounts"].Rows[0]["Counts"].ToString();
            PageControl1.BuildPager();

            //明細資料類別之共同參數
            myMsg.LoadXml();
            myMsg.CreateFirstNode("TableClass", "ActDocTB");
            myMsg.CreateFirstNode("RowHeaderClass", "TDShowHeader");
            myMsg.CreateFirstNode("RowClass1", "ffd000");
            myMsg.CreateFirstNode("RowClass2", "fff000");
            string strClassXML = myMsg.GetXmlStr;

            //使用者明細資料類別之參數
            string strOrgFields5 = "";
            if (myAuth.IsDeleteAuth())
            {
                strOrgFields5 = "btn-刪除-Return_Click(this)";
            }
            string[] Fields = { "編號", "電子郵件帳號", "使用者名稱", "廠別", strOrgFields5 };
            int[] FieldsPercent = { 5, 30, 20, 35, 10 };
            string[] FieldsItem = { "--NO--", "email", "user_desc", "fact_nm", "user_id" };
            //string[] TransFunc = {"","TransUserNm","TransUserDesc","TransFactNm",""};
            string[] FieldsType = new string[5];
            FieldsType[0] = "--NO--";
            FieldsType[1] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[2] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[3] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[4] = "<PccMsg><Type>CheckBox</Type><Value>user_id</Value></PccMsg>";

            //選單明細資料類別之參數
            string strOrgFields8 = "";
            if (myAuth.IsUpdateAuth())
            {
                strOrgFields8 = "btn-更新送出-Return_ClickM(this)"; ;
            }

            //判斷是否為超級管理者,若是則不控管自己Menu的CheckBox權限 20041119
            string strcheckbox = "";
            if (Session["UserEMail"].ToString() != ConfigurationManager.AppSettings["superAdminEmail"].ToString())
                strcheckbox = "CheckBoxByValueJudgeUserRight";
            else
                strcheckbox = "CheckBoxByValue";

            string[] MFields = { "編號", "選單名稱", "顯示權限", "新增權限", "更新權限", "刪除權限", "報表權限", "發信權限", strOrgFields8 };
            int[] MFieldsPercent = { 5, 25, 10, 10, 10, 10, 10, 10, 10 };
            string[] MFieldsItem = { "--NO--", "menu_nm", "show_mk", "add_mk", "upd_mk", "del_mk", "rpt_mk", "send_mk", "groupd_id" };
            string[] MFieldsType = new string[9];
            MFieldsType[0] = "--NO--";
            MFieldsType[1] = "<PccMsg><Type>Text</Type></PccMsg>";
            MFieldsType[2] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[3] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[4] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[5] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[6] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[7] = "<PccMsg><Type>" + strcheckbox + "</Type><Value>menu_id</Value></PccMsg>";
            MFieldsType[8] = "<PccMsg><Type>Space</Type></PccMsg>";

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

            //再利用此Table再取得其每一列的資料,再Gen出主要的Table Row.
            foreach (DataRow myMasterRow in myGroupData.Rows)
            {
                if (MasterCount % 2 == 0) MasterStyle = "cssGridRowAlternating"; else MasterStyle = "cssGridRow";
                myRow = new PccRow("", HorizontalAlign.Center, 0, 0);
                myRow.SetRowCss(MasterStyle);

                //編號
                myRow.AddTextCell(PageControl1.ListCount, 10);
                //群組名稱(點選群組名稱可把使用者加入此群組)
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", myMasterRow["group_nm"].ToString());
                myTempMsg.CreateFirstNode("LinkID", "ULink" + myMasterRow["group_id"].ToString());
                myTempMsg.CreateFirstNode("Href", USERADDCOMEON + "?ApID=" + CheckQueryString("ApID") + "&GroupID=" + myMasterRow["group_id"].ToString() + "&GroupNm=" + myMasterRow["group_nm"].ToString() + "&QueryCondition=" + GetQueryCondition());
                myTempMsg.CreateFirstNode("Text", myMasterRow["group_nm"].ToString());
                myRow.AddLinkHrefCell(myTempMsg.GetXmlStr, 60);
                //檢視使用者
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", myLabel.GetErrMsg("lbl0020", "ADTPurDoc/GroupManage"));
                myTempMsg.CreateFirstNode("LinkID", "HLinkViewU" + myMasterRow["group_id"].ToString());
                myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
                myTempMsg.CreateFirstNode("ClickFun", "doSection(view_U" + MasterCount.ToString() + ")");
                myRow.AddLinkCell(myTempMsg.GetXmlStr, 10);
                //檢視選單
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", myLabel.GetErrMsg("lbl0021", "ADTPurDoc/GroupManage"));
                myTempMsg.CreateFirstNode("LinkID", "HLinkViewM" + myMasterRow["group_id"].ToString());
                myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
                myTempMsg.CreateFirstNode("ClickFun", "doSection(view_M" + MasterCount.ToString() + ")");
                myRow.AddLinkCell(myTempMsg.GetXmlStr, 10);
                //群組管理
                myTempMsg.LoadXml();
                //加入群組管理修改及刪除的Item
                if (myAuth.IsUpdateAuth())
                {
                    myTempMsg.CreateNode("LinkButton");
                    myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/edit.gif");
                    myTempMsg.AddToNode("ToolTip", "修改群組");
                    myTempMsg.AddToNode("href", GROUPADDNEW + "?ApID=" + Request.Params["ApID"].ToString());
                    myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                    myTempMsg.AddToNode("Method", GetMethod("MasterUpdateFunc", "group_id", "group_nm", myMasterRow));
                    myTempMsg.UpdateNode();
                }
                if (myAuth.IsDeleteAuth())
                {
                    myTempMsg.CreateNode("LinkButton");
                    myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/del.gif");
                    myTempMsg.AddToNode("ToolTip", "刪除群組");
                    myTempMsg.AddToNode("href", GROUPMANAGE + "?ApID=" + Request.Params["ApID"].ToString());
                    myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                    myTempMsg.AddToNode("Method", GetMethod("MasterDelFunc", "group_id", "group_nm", myMasterRow));
                    myTempMsg.UpdateNode();
                }
                myRow.AddMultiLinkCell(myTempMsg.GetXmlStr, 10);

                tblGroup.Rows.Add(myRow.Row);

                //設定使用者明細資料類別之參數
                strTemp = "<PccMsg>";
                strTemp += "<group_id>" + myMasterRow["group_id"].ToString() + "</group_id>";
                strTemp += "<ap_id>" + m_apid + "</ap_id>";
                strTemp += "<user_id>" + Session["UserID"].ToString() + "</user_id>";
                strTemp += "<GroupFilter>" + strGroupFilter + "</GroupFilter>";
                strTemp += "<FactFilter>" + strFactFilter + "</FactFilter>";
                strTemp += "</PccMsg>";
                tblUserGroup = mybs.DoReturnDataSet("GetUserByGroupID", strTemp, "").Tables["UserGroup"];

                PccDetailTable myDTable = new PccDetailTable("UDT" + myMasterRow["group_id"].ToString());
                myDTable.ClassXML = strClassXML;
                myDTable.Fields = Fields;
                myDTable.FieldsPercent = FieldsPercent;
                myDTable.FieldsItem = FieldsItem;
                myDTable.FieldsType = FieldsType;
                myDTable.NewDataTable = tblUserGroup;

                //myDTable.TransFunc = TransFunc;
                //myDTable.objThis = this;

                myDTable.Create();

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

                tblGroup.Rows.Add(myRow.Row);

                //設定選單明細資料類別之參數
                tblMenuGroup = mybs.DoReturnDataSet("GetMenuByGroupID", "<PccMsg><group_id>" + myMasterRow["group_id"].ToString() + "</group_id></PccMsg>", "").Tables["MenuGroup"];

                PccDetailTable myMDTable = new PccDetailTable("MDT" + myMasterRow["group_id"].ToString());
                myMDTable.ClassXML = strClassXML;
                myMDTable.Fields = MFields;
                myMDTable.FieldsPercent = MFieldsPercent;
                myMDTable.FieldsItem = MFieldsItem;
                myMDTable.FieldsType = MFieldsType;
                myMDTable.NewDataTable = tblMenuGroup;

                myMDTable.Create();

                if (m_menuIDArray == null)
                {
                    m_menuIDArray = myMDTable.GetDataArray("menu_id");
                    ViewState["MenuID"] = m_menuIDArray;
                }

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

                tblGroup.Rows.Add(myRow.Row);

                MasterCount += 1;

            } // end of foreach datarow
        } // end of if table count is 0
        else
        {
            PageControl1.TotalSize = "0";
            PageControl1.BuildPager();
        }
    }
Пример #16
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");
    }
    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();
        }
    }
Пример #18
0
    private void SetLabel()
    {
        PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");
        lblFactNo.Text = myLabel.GetErrMsg("lbl0018", "QC/Tilte");// Mã xưỡng
        lblDeptNo.Text = myLabel.GetErrMsg("lbl0004", "QC/Tilte");
        lblSecNo.Text = myLabel.GetErrMsg("lbl0001", "QC/Tilte");
        lblDateTimeNow.Text = myLabel.GetErrMsg("lbl0019", "QC/Tilte");
        lblQC.Text = myLabel.GetErrMsg("lbl0020", "QC/Tilte");
        lblNVKT.Text = myLabel.GetErrMsg("lbl0021", "QC/Tilte");
        llbSLDat.Text = myLabel.GetErrMsg("lbl0022", "QC/Tilte");
        lblSLKhongDat.Text = myLabel.GetErrMsg("lbl0023", "QC/Tilte");
        lblSumRutKiem.Text = myLabel.GetErrMsg("lbl0024", "QC/Tilte");
        lblTyLeDat.Text = myLabel.GetErrMsg("lbl0025", "QC/Tilte");

        //
        sCode = myLabel.GetErrMsg("lbl0027", "QC/Tilte");
        sBadNo = myLabel.GetErrMsg("lbl0028", "QC/Tilte");
        sNumBer = myLabel.GetErrMsg("lbl0029", "QC/Tilte");
        sNumBer2 = myLabel.GetErrMsg("lbl0032", "QC/Tilte");
        sUserQC = myLabel.GetErrMsg("lbl0030", "QC/Tilte");
        sTimeNo = myLabel.GetErrMsg("lbl0031", "QC/Tilte");
    }
 private void SetLabel(ref PccErrMsg myLabel)
 {
     //LblFgrp_Nm.Text = myLabel.GetErrMsg("lbl0002","SysManager/ApManager");
     BtnQuery.Text = myLabel.GetErrMsg("btnQuery");
 }
Пример #20
0
    private void SaveApplyRating(string qtyOKitem, string TypeQC)
    {
        if (hOdrNo.Value != "")
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");
            int item = int.Parse(qtyOKitem);
            string AcRat_id = "0";
            string fact_no = lblFactNo1.Text.ToString().Trim();
            string dept_no = ddlDepNo.SelectedValue.Trim();
            string sec_no = ddlSec_no.SelectedValue.Trim();
            string type_check = Request.QueryString["TypeCheck"].ToString();
            string vou_no = hOdrNo.Value;

            //kiểm tra time_no dứơi ERP
            string time_sec = DateTime.Now.ToString("hhmm");
            string time_no = "";
            DataTable dtTime_no = mybs.get_time_no(fact_no, dept_no, time_sec);
            if (dtTime_no.Rows.Count > 0)
                time_no = dtTime_no.Rows[0]["time_no"].ToString().Trim();
            else
            {
                Response.Write("<script>alert('" + sTimeNo + "');</script>");
                return;
            }

            // lây total dưới SQL
            string total = qtyOKitem;// lblSumRutKiem1.Text;// dtTotal.Rows[0]["SumTotal"].ToString().Trim();

            //lấy floor
            DataTable dtFloor = mybs.get_floor_erp(fact_no, dept_no, sec_no);
            string floor = "";
            if (dtFloor.Rows.Count > 0)
                floor = dtFloor.Rows[0]["floor"].ToString().Trim();

            //lấy build_no
            DataTable dtBuild = mybs.get_build_no_erp(fact_no, dept_no, sec_no, floor);
            string build_no = "";
            if (dtBuild.Rows.Count > 0)
                build_no = dtBuild.Rows[0]["build_no"].ToString().Trim();

            string userQC_id = ddlQC.SelectedValue.Trim();
            string upd_id = Session["UserID"].ToString().Trim();
            string myType = "0";
            string ok = SaveApplyRating(AcRat_id, fact_no, dept_no, sec_no, vou_no, total, floor, build_no, userQC_id, upd_id, myType);

            PccMsg myMsg = new PccMsg();
            myMsg.LoadXml(ok);
            string AcRat_id_e = myMsg.Query("AcRat_id");
            string Err = myMsg.Query("Err");
            string Mes = myLabel.GetErrMsg("lbl0026", "QC/Tilte");
            if (Err == "Success!")
            {
                string bad_no = hBadNo.Value;
                string bad_desc = hBad_cn.Value;
                string bad_descVN = hBad_vn.Value;

                string qty = "0";
                string qty_OKitem = "0";
                if (TypeQC == "0")
                    qty_OKitem = qtyOKitem;
                else
                    qty = qtyOKitem;

                // câp nhật xuống table RatingD
                string ok2 = "";
                if (TypeQC == "0")
                    ok2 = SaveApplyRatingDetail("", AcRat_id_e, "", "", "",  qty, qty_OKitem,upd_id, "0");
                else
                    ok2 = SaveApplyRatingDetail("", AcRat_id_e, bad_no, bad_desc, bad_descVN,qty, "",upd_id, "0");

                //if (ok2 == "Success!")
                    //Response.Write("<script>alert('"+Mes+"');</script>");
                if (ok2 != "Success!")
                {
                    Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                    return;
                }

                ltrBadReason.Text = GetBadReson();
                GetSumQtyToal();
            }
            else
            {
                Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                return;
            }
        }
    }
    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);
        }
    }
Пример #22
0
    private void SaveData(string qty)
    {
        if (hOdrNo.Value != "" )
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");

            string ac_id = "0";
            string fact_no = lblFactNo1.Text.ToString().Trim();
            string dept_no = ddlDepNo.SelectedValue.Trim();
            string sec_no = ddlSec_no.SelectedValue.Trim();
            string type_check = Request.QueryString["TypeCheck"].ToString();
            string vou_no = hOdrNo.Value;

            //kiểm tra time_no dứơi ERP
            string time_sec = DateTime.Now.ToString("hhmm");
            string time_no="";
            DataTable dtTime_no = mybs.get_time_no(fact_no, dept_no, time_sec);
            if (dtTime_no.Rows.Count > 0)
                time_no = dtTime_no.Rows[0]["time_no"].ToString().Trim();
            else
            {
                Response.Write("<script>alert('" + sTimeNo + "');</script>");
                return;
            }

            // lây total dưới ERP
            DataTable dtTotal = mybs.get_sum_act_qty(fact_no, dept_no, sec_no, vou_no);
            string total_act_qty = dtTotal.Rows[0]["SumTotal"].ToString().Trim();

            //lấy floor
            DataTable dtFloor = mybs.get_floor_erp(fact_no, dept_no, sec_no);
            string floor = "";
            if (dtFloor.Rows.Count > 0)
                floor = dtFloor.Rows[0]["floor"].ToString().Trim();

            //lấy build_no
            DataTable dtBuild = mybs.get_build_no_erp(fact_no, dept_no, sec_no, floor);
            string build_no = "";
            if (dtBuild.Rows.Count > 0)
                build_no = dtBuild.Rows[0]["build_no"].ToString().Trim();

            string myType = "0";
            string ok = SaveApplyCheckData(ac_id, fact_no, dept_no, sec_no, type_check, vou_no, total_act_qty, floor, build_no, myType);

            PccMsg myMsg = new PccMsg();
            myMsg.LoadXml(ok);
            string ac_id_e = myMsg.Query("ac_id");
            string Err = myMsg.Query("Err");
            string Mes = myLabel.GetErrMsg("lbl0026", "QC/Tilte"); //"cập nhật thành công !";// myLabelEr.GetErrMsg("msg0004");
            if (Err == "Success!")
            {
                string bad_no = hBadNo.Value;
                string bad_desc = hBad_cn.Value;
                string bad_descVN = hBad_vn.Value;
                string userQC_id = Session["UserID"].ToString().Trim();

                string qtyOKitem = "0";
                // câp nhật xuống table ApplyCheckD
                string ok2 = SaveCheckDetail("", ac_id_e, bad_no, bad_desc, bad_descVN, userQC_id, qty, qtyOKitem, "0");
                if (ok2 == "Success!")
                {

                    string rec_date = DateTime.Now.ToString("yyyyMMdd");
                    string kind_mk = "1";
                    string TypeErp = "0";
                    //câp nhật xuống ERP
                    string upd_user = Session["UserEMail"].ToString().Trim();
                    string upd_time=DateTime.Now.ToString("yyyyMMddhhmmss");

                    /*
                    //SL không đạt
                    DataTable dtQty = SumQtyToal(type_check, vou_no, fact_no, dept_no, sec_no, bad_no, rec_date, "4");
                    string qtyErp=dtQty.Rows[0]["SumQty"].ToString().Trim();
                   */

                    //get sum qty
                    string cur_time=DateTime.Now.ToString("hhmm");
                    DataTable dtQtyERP = mybs.sum_qty_erp(vou_no, fact_no, sec_no, kind_mk, time_no, rec_date, upd_user, dept_no);

                    //kiểm tra dử liệu dưới ERP? 0 : insert 1: update
                    DataTable dtTest = mybs.testCountBadNoErp(vou_no, fact_no, rec_date, sec_no, bad_no, kind_mk, upd_user, dept_no, time_no);
                    if (dtTest.Rows[0]["kt"].ToString()!="0")
                        TypeErp = "1";

                    string qtyErpN = "0";// dtQtyERP.Rows[0]["SumQty"].ToString().Trim();
                    int kq=0;
                    if(dtQtyERP.Rows.Count>0)
                        qtyErpN = dtQtyERP.Rows[0]["SumQty_chk"].ToString().Trim();
                    kq = int.Parse(total_act_qty) - int.Parse(qtyErpN);
                    string qty_chk =  kq.ToString();

                    string qtyErp = qty;

                    string ok3=mybs.SaveDataErp(fact_no, rec_date, vou_no, sec_no, bad_no, time_no, type_check, upd_user, upd_time, qtyErp, qty_chk,dept_no, TypeErp);
                    //if(ok3=="OK")
                        //Response.Write("<script>alert('"+Mes+"');</script>");
                    if (ok3 != "OK")
                    {
                        Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                        return;
                    }

                }
                else
                {
                    Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                    return;
                }
                ltrBadReason.Text = GetBadReson();
                GetSumQtyToal();

            }
            else
            {
                Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                return;
            }
        }
    }
Пример #23
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);
    }
Пример #24
0
    private void SaveDataQC(string qtyOKitem,string TypeQC)
    {
        if (hOdrNo.Value != "")
        {
            PccErrMsg myLabel = new PccErrMsg(Server.MapPath("~") + "/XmlDoc", Session["CodePage"].ToString(), "Label");
            int item = int.Parse(qtyOKitem);
            string ac_id = "0";
            string fact_no = lblFactNo1.Text.ToString().Trim();
            string dept_no = ddlDepNo.SelectedValue.Trim();
            string sec_no = ddlSec_no.SelectedValue.Trim();
            string type_check = Request.QueryString["TypeCheck"].ToString();
            string vou_no = hOdrNo.Value;

            //kiểm tra time_no dứơi ERP
            string time_sec = DateTime.Now.ToString("hhmm");
            string time_no = "";
            DataTable dtTime_no = mybs.get_time_no(fact_no, dept_no, time_sec);
            if (dtTime_no.Rows.Count > 0)
                time_no = dtTime_no.Rows[0]["time_no"].ToString().Trim();
            else
            {
                Response.Write("<script>alert('" + sTimeNo + "');</script>");
                return;
            }

            // lây total dưới SQL
            //DataTable dtTotal = mybs.get_sum_act_qty(fact_no, dept_no, sec_no, vou_no);
            string total = lblSumRutKiem1.Text;// dtTotal.Rows[0]["SumTotal"].ToString().Trim();

            //lấy floor
            DataTable dtFloor = mybs.get_floor_erp(fact_no, dept_no, sec_no);
            string floor = "";
            if (dtFloor.Rows.Count > 0)
                floor = dtFloor.Rows[0]["floor"].ToString().Trim();

            //lấy build_no
            DataTable dtBuild = mybs.get_build_no_erp(fact_no, dept_no, sec_no, floor);
            string build_no = "";
            if (dtBuild.Rows.Count > 0)
                build_no = dtBuild.Rows[0]["build_no"].ToString().Trim();

            string myType = "0";
            string ok = SaveApplyCheckDataQC(ac_id, fact_no, dept_no, sec_no, type_check, vou_no, total, floor, build_no, myType);

            PccMsg myMsg = new PccMsg();
            myMsg.LoadXml(ok);
            string ac_id_e = myMsg.Query("ac_id");
            string Err = myMsg.Query("Err");
            string Mes = myLabel.GetErrMsg("lbl0026", "QC/Tilte");
            if (Err == "Success!")
            {
                string bad_no = hBadNo.Value;
                string bad_desc = hBad_cn.Value;
                string bad_descVN = hBad_vn.Value;
                string userQC_id = Session["UserID"].ToString().Trim();

                string qty = "0";
                string qty_OKitem = "0";
                if (TypeQC == "0")
                    qty_OKitem = qtyOKitem;
                else
                    qty = qtyOKitem;

                // câp nhật xuống table ApplyCheckD
                string ok2 = "";
                if (TypeQC == "0")
                    ok2 = SaveCheckDetail("", ac_id_e, "", "", "", userQC_id, qty, qty_OKitem, "0");
                else
                    ok2 = SaveCheckDetail("", ac_id_e, bad_no, bad_desc, bad_descVN, userQC_id, qty, "", "0");

                if (ok2 == "Success!")
                {
                    if (TypeQC == "0")
                    {
                        bad_no = "     ";
                        bad_desc = "";
                        bad_descVN = "";
                    }

                    //kiểm tra dử liệu dưới ERP? 0 : insert 1: update
                    string rec_date = DateTime.Now.ToString("yyyyMMdd");
                    string upd_user = Session["UserEMail"].ToString().Trim();
                    string upd_time = DateTime.Now.ToString("yyyyMMddhhmmss");
                    // trường hơp TypeQC == "0" SL đạt -- kiểm tra (fact_no,rec_date,fact_odr_no,sec_no)
                    string kind_mk = "2";
                    string TypeErp = "0";

                    DataTable dtTest = mybs.testCountVouNOErp(vou_no, fact_no, rec_date, bad_no, sec_no, kind_mk);
                    if (dtTest.Rows.Count > 0)
                        TypeErp = "1";

                    //get sum qty dua vao bad_no
                    DataTable dtSumQtyByBadBo = mybs.sum_qty_02ByBad_no(vou_no, fact_no, rec_date, sec_no, bad_no, kind_mk);
                    int sum_qty_bad_no = int.Parse(dtSumQtyByBadBo.Rows[0]["SumQtyChk"].ToString());
                    sum_qty_bad_no = sum_qty_bad_no + item;
                    string qtyErp = Convert.ToString(sum_qty_bad_no);

                    //get sum qty => qty_chk
                    DataTable dtQtyCheck = mybs.sum_qty_02(vou_no, fact_no, rec_date, sec_no, kind_mk);
                    int sum_qty = int.Parse(dtQtyCheck.Rows[0]["SumQtyChk"].ToString());

                    string qty_chk = Convert.ToString(sum_qty + item); //dtQtyCheck.Rows[0]["SumQtyChk"].ToString().Trim();
                    /*
                     string qtyErp = qtyOKitem;
                     string qty_chk = qtyOKitem;
                     */
                    //câp nhật xuống ERP
                    string ok3 = mybs.SaveDataErpQC02(fact_no, rec_date, vou_no, sec_no, bad_no, time_no, type_check, upd_user, upd_time, qtyErp, qty_chk, dept_no, TypeErp);
                    //if (ok3 == "OK")
                        //Response.Write("<script>alert('" + Mes + "');</script>");
                    if (ok3 != "OK")
                    {
                        Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                        return;
                    }
                }
                else
                {
                    Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                    return;
                }
                ltrBadReason.Text = GetBadReson();
                GetSumQtyToal();

            }
            else
            {
                Response.Write("<script>alert('Error, Please contact administrator !');</script>");
                return;
            }
        }
    }
Пример #25
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");
 }
Пример #26
0
    private void GenMasterTableData(ref PccErrMsg myLabel)
    {
        //取得Login的使用者是否有刪除的權限
        GetMenuAuth myAuth = new GetMenuAuth();
        bool del_auth = myAuth.IsDeleteAuth();

        PccBsSystemForC.bs_ApManager mybs = new PccBsSystemForC.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("StartRecord", PageControl1.StartRecord.ToString());
        myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString());
        myMsg.CreateFirstNode("Vpath", ConfigurationManager.AppSettings["vpath"].ToString());
        myMsg.CreateFirstNode("ApName", txtApName.Text);
        string strXML = myMsg.GetXmlStr;
        DataSet myApDs = mybs.DoReturnDataSet("GetApByVpath", strXML, "");

        DataTable myApData = myApDs.Tables["Ap"];

        if (myApData.Rows.Count > 0)
        {
            int MasterCount = 0;
            string MasterStyle = "";
            PccMsg myTempMsg;

            PccRow myRow;

            //取出資料總筆數
            PageControl1.TotalSize = myApDs.Tables["TCounts"].Rows[0]["Counts"].ToString();
            PageControl1.BuildPager();

            //明細資料類別之共同參數
            myMsg.LoadXml();
            myMsg.CreateFirstNode("TableClass", "ActDocTB");
            myMsg.CreateFirstNode("RowHeaderClass", "TDShowHeader");
            myMsg.CreateFirstNode("RowClass1", "ffd000");
            myMsg.CreateFirstNode("RowClass2", "fff000");
            string strClassXML = myMsg.GetXmlStr;

            XmlElement myNode;

            //明細資料的欄位參數
            string strOrgFields5 = "link-新增選單-" + MENUADDNEW + "?ApID=" + Request.Params["ApID"].ToString() + "&Type=New&QueryCondition=" + GetQueryCondition();
            string[] Fields = { "編號", "選單編碼", "選單名稱", "選單連結", "管理區", strOrgFields5 };
            int[] FieldsPercent = { 5, 8, 17, 50, 10, 10 };
            string[] FieldsItem = { "--NO--", "menu_no", "menu_nm", "menu_link", "manage_mk", "menu_id" };
            string[] FieldsType = new string[6];
            FieldsType[0] = "--NO--";
            FieldsType[1] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[2] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[3] = "<PccMsg><Type>Text</Type></PccMsg>";
            FieldsType[4] = "<PccMsg><Type>Text</Type></PccMsg>";

            //設定明細欄位中多個Link Image的參數
            myMsg.LoadXml();
            myMsg.CreateFirstNode("Type", "MultiLink");

            //設定第一個更新選單的Image參數
            myMsg.CreateNode("LinkButton");
            myMsg.AddToNode("Image", Session["PageLayer"] + "images/edit.gif");
            myMsg.AddToNode("ToolTip", "更新選單");
            myMsg.AddToNode("href", MENUADDNEW + "?ApID=" + Request.Params["ApID"].ToString());
            myMsg.AddToNode("QueryCondition", GetQueryCondition());
            myNode = myMsg.CreateParentNode("Method");
            myMsg.AddToNode("MethodName", "DetailUpdFunc", ref myNode);
            myMsg.AddToNode("Key", "menu_id", ref myNode);
            myMsg.AddToNode("KeyOther", "menu_nm", ref myNode);
            myMsg.UpdateNode(myNode);
            myMsg.UpdateNode();

            if (del_auth)
            {
                //設定第二個刪除選單的Image參數
                myMsg.CreateNode("LinkButton");
                myMsg.AddToNode("Image", Session["PageLayer"] + "images/del.gif");
                myMsg.AddToNode("ToolTip", "刪除選單");
                myMsg.AddToNode("href", APMANAGE + "?ApID=" + Request.Params["ApID"].ToString());
                myMsg.AddToNode("QueryCondition", GetQueryCondition());
                myNode = myMsg.CreateParentNode("Method");
                myMsg.AddToNode("MethodName", "DetailDelFunc", ref myNode);
                myMsg.AddToNode("Key", "menu_id", ref myNode);
                myMsg.AddToNode("KeyOther", "menu_nm", ref myNode);
                myMsg.UpdateNode(myNode);
                myMsg.UpdateNode();
            }

            FieldsType[5] = myMsg.GetXmlStr;

            //要取得明細資料的Table變數
            DataTable tblMenuByApID;

            //再利用此Table再取得其每一列的資料,再Gen出主要的Table Row.
            foreach (DataRow myMasterRow in myApData.Rows)
            {
                if (MasterCount % 2 == 0) MasterStyle = "eee000"; else MasterStyle = "fff000";
                myRow = new PccRow();
                myRow.SetRowCss(MasterStyle);
                //編號
                myRow.AddTextCell(PageControl1.ListCount, 5);
                //應用程式編碼
                myRow.AddTextCell(myMasterRow["ap_id"].ToString(), 10);
                //應用程式名稱
                myRow.AddTextCell(myMasterRow["ap_name"].ToString(), 15);
                //應用程式連結
                myRow.AddTextCell(myMasterRow["ap_link"].ToString(), 40);
                //應用程式目錄
                myRow.AddTextCell(myMasterRow["ap_vpath"].ToString(), 15);
                //檢視
                myTempMsg = new PccMsg();
                myTempMsg.CreateFirstNode("ToolTip", myLabel.GetErrMsg("lbl0018", "SysManager/ApManager"));
                myTempMsg.CreateFirstNode("LinkID", "HLinkView" + myMasterRow["ap_id"].ToString());
                myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
                myTempMsg.CreateFirstNode("ClickFun", "doSection(view_" + MasterCount.ToString() + ")");
                myRow.AddLinkCell(myTempMsg.GetXmlStr, 5);
                //管理
                myTempMsg.LoadXml();
                //先加入修改的Item
                myTempMsg.CreateNode("LinkButton");
                myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/edit.gif");
                myTempMsg.AddToNode("ToolTip", myLabel.GetErrMsg("lbl0014", "SysManager/ApManager"));
                myTempMsg.AddToNode("href", APADDNEW + "?ApID=" + Request.Params["ApID"].ToString());
                myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                myTempMsg.AddToNode("Method", GetMethod("MasterUpdateFunc", "ap_id", "ap_name", 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", APMANAGE + "?ApID=" + Request.Params["ApID"].ToString());
                    myTempMsg.AddToNode("QueryCondition", GetQueryCondition());
                    myTempMsg.AddToNode("Method", GetMethod("MasterDelFunc", "ap_id", "ap_name", myMasterRow));
                    myTempMsg.UpdateNode();
                }
                myRow.AddMultiLinkCell(myTempMsg.GetXmlStr, 5);

                tblAp.Rows.Add(myRow.Row);

                tblMenuByApID = mybs.DoReturnDataSet("GetMenuByApID", "<PccMsg><ap_id>" + myMasterRow["ap_id"].ToString() + "</ap_id></PccMsg>", "").Tables["Menu"];

                //設定選單明細資料類別之參數
                PccDetailTable myDTable = new PccDetailTable("DT" + myMasterRow["ap_id"].ToString());
                myDTable.ClassXML = strClassXML;
                Fields[5] = strOrgFields5 + "&Key=" + myMasterRow["ap_id"].ToString();
                myDTable.Fields = Fields;
                myDTable.FieldsPercent = FieldsPercent;
                myDTable.FieldsItem = FieldsItem;
                myDTable.FieldsType = FieldsType;
                myDTable.NewDataTable = tblMenuByApID;

                myDTable.Create();

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

                tblAp.Rows.Add(myRow.Row);

                MasterCount += 1;

            } // end of foreach datarow
        } // end of if table count is 0
        else
        {
            PageControl1.TotalSize = "0";
            PageControl1.BuildPager();
        }
    }
Пример #27
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;

            }
    }
Пример #28
0
    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(myLabel.GetErrMsg("lbl0008", "SysManager/ApManager"), 10);
        //應用程式名稱
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0009", "SysManager/ApManager"), 15);
        //應用程式連結
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0010", "SysManager/ApManager"), 40);
        //應用程式目錄
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0012", "SysManager/ApManager"), 15);
        //檢視
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0017", "SysManager/ApManager"), 5);
        //管理
        myRow.AddTextCell(myLabel.GetErrMsg("lbl0013", "SysManager/ApManager"), 5);

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

        tblAp.Rows.Add(myRow.Row);
    }
Пример #29
0
    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();
    }
Пример #30
0
 private void MasterDelFunc(string strKey, string strKeyOther, ref PccErrMsg myLabel)
 {
     //設定抬頭 20040607
     /*for(int i = 0 ; i < Header1.Controls.Count ; i++)
     {
         if (Header1.Controls[i].ID == "PccTitle")
         {
             Label mylblTitle = (Label)(Header1.Controls[i]);
             mylblTitle.Text = "刪除應用程式";
         }
     }*/
     PccErrMsg myErrMsg = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Error");
     plDelete.Visible = true;
     plMain.Visible = false;
     string[] strParameters = { "<b>" + strKeyOther + "</b>" };
     lblDelMsg.Text = myErrMsg.GetErrMsgWithParam("msg0044", strParameters);
     btnDelOK.Text = myLabel.GetErrMsg("btnOK");
     btnDelCancel.Text = myLabel.GetErrMsg("btnCancel");
     ViewState["Flag"] = "MasterDelFunc";
 }