Exemple #1
0
        protected void PanelNode_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            string nodeCode = e.Parameter;

            if (nodeCode != "6; *")
            {
                PubCs     pc = new PubCs();
                ArrayList al = pc.SplitBySeparator(nodeCode, ";");
                ht.Columns.Add();
                ht.Columns.Add();
                DataRow dr = ht.NewRow();
                dr[0] = al[1].ToString();
                dr[1] = al[0].ToString();
                ht.Rows.Add(dr);
            }
            else
            {
                DataRow dr = ht.NewRow();
                dr[0] = "*";
                dr[1] = "*";
                ht.Rows.Add(dr);
            }

            createTable();
            //ASPxTextBox newNode = createNode(al[1].ToString(),al[0].ToString());
            //PanelNode.Controls.Add(newNode);

            //ASPxImage newLine = new ASPxImage();
            //newLine.ImageUrl = "~/lineH.png";
            //PanelNode.Controls.Add(newLine);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //数据库读取装机提示图片路径
            userManager theUserManager = (userManager)Session["theUserManager"];
            string      companyCode    = theUserManager.getCompanyCode();

            theUserCode = theUserManager.getUserCode();
            theUserId   = theUserManager.getUserId();

            if (!IsPostBack)
            {
                string sql = "select INTERNAL_VALUE FROM CODE_INTERNAL WHERE COMPANY_CODE='" + companyCode
                             + "' AND INTERNAL_TYPE_CODE='PATH' AND INTERNAL_CODE='QUALITYALERTPATH'";
                Session["path"] = dc.GetValue(sql);

                //编辑,带出值
                if (Request["opFlag"].ToString() == "edit")
                {
                    string rmesId = Request["rmesId"].ToString();
                    sql = "select * from DATA_QUALITY_ALERT where rmes_id='" + rmesId + "'";
                    DataTable dt = dc.GetTable(sql);
                    cmbPlineType.Value     = dt.Rows[0]["pline_code"].ToString();
                    cmbRoutingRemark.Value = dt.Rows[0]["rounting_remark"].ToString();
                    cmbSO.Value            = dt.Rows[0]["plan_so"].ToString();
                    cmbComponet.Value      = dt.Rows[0]["component_code"].ToString();
                    cmbProcessCode.Value   = dt.Rows[0]["process_code"].ToString();

                    if (dt.Rows[0]["from_date"].ToString() != "")
                    {
                        DateFrom.Date = Convert.ToDateTime(dt.Rows[0]["from_date"].ToString());
                    }
                    if (dt.Rows[0]["to_date"].ToString() != "")
                    {
                        DateTo.Date = Convert.ToDateTime(dt.Rows[0]["to_date"].ToString());
                    }

                    txtQualityAlert.Text = dt.Rows[0]["quality_alert"].ToString();
                    cmbColor.Text        = dt.Rows[0]["quality_alert_color"].ToString();
                    cmbFont.Value        = dt.Rows[0]["quality_alert_font"].ToString();
                    cmbType.Value        = dt.Rows[0]["alert_type"].ToString();

                    if (dt.Rows[0]["quality_alert_color"].ToString() != "")
                    {
                        txtQualityAlert.ForeColor = Color.FromName(dt.Rows[0]["quality_alert_color"].ToString());
                    }
                    if (dt.Rows[0]["quality_alert_font"].ToString() != "")
                    {
                        txtQualityAlert.Font.Size = FontUnit.Point(Convert.ToInt32(dt.Rows[0]["quality_alert_font"].ToString()));
                    }

                    string pics = dt.Rows[0]["alert_pic"].ToString();
                    PubCs  pc   = new PubCs();
                    la = pc.SplitBySeparator(pics, "$");
                    for (int i = 0; i < la.Count; i++)
                    {
                        if (la[i].ToString() != "")
                        {
                            ListFiles.Items.Add(la[i].ToString());
                        }
                    }
                    cmbType.ClientEnabled          = false;
                    cmbPlineType.ClientEnabled     = false;
                    cmbRoutingRemark.ClientEnabled = false;
                    cmbSO.ClientEnabled            = false;
                    cmbComponet.ClientEnabled      = false;
                    cmbProcessCode.ClientEnabled   = false;

                    btnConfirm.Visible = false;
                }
                if (Request["opFlag"].ToString() == "add")
                {
                    btnConfirmEdit.Visible = false;
                }

                ListFiles.ClientSideEvents.ItemDoubleClick = "function(s,e) {var index = ListFiles.GetSelectedIndex();if(index!=-1) ListFiles.RemoveItem(index);}";
            }
        }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PubCs  thePubCs      = new PubCs();
        string theServerPath = Server.MapPath("~/").ToString();

        theServerPath = theServerPath + "Rmes/Pub/Xml/RmesConfig.xml";
        baseURI       = thePubCs.ReadFromXml(theServerPath, "rootPath");


        userManager theUserManager = (userManager)Session["theUserManager"];

        theDisplayProgramName = theUserManager.getProgName();
        theDisplayPlineName   = theUserManager.getPlineName();
        theDisplayUserName    = theUserManager.getUserName();
        theDisplayCompanyCode = theUserManager.getCompanyCode();
        theDisplayProgramCode = theUserManager.getProgCode();

        string theMenuCompanyCode = theUserManager.getCompanyCode();
        string theMenuUserCode    = theUserManager.getUserCode();
        string theMenuUserId      = theUserManager.getUserId();

        string opt    = Request["opt"] as string;
        string progid = Request["progCode"] as string;

        if (opt != null && progid != null && opt != string.Empty && progid != string.Empty)
        {
            if (opt == "setdefaultpage")
            {
                try
                {
                    dataConn dc      = new dataConn();
                    string   _theSql = "SELECT * FROM REL_USER_DEFAULTPAGE WHERE COMPANY_CODE = '" + theDisplayCompanyCode + "' AND USER_ID = '" + theMenuUserId + "'";
                    dc.setTheSql(_theSql);
                    if (dc.GetState())
                    {
                        _theSql = "UPDATE REL_USER_DEFAULTPAGE SET DEFAULT_PAGE = '" + progid + "' WHERE  COMPANY_CODE = '" + theDisplayCompanyCode + "' AND USER_ID = '" + theMenuUserId + "'";
                    }
                    else
                    {
                        _theSql = "INSERT INTO REL_USER_DEFAULTPAGE(COMPANY_CODE,USER_ID,DEFAULT_PAGE)VALUES('" + theDisplayCompanyCode + "','" + theMenuUserId + "','" + progid + "')";
                    }
                    dc.ExeSql(_theSql);
                    Response.Write("设置成功:" + progid);
                }
                catch (Exception ex)
                {
                    Response.Write("设置失败,信息如下:\n" + ex.Message);
                }
                Response.End();
            }
        }

        //得到菜单绝对地址
        string theHost    = Request.ServerVariables["REMOTE_ADDR"];
        string thePort    = Request.ServerVariables["SERVER_PORT"];
        string theUrl     = Request.ServerVariables["URL"];
        string theUrlTemp = theUrl.Substring(0, theUrl.IndexOf("/", 1));

        string str = "欢迎使用RMES系统," + theDisplayPlineName + " 的 " + theDisplayUserName + ",你当前打开的页面:" + theDisplayProgramName;

        ASPxRoundPanel1.HeaderText = str;

        //帮助 20080408

        theHelpFile = theUrlTemp + "/Rmes/Help/" + theDisplayProgramCode + ".htm";


        //考虑以后可能对程序内容做一些处理,暂且定义变量
        //string theProgTemp = "";

        string   theSql      = "select menu_code,menu_name,menu_code_father,menu_index,program_code,program_name,program_value from vw_rel_user_menu where company_code='" + theMenuCompanyCode + "' and user_id='" + theMenuUserId + "' order by menu_level,menu_index";
        dataConn theDataConn = new dataConn(theSql);
        //theDataConn.OpenConn();
        //theDataConn.theComd.CommandType = CommandType.Text;
        //theDataConn.theComd.CommandText = theSql;
        //OracleDataReader dr = theDataConn.theComd.ExecuteReader();

        DataTable dt = theDataConn.GetTable(theSql);
        DataView  dv = new DataView(dt);

        dv.RowFilter = "menu_code_father is NULL and menu_code is not NUll and menu_name is not NULL";
        dv.Sort      = "menu_index";

        string name = "", text = "", url = "";

        foreach (DataRowView dvr in dv)
        {
            name = dvr["menu_code"].ToString();
            text = dvr["menu_name"].ToString();
            url  = dvr["program_value"].ToString().Trim();
            url  = url.Equals("") ? "" : ("../.." + url + "?progCode=" + dvr["program_code"].ToString() + "&progName=" + dvr["program_name"]);
            if (!text.Trim().Equals(""))
            {
                DevExpress.Web.ASPxMenu.MenuItem m = new DevExpress.Web.ASPxMenu.MenuItem(text, name, "", url);
                ASPxMenu1.Items.Add(m);
                AddChildMenu(dt, m);
            }
        }
        if (ASPxMenu1.Items.Count > 0)
        {
            //modeify by thl 20161011 用户不需要 注释了
            ASPxMenu1.Target = "ifmain";
            ASPxMenu1.Items.Add("附加功能", "ext_menu", "", "");
            DevExpress.Web.ASPxMenu.MenuItem m = ASPxMenu1.Items.FindByName("ext_menu");
            m.Items.Add("设置为默认页", "ext_set_homepage", "", "javascript:$.setDefaultPage(window.ifmain.location.href)", "_self");
            //m.Items.Add("选择主题", "ext_set_theme", "", "");
            DevExpress.Web.ASPxMenu.MenuItem n = ASPxMenu1.Items.FindByName("ext_set_theme");


            string path = Server.MapPath("~/App_Themes");

            //string[] themes = System.IO.Directory.GetDirectories(path);

            //string sTemp = "";
            //foreach (string s in themes)
            //{
            //    sTemp = s.Substring(s.LastIndexOf("\\") + 1);
            //    if (!sTemp.StartsWith("."))
            //        n.Items.Add(sTemp, sTemp, "", "javascript:jQuery.setTheme('" + sTemp + "')", "_self");
            //}
        }
    }
