예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看是否有用户级语言辅助器,没有则用公共的
        LangHelper = FetchData.GetLanguageHelper(Session);

        DateTime dtEnd = Common.DAL.GetCurrentdateTime(Request["line"]);

        string sTime = Request["time"];

        if (!string.IsNullOrEmpty(sTime))
        {
            dtEnd = DateTime.Parse(sTime).AddMinutes(1);
        }

        DateTime dtStart = dtEnd.AddDays(-30);

        //dtEnd.AddHours(-2);
        //

        edtStartTime.Text = dtStart.ToString("yyyy-MM-dd HH:mm");
        edtEndTime.Text   = dtEnd.ToString("yyyy-MM-dd HH:mm");
        edtStation.Text   = Request["line"];

        string test = Request["Remain"];
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看是否有用户级语言辅助器,没有则用公共的
        LangHelper = FetchData.GetLanguageHelper(Session);

        if (IsPostBack)
        {
            f_Submit();
        }


        Dictionary <string, string> langLst = Common.LanguageHelper.GetLanguageList();

        Common.Language        = Common.readConfig("Default_Language", "chs");
        edtHomgePageTitle.Text = Common.readConfig("Home_Page_Title", "Dashboard");
        imgLogo.ImageUrl       = Common.readConfig("Logo_Picture", "../images/logo-white-no-back.png");
        chkMustLogin.Checked   = Cvt.ToBoolean(Common.readConfig("Must_Login", "false"));

        string sDBType = Common.readConfig("DAL_Assembly", "DAL_SqlServer");

        edtDbServer.Text = Common.readConfig("DBServer", "localhost");
        edtPort.Text     = Common.readConfig("DBPort", "1433");
        edtUser.Text     = Common.readConfig("DBUser", "sa");

        lstLanguage.Items.Clear();
        foreach (KeyValuePair <string, string> itm in langLst)
        {
            ListItem LstItm = new ListItem(itm.Value, itm.Key);
            LstItm.Selected = itm.Key.Equals(Common.Language, StringComparison.OrdinalIgnoreCase);

            lstLanguage.Items.Add(LstItm);
        }

        lstDatabaseType.Items.Clear();
        DALBase[] DalLst = Common.LoadAllSubClass <DALBase>();
        foreach (DALBase dal in DalLst)
        {
            ListItem LstItm = new ListItem(dal.DALName, dal.GetType().Name);
            LstItm.Selected = dal.GetType().Name.Equals(sDBType, StringComparison.OrdinalIgnoreCase);

            lstDatabaseType.Items.Add(LstItm);
        }
        lstDatabaseType.Enabled = false;

        lblLanguage.Text        = LangHelper.GetText("Default Language:");
        lblGenericSetting.Text  = LangHelper.GetText("Generic Setting:");
        lblHomePageTitle.Text   = LangHelper.GetText("Home Page Title:");
        lblMustLogin.Text       = LangHelper.GetText("Must Login:"******"Home Page Logo:");
        lblDatabaseSetting.Text = LangHelper.GetText("Database:");
        lblDatabaseType.Text    = LangHelper.GetText("Type:");
        lblDbServer.Text        = LangHelper.GetText("Server:");
        lblPort.Text            = LangHelper.GetText("Port:");
        lblUser.Text            = LangHelper.GetText("User:"******"Password:"******"Database:");
        btnInitDatabase.Text    = LangHelper.GetText("Create Tables For Init Database");
        btnTestConnection.Text  = LangHelper.GetText("Test Connection");
        btnSubmit.Text          = LangHelper.GetText("Submit");
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看是否有用户级语言辅助器,没有则用公共的
        LangHelper = FetchData.GetLanguageHelper(Session);


        return;
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看是否有用户级语言辅助器,没有则用公共的
        LangHelper = FetchData.GetLanguageHelper(Session);


        sEditableInfo = Request["ei"];
        if (sEditableInfo == null)
        {
            sEditableInfo = "_Employee";
        }

        if (sEditableInfo != null)
        {
            EditableInfo selEI = Common.SelectEditableInfo(sEditableInfo);
            if (selEI != null)
            {
                //先为选择编辑字段创建初始的Json列表
                string sJosn = "";
                JsonList = new List <string>();

                //再生成网格上的字段列表
                bool bReadOnlyTable = ((selEI.Option & Option.ReadOnly) != Option.None);

                string sHtml = "";
                FilledFieldList = new List <string>();
                foreach (Field fld in selEI.MasterTable.Fields)
                {
                    CreateJSForColumn(fld, bReadOnlyTable, ref sHtml);
                    GetJson(fld, ref sJosn);
                }

                foreach (EditableTable tbl in selEI.SlaveTables)
                {
                    foreach (Field fld in tbl.Fields)
                    {
                        CreateJSForColumn(fld, bReadOnlyTable, ref sHtml);
                        GetJson(fld, ref sJosn);
                    }
                }
                if ((selEI.Option & Option.ReadOnly) == Option.None)
                {
                    sHtml += "\n,  { display: '" + LangHelper.GetText("Operate") + "', isSort: false, width: 120, render: " + ((selEI.Option & Option.ManualSort) != Option.None ? "f_OperateUpDown" : "f_Operate") + " }";
                }

                ListHolder.Controls.Add(new LiteralControl("<script type=\"text/javascript\">\n var gColumns=[" + sHtml + "];\n"
                                                           + "var gList = {};\n"
                                                           + sJosn
                                                           + "var gUrl= '../FetchData.ashx?fn=TableEdit&rp=get&ei=" + sEditableInfo + "'; \n"
                                                           + "var gUpUrl='../FetchData.ashx?fn=TableEdit&rp=update&ei=" + sEditableInfo + "'; \n"
                                                           + "var gEnabledSort=" + ((selEI.Option & Option.ManualSort) != Option.None ? "false" : "true") + "; \n"
                                                           + "var gEnabledEdit=" + (bReadOnlyTable ? "false" : "true") + "; \n"
                                                           + "var gSelEI= '" + sEditableInfo + "'; \n"
                                                           + "</script>"));
            }
        }
    }
