private void BindDataGrid() { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("key"); dt.Columns.Add("value"); dt.Columns.Add("description"); dt.Columns.Add("valid"); SystemWholeXmlConfigManager.EnsureLoaded(); Hashtable cache = SystemWholeXmlConfigManager.Caches; SystemWholeXmlConfig config; System.Collections.IDictionaryEnumerator enumerator = cache.GetEnumerator(); DataRow dr = null; while (enumerator.MoveNext()) { config = enumerator.Value as SystemWholeXmlConfig; dr = dt.NewRow(); dr["id"] = config.Id; dr["key"] = config.Key; dr["value"] = config.Value; dr["description"] = config.Description; dr["valid"] = config.Valid; dt.Rows.Add(dr); } this.DataGrid1.DataSource = dt; this.DataGrid1.DataBind(); }
protected void btnSure_Click(object sender, EventArgs e) { SystemWholeXmlConfig entity = new SystemWholeXmlConfig(); WebFormHelper.GetDataFromForm(this, entity); entity.Valid = this.rblState.SelectedIndex; SystemWholeXmlConfigManager.SaveConfig(entity); WebTools.Alert(this, "配置系统参数成功!"); }
protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { SystemWholeXmlConfigManager.RemoveConfig(e.CommandArgument.ToString()); WebTools.Alert(this, "删除成功!"); this.BindDataGrid(); } else if (e.CommandName == "Detail") { string key = e.CommandArgument.ToString(); this.Pop(key); } }
private void GetXParam() { try { string host = ""; if (HttpContext.Current.Session["host"] != null) { host = HttpContext.Current.Session["host"].ToString(); } else { host = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_MIDDLEWARE_HOST"), "127.0.0.1"); } _TG.HostName = HttpContext.Current.Request.Url.Host; VERIFY_CLSID = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_VERIFY_CLSID"), "F4C54CF0-BBDD-40B4-98BC-96AC9DB8F091"); ENROLL_CLSID = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_ENROLL_CLSID"), "540BE1A4-553C-4676-9932-85F61D4034E0"); _TG.ProductID = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_MIDDLEWARE_PRODRCTID"), "DEMO"); _TG.Port = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_MIDDLEWARE_PORT"), 26057); _TG.DeviceType = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("PF_DEVICETYPE"), "31"); _TG.OcxClassID = VERIFY_CLSID; _TG.OcxName = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_OCXNAME"), "XECtrl103.ocx"); //if (isSa) { _TG.AuthenID = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_MIDDLEWARE_AUTHENID"), "sa"); _TG.AuthenPwd = StringHelper.fnFormatNullOrBlankString(SystemWholeXmlConfigManager.GetConfig("FP_MIDDLEWARE_AUTHENPWD"), "sa"); // } //else // { // authenIndex = ++authenIndex % authens.Length; // string authen = authens[authenIndex]; // _TG.AuthenID = authen; // _TG.AuthenPwd = authen; // } } catch (NullReferenceException nre) { _TG.HostName = "127.0.0.1"; VERIFY_CLSID = "F4C54CF0-BBDD-40B4-98BC-96AC9DB8F091"; ENROLL_CLSID = "540BE1A4-553C-4676-9932-85F61D4034E0"; _TG.ProductID = "DEMO;"; _TG.Port = 26057; _TG.AuthenID = "sa"; _TG.AuthenPwd = "sa"; _TG.DeviceType = "31"; _TG.OcxClassID = VERIFY_CLSID; _TG.OcxName = "XECtrl103.ocx"; } }
//记录学员上课时间 public static int fnIdendityStudentLesson(String pStrIdCard) { //FT.DAL.Orm.SimpleOrmOperator.QueryList int lIntReturn = CHECKIN_FAILE; int lIntLessonInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_LESSON_INTERVAL"), 45); FpStudentObject fso = null; ArrayList lArrStu = FT.DAL.Orm.SimpleOrmOperator.QueryConditionList <FpStudentObject>("where idcard='" + pStrIdCard + "'"); if (lArrStu.Count != 1) { return(CHECHIN_NO_RECARD); } fso = lArrStu[0] as FpStudentObject; bool lBlResult = false; DateTime lDtIdentity = DateTime.Now; string lStrUpdateSql = "update fp_student set {0}=TO_DATE('{1}','yyyy-mm-dd hh24:mi:ss') where idcard='{2}'"; string lStrUpdateSqlClearRecord = "update fp_student set LESSON_ENTER_1=null,LESSON_ENTER_2=null,LESSON_LEAVE_2=null where idcard='{0}'"; string lStrLessonFinishSql = "update fp_student set LESSON_FINISH=1 where idcard='{0}'"; string lStrParm0 = null; string lStrParm1 = lDtIdentity.ToString(); string lStrParm2 = fso.IDCARD; string lStrPrfLESSON_ENTER = "LESSON_ENTER"; string lStrPrfLESSON_LEAVE = "LESSON_LEAVE"; if (DateTimeHelper.fnIsNewDateTime(fso.LESSON_ENTER_1)) { lStrParm0 = lStrPrfLESSON_ENTER + "_1"; } else if (!fnIsVaildTime(fso.LESSON_ENTER_1, lDtIdentity, 0)) { lStrUpdateSqlClearRecord = string.Format(lStrUpdateSqlClearRecord, lStrParm2); FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSqlClearRecord); lIntReturn = LESSON_ENTER_1_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.LESSON_ENTER_2)) { if (fnIsVaildTime(fso.LESSON_ENTER_1, lDtIdentity, lIntLessonInterval)) { lStrParm0 = lStrPrfLESSON_ENTER + "_2"; } else { lIntReturn = LESSON_ENTER_2_FAILE; } } else if (DateTimeHelper.fnIsNewDateTime(fso.LESSON_LEAVE_2)) { if (fnIsVaildTime(fso.LESSON_ENTER_2, lDtIdentity, lIntLessonInterval)) { lStrParm0 = lStrPrfLESSON_LEAVE + "_2"; } else { lIntReturn = LESSON_LEAVE_2_FAILE; } } if (lStrParm0 != null) { lStrUpdateSql = string.Format(lStrUpdateSql, lStrParm0, lStrParm1, lStrParm2); lBlResult = FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSql); lIntReturn = CHECKIN_SUCCESS; if (lStrParm0 == lStrPrfLESSON_LEAVE + "_2") { lStrLessonFinishSql = string.Format(lStrLessonFinishSql, lStrParm2); lBlResult = FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrLessonFinishSql); if (lBlResult) { lIntReturn = LESSON_FINISH; } } } return(lIntReturn); }
//记录学员入场训练时间 public static int fnIdendityStudentTrain(String pStrIdCard) { //FT.DAL.Orm.SimpleOrmOperator.QueryList int lIntReturn = CHECKIN_FAILE; int lIntTrainInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_TRAIN_INTERVAL"), 45); FpStudentObject fso = null; ArrayList lArrStu = FT.DAL.Orm.SimpleOrmOperator.QueryConditionList <FpStudentObject>("where idcard='" + pStrIdCard + "'"); if (lArrStu.Count != 1) { return(CHECHIN_NO_RECARD); } fso = lArrStu[0] as FpStudentObject; bool lBlResult = false; DateTime lDtIdentity = DateTime.Now; string lStrUpdateSql = "update fp_student set {0}=TO_DATE('{1}','yyyy-mm-dd hh24:mi:ss') where idcard='{2}'"; string lStrTrainFinishSql = "update fp_student set TRAIN_FINISH=1 where idcard='{0}'"; string lStrParm0 = null; string lStrParm1 = lDtIdentity.ToString(); string lStrParm2 = fso.IDCARD; string lStrPrfTRAIN_ENTER = "TRAIN_ENTER"; string lStrPrfTRAIN_LEAVE = "TRAIN_LEAVE"; string lStrClearParm0 = null; if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_1) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_1)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_1)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_1"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_1, lDtIdentity)) { lStrClearParm0 = "1"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_1, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_1"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_1, lDtIdentity)) { lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_2) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_2)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_2)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_2"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_2, lDtIdentity)) { lStrClearParm0 = "2"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_2, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_2"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_2, lDtIdentity)) { lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_3) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_3)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_3)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_3"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_3, lDtIdentity)) { lStrClearParm0 = "3"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_3, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_3"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_3, lDtIdentity)) { lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_4) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_4)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_4)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_4"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_4, lDtIdentity)) { lStrClearParm0 = "4"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_4, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_4"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_4, lDtIdentity)) { lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_5) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_5)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_5)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_5"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_5, lDtIdentity)) { lStrClearParm0 = "5"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_5, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_5"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_5, lDtIdentity)) { //lStrClearParm0 = "5"; lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_6) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_6)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_6)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_6"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_6, lDtIdentity)) { lStrClearParm0 = "6"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_6, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_6"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_6, lDtIdentity)) { //lStrClearParm0 = "6"; lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_7) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_7)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_7)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_7"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_7, lDtIdentity)) { lStrClearParm0 = "7"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_7, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_7"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_7, lDtIdentity)) { //lStrClearParm0 = "7"; lIntReturn = CHECK_SAMEDAY_FAILE; } else if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_8) || DateTimeHelper.fnIsNewDateTime(fso.TRAIN_LEAVE_8)) { if (DateTimeHelper.fnIsNewDateTime(fso.TRAIN_ENTER_8)) { lStrParm0 = lStrPrfTRAIN_ENTER + "_8"; } else if (!fnIsVaildTime(fso.TRAIN_ENTER_8, lDtIdentity)) { lStrClearParm0 = "8"; } else if (fnIsVaildTime(fso.TRAIN_ENTER_8, lDtIdentity, lIntTrainInterval)) { lStrParm0 = lStrPrfTRAIN_LEAVE + "_8"; } else { lIntReturn = TRAIN_LEAVE_FAILE; } } else if (fnIsVaildTime(fso.TRAIN_ENTER_8, lDtIdentity)) { // lStrClearParm0 = "8"; lIntReturn = CHECK_SAMEDAY_FAILE; } if (lStrParm0 != null) { lStrUpdateSql = string.Format(lStrUpdateSql, lStrParm0, lStrParm1, lStrParm2); lBlResult = FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSql); lIntReturn = CHECKIN_SUCCESS; if (lStrParm0 == lStrPrfTRAIN_LEAVE + "_8") { lStrTrainFinishSql = string.Format(lStrTrainFinishSql, lStrParm2); lBlResult = FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrTrainFinishSql); if (lBlResult) { lIntReturn = TRAIN_FINISH; } } } else if (lStrClearParm0 != null) { string lStrUpdateSqlClearRecord = "update fp_student set TRAIN_LEAVE_{0}=null,TRAIN_ENTER_{0}=null where idcard='{1}'"; lStrUpdateSqlClearRecord = string.Format(lStrUpdateSqlClearRecord, lStrClearParm0, lStrParm2); lBlResult = FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSqlClearRecord); lIntReturn = TRAIN_ENTER_FAILE; } return(lIntReturn); }