Exemple #4
0
    public void RaiseCallbackEvent(string eventArg)
    {
        //在这里调用登录处理事件
        //处理登录
        string  thePlineCode   = "";
        string  theUserCode    = "";
        string  thePassword    = "";
        string  theLoginStatus = "";
        Boolean theLoginFlag   = false;
        string  theSessionCode = "";
        string  theCompanyCode = "";

        string thePlineName = "";  //20071219 增加生产线名称
        string theUserName  = "";
        string theUserId    = "";
        string theClientIp  = Request.UserHostAddress;



        PubCs thePubCs = new PubCs();
        //测试读取xml
        string theServerPath1 = Server.MapPath("~/").ToString();

        theServerPath1 = theServerPath1 + "Rmes/Pub/Xml/RmesConfig.xml";
        string theRet = thePubCs.ReadFromXml(theServerPath1, "SeparatorStr");

        ArrayList theArrayList = thePubCs.SplitBySeparator(eventArg, theRet);

        string[] theString = thePubCs.ArrayListToString(theArrayList);

        theCompanyCode = theString[0];
        theUserCode    = theString[1].ToUpper();
        thePassword    = theString[2];
        thePlineName   = theString[3];

        //用户代码和用户ID的转换 20110722

        dataConn theDataConn002 = new dataConn();

        theDataConn002.OpenConn();
        theDataConn002.setTheSql("select func_get_user('" + theCompanyCode + "','MES','" + theUserCode + "','A') from dual");
        theUserId = theDataConn002.GetValue();

        theDataConn002.CloseConn();


        //得到当前会话和公司号
        userManager theUserManager1 = (userManager)Session["theUserManager"];

        if (theUserManager1 != null)
        {
            theSessionCode = theUserManager1.theSessionCode;
            //theCompanyCode = theUserManager1.getCompanyCode();
        }
        else
        {
            //theCompanyCode = (string)Session["theCompanyCode"];
        }


        loginManager theLoginManager = new loginManager();

        theLoginManager.setCompanyCode(theCompanyCode);
        theLoginFlag = theLoginManager.ReLoginIn(theUserId, thePubCs.AESEncrypt(thePassword), theClientIp, theSessionCode, thePlineCode);


        //得到用户名称
        theUserName = theLoginManager.getUserName();
        theUserCode = theLoginManager.getUserCode();

        if (theLoginFlag)
        {
            TxtEmployeeCode.Text = "ok";
            TxtPassword.Text     = theLoginManager.theLoginFlag;
        }
        else
        {
            TxtEmployeeCode.Text = "error";
            TxtPassword.Text     = theLoginManager.theLoginFlag;
        }

        theLoginStatus = theLoginManager.theLoginFlag;
        theSessionCode = theLoginManager.theSessionCode;
        theCompanyCode = theLoginManager.getTheCompanyCode();

        //处理不同情况
        switch (theLoginStatus)
        {
        case "0":
            //登录成功
            //处理登录用户信息

            userManager theUserManager = new userManager(theSessionCode);
            theUserManager.setLoginFlag(theLoginFlag);
            theUserManager.setPlineCode(thePlineCode);
            theUserManager.setPlineName(thePlineName);

            theUserManager.setProgValue("/Rmes/Login/RmesIndex.aspx");
            theUserManager.setProgCode("rmesIndex");
            theUserManager.setProgName("系统登录");
            theUserManager.setUserId(theUserId);
            theUserManager.setUserCode(theUserCode);
            theUserManager.setUserName(theUserName);
            theUserManager.setCompanyCode(theCompanyCode);

            Session["theUserManager"] = theUserManager;


            //在新的窗口打开无标题栏等信息


            callbackResult = theLoginStatus;
            break;

        default:
            callbackResult = theLoginStatus;
            break;
        }
    }