예제 #5
0
파일: login.aspx.cs 프로젝트: radtek/MES
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看是否有用户级语言辅助器,没有则用公共的
        LangHelper = FetchData.GetLanguageHelper(Session);

        lblUser.Text                = LangHelper.GetText("User Name:");
        lblPwd.Text                 = LangHelper.GetText("Password:"******"Change Password");
        lblNewPwd.Text              = LangHelper.GetText("New Password:"******"Confirm New Password:"******"Verify Code:");
        btnSubmit.Text              = LangHelper.GetText("Login");
        imgVerifyCode.ToolTip       = LangHelper.GetText("Click For New Picture.");
        imgVerifyCode.AlternateText = LangHelper.GetText("Verify Code");
        btnSubmit.Text              = LangHelper.GetText("Login");
        imgVerifyCode.ImageUrl      = "FetchData.ashx?fn=VerifyCode&k=" + (new System.Random().Next());

        if (Request["iptUser"] != null)
        {
            string sErrInfo = null;

#if !WEB_DEBUG
            try
            {
                if (string.Equals((string)Session["VerifyCode"], Request["iptCheckCode"], StringComparison.OrdinalIgnoreCase) == false)
                {
                    throw new Exception(LangHelper.GetText("Verify Code Is Incorrect !"));
                }
#endif
            string userName = Request["iptUser"];
            string password = Request["iptPwd"];

            Session["LogonEmployee"] = null;

            bool bChangePwd    = Cvt.ToBoolean(Request["bChangePwd"]);
            string sNewPwd     = Request["iptNewPwd"];
            string sConfirmPwd = Request["iptConfirmPwd"];
            if ((!bChangePwd) || sNewPwd != sConfirmPwd || string.IsNullOrEmpty(sNewPwd))
            {
                sNewPwd = "";
            }

            string sStation = "", sFromIP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"], sFromHost = Request.UserHostName, sFromMAC = "";
            if (string.IsNullOrEmpty(sFromIP))
            {
                sFromIP = Request.ServerVariables["REMOTE_ADDR"];
            }
            if (string.IsNullOrEmpty(sFromIP))
            {
                sFromIP = Request.UserHostAddress;
            }
            if (string.IsNullOrEmpty(sFromHost))
            {
                sFromHost = Common.GetHostName(sFromIP);
            }
            sFromMAC = Common.GetCustomerMacByArp(sFromIP);

            EmployeeInfo Employee = UserMgr.CheckLoginAuthenticate(LangHelper, userName, password, sNewPwd, sStation, sFromIP, sFromMAC, sFromHost);

            if (Employee != null)
            {
                Session["LogonEmployee"] = Employee;
                //如果父框架有方法f_LoginAuthenticated方法,则调用它
                string sHtml = "<script type=\"text/javascript\">"
                               //+ "if(parent.LoginDlg) parent.LoginDlg.close();"
                               + "if(parent.f_LoginAuthenticated) parent.f_LoginAuthenticated();"
                               + "</script>";
                errorInfoLable.Controls.Add(new LiteralControl(sHtml));

                string sTarget = Request["target"];
                if (!string.IsNullOrEmpty(sTarget))
                {
                    Response.Redirect(Server.UrlDecode(sTarget));
                }
            }
            ;
#if !WEB_DEBUG
        }
        catch (Exception excep)
        {
            sErrInfo = excep.Message;
        }
#endif
            if (sErrInfo != null)
            {
                errorInfoLable.Controls.Add(new LiteralControl(Server.HtmlEncode(sErrInfo)));
            }
        };
    }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LangHelper = FetchData.GetLanguageHelper(Session);
 }