public ActionResult PDF() { using (UOSEntities db = new UOSEntities()) { obj = GetData(); int instID = Convert.ToInt32(obj.Institute_Id); var AppID = db.Aff_ins_Application.Where(a => a.Aff_Year == obj.Id_year_for_affilation && a.Inst_ID == instID).Select(a => a.ID).Single(); List <byte[]> obj1 = new List <byte[]>(); obj1.Add(Download_Rpt_Insitut_info(Convert.ToInt32(AppID))); obj1.Add(Download_Rpt_Appl_Declaration_info(instID)); obj1.Add(Download_Rpt_Room_info(instID)); obj1.Add(Download_Rpt_Non_Requir_info(instID)); obj1.Add(Download_Rpt_Requir_info(instID)); obj1.Add(Download_Rpt_Sport_info(instID)); obj1.Add(Download_Rpt_Staff_info(instID, 1)); obj1.Add(Download_Rpt_Staff_info(instID, 0)); obj1.Add(Download_Rpt_Libaray_info(instID)); obj1.Add(Laboratory(instID)); byte[] bytes = concatAndAddContent(obj1); Response.Buffer = true; Response.Clear(); Response.AddHeader("content-disposition", "attachment; filename= Application" + "." + "PDF"); Response.OutputStream.Write(bytes, 0, bytes.Length); // create the file Response.Flush(); // send it to the client to download Response.End(); return(RedirectToAction("/Status")); } }
/// <summary> /// Database constructor method /// </summary> /// <param name="filePath"></param> /// <param name="server"></param> /// <param name="session"></param> public DatabaseObject(string filePath, string server, SessionObject session) { _Session = session; _FilePath = filePath; _ServerName = server; }
void AcceptCallBack(IAsyncResult ar) { allDone.Set(); try { var session = new SessionObject(_Settings.PacketSize, Settings.BufferSize); session.mSocket = ((Socket)ar.AsyncState).EndAccept(ar); session.ConnGuid = Guid.NewGuid(); if (!AddSession(session)) { session.mSocket.Shutdown(SocketShutdown.Both); session.mSocket.Close(); OnClassInformation(new ClassInformationEventArgs(_Settings.InstaceGuid, "The connection attempt was rejected because the limit established has been reached. To avoid this situation you must increase the value of the Capacity property")); } else { session._ConnectedOn = DateTime.Now; session._RemoteHost = ((IPEndPoint)session.mSocket.RemoteEndPoint).Address; session._RemotePort = ((IPEndPoint)session.mSocket.RemoteEndPoint).Port; OnOpenConnection(new OpenConnectionEventArgs(session.ConnGuid)); if (session.mSocket.Connected) { BeginReceive(session); } else { RemoveSession(session.ConnGuid); } } } catch (ObjectDisposedException exception) { exception.GetType(); } catch (Exception exception2) { OnClassException(new ClassExceptionEventArgs(_Settings.InstaceGuid, exception2)); } }
private bool retrieveEntity() { token = (Token)Session["token"]; rfq = rfqCRUD.readById(token.SubjectKey); if (rfq != null) { supplier = supplierCRUD.readById(rfq.SupplierId); if (supplier != null) { SessionObject soSupplier = new SessionObject(); soSupplier.Content = supplier; soSupplier.Status = "forUpdate"; Session["supplierObject"] = soSupplier; List <RFQACR> rfqACR = rfqACRCRUD.readByParentID(rfq.Id); rfq.RfqAcr = rfqACR; List <RFQEAV> rfqEAVList = rfqEAVCRUD.readByParentID(rfq.Id); rfq.RfqEAV = rfqEAVList; foreach (RFQEAV rfqEAV in rfqEAVList) { System.Collections.Generic.List <RFQDetail> rfqDetail = rfqDetailCRUD.readByParentID(rfq.Id); rfqEAV.RfqDetail = rfqDetail; } SessionObject soRFQ = new SessionObject(); soRFQ.Content = rfq; soRFQ.Status = "forUpdate"; Session["rfqObject"] = soRFQ; return(true); } } return(false); }
internal void CheckPermissions(BitPlate.Domain.Licenses.FunctionalityEnum functionality, bool checkLicenseAlso = true) { if (!SessionObject.HasPermission(functionality, checkLicenseAlso)) { throw new Exception("U heeft geen rechten voor deze functionaliteit."); } }
private void SetEndPoint(SessionQuery query, INsiClient nsiClient, EndPointStructure ep, bool clearQuery = false) { if (ep == null) { return; } //Session[Estat.Nsi.Client.Web.ISTATSettings.Session_key_endpoint] = ep; ISTATSettings.CurrentEndPoint = ep; NSIClientSettings.Instance.SetEndPoint(ISTATSettings.CurrentEndPoint); // NSIClientSettings settings = NSIClientSettings.GetSection(System.Configuration.ConfigurationUserLevel.None); NSIClientSettings settings = NSIClientSettings.Instance; SessionObject.InitializeNSIClient(); // clear criteria only if was set a data end point if (clearQuery) { if (query != null) { query.Clear(); query.Reset(); } } }
protected sealed override void DoIteration() { if (_iteration % _iterations == 1) { // Emulating new session _objectKey = Guid.NewGuid(); _cmdLoad.Parameters[0].Value = _cmdSave.Parameters[0].Value = _objectKey; } else { // Loading data from db // Step 1: Getting serialized data _cmdLoad.Parameters[0].Value = _objectKey; _cmdLoad.ExecuteNonQuery(); byte[] obj = (byte[])_cmdLoad.Parameters[1].Value; if (obj == null) { throw new Exception("Cannot locate an object with key: " + _objectKey.ToString()); } SessionObject loadedObj = ObjStoreUtils.Deserialize <SessionObject>(obj); // Validation - for demo purposes if (loadedObj.iteration != _obj.iteration) { throw new Exception("Validation failed: Iterations do not match"); } } // Saving object to DB _obj.iteration = _iteration; _cmdSave.Parameters[2].Value = ObjStoreUtils.Serialize <SessionObject>(_obj); _cmdSave.ExecuteNonQuery(); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { JsonSerializerSettings serializerSettings = new JsonSerializerSettings(); serializerSettings.Converters.Add(new AttributeValueCacheConverter(typeof(AttributeValueCache))); serializerSettings.Converters.Add(new CacheItemConverter <AttributeCache, Rock.Model.Attribute>(typeof(AttributeCache))); serializerSettings.Converters.Add(new CacheItemConverter <DefinedTypeCache, Rock.Model.DefinedType>(typeof(DefinedTypeCache))); serializerSettings.Converters.Add(new CacheItemConverter <DefinedValueCache, Rock.Model.DefinedValue>(typeof(DefinedValueCache))); var objectConverter = new ObjectConverter(typeof(Group), typeof(GroupType), typeof(GroupTypeCache), typeof(GroupType), typeof(Location), typeof(Schedule), typeof(Person), typeof(CheckInStatus), typeof(CheckInFamily), typeof(CheckInSchedule), typeof(CheckInPerson), typeof(CheckInLocation)); objectConverter.IgnoreType = value.GetType(); serializerSettings.Converters.Add(objectConverter); SessionObject sessionObject = new SessionObject(); sessionObject.Type = value.GetType(); sessionObject.Data = JsonConvert.SerializeObject(value, serializerSettings); // Now put this into the original serializer.Serialize(writer, sessionObject); }
protected void btnLogin_Click(object sender, ImageClickEventArgs e) { SessionObject objLogin = new SessionObject(); DataSet ds = new DataSet(); string susername = txtLoginID.Text.Trim().ToString(); string spassword = txtPwd.Text.Trim().ToString(); ds = BL.BL_getAdminDtl(susername); if (ds.Tables[0].Rows.Count == 1) { DataRow drlogin = ds.Tables[0].Rows[0]; if (drlogin["sPassword"].ToString() == spassword) { objLogin.UserType = "Admin"; objLogin.UserName = susername; objLogin.WebAdmin = "Yes"; objLogin.ProductCode = "DLFIN"; Session["SessionDetails"] = objLogin; Response.Redirect("Home.aspx"); } else { lblErr.Visible = true; lblErr.Text = "Incorrect Login Details"; } } else { lblErr.Visible = true; lblErr.Text = "Incorrect Login Details"; } }
/// <summary> /// Performs session login /// </summary> /// <param name="session">Login session name [DownloadStation, FileStation]</param> /// <param name="format">Returned format of session ID. Following are the two possible options and the default value is cookie. cookie: The login session ID will be set to cookie. sid: The login sid will only be returned as response json data and the cookie will not be set.</param> /// <param name="otp_code">This option is not required to log into Download Station sessions currently. However, please note that DSM 4.2 and later includes a 2-step verification option. If enabled, the user requires a verification code to log into DSM sessions.</param> /// <returns>Authorized session ID. When the user log in with format=sid, cookie will not be set and each API request should provide a request parameter sid=<sid> along with other parameters.</returns> public static SessionObject GetLogin(Init server, string session = "DownloadStation,FileStation", string format = "cookie", string otp_code = null) { string APIList = $"api=SYNO.API.Auth&version=2&method=login&account={server.Username}&passwd={server.Password}&session={session}&format={format}"; if (otp_code != null) { APIList += $"&otp_code={otp_code}"; } Uri fullPath = new UriBuilder(server.BaseAddress) { Path = BasePath, Query = APIList, }.Uri; Console.WriteLine(fullPath); string json = Init.Richiesta(fullPath).Result; Dictionary <string, string> results; SessionObject stato = new SessionObject(); try { results = JsonConvert.DeserializeObject <Dictionary <string, string> >(JObject.Parse(json)["data"].ToString()); stato.sid = results.Values.First(); } catch { throw SynoException.FromJson(json, SynoException.ExceptionType.API_Auth); } return(stato); }
internal SessionObject AddSession(string username, string clientAddress, long userId, int userLanguageId, bool allowMultipleLogin) { SessionObject newSessionObj = null; lock (_lockObject2) { foreach (var sessionObject in _sessions.Values.Where(w => w.UserId == userId).ToArray()) { //RAB: Removed the time restriction, if user logs in successfully then kill his old session. //if (!sessionObject.AllowMultipleLogins && sessionObject.LastAccess.AddMinutes(10) > DateTime.Now) //{ // throw new LoginFailedException("User not allowed to login multiple times.", Veneka.Indigo.Common.SystemResponseCode.SESSIONKEY_MULTI_LOGIN_FAIL); //} if (!sessionObject.AllowMultipleLogins)//if the elapsed time has passed kill the old session. { this.EndSession(sessionObject.SessionKey); } break; } newSessionObj = new SessionObject(this.GenerateSessionKeys(username), userId, username, clientAddress, userLanguageId, allowMultipleLogin); _sessions.Add(newSessionObj.SessionKey, newSessionObj); } return(newSessionObj); }
protected void CreateUser_Click(object sender, EventArgs e) { SessionObject userObject = (SessionObject)HttpContext.Current.Session["ID"]; UserManager userManager = new UserManager(userObject.connector); userManager.CreateUser(UserName.Text, Password.Text); }
public static CmsSite SaveSite(CmsSite obj) { BaseService.CheckSite(); if (SessionObject.CurrentBitplateUser == null) { HttpContext.Current.Response.Redirect("~/_bitplate/Login.aspx?SessionExpired=true"); } obj.Save(); //foreach (CmsLanguage lang in SessionObject.CurrentSite.Languages) //{ // lang.Delete(); //} SessionObject.CurrentSite = obj; //bij wijzigingen in veld licentiecode if (SessionObject.CurrentLicense != null && SessionObject.CurrentLicense.Code != obj.LicenceCode) { //herladen van licentie moet worden afgedwongen SessionObject.CurrentLicense = SessionObject.LoadLicense(); } SessionObject.CurrentSite.IsValidLicense = (SessionObject.CurrentLicense != null); return(SessionObject.CurrentSite); }
internal SeriesSymbolData(InstrumentDataRequest dataRequest, InstrumentSettings settings = null) { this.Id = 0x40000000 | System.Threading.Interlocked.Increment(ref __iLastSeriesId); this.Indexer = new SeriesIndexer(); __cDataRequest = dataRequest; __cSettings = ((settings == null) ? new InstrumentSettings(ref __cDataRequest) : settings.Create(ref __cDataRequest)); __cUpdateTime = DateTime.UtcNow.AddHours(__cSettings.TimeZone); SessionObject cSession = __cSettings.GetSessionFromToday(); __iRealtimeCount = (cSession == null) ? 1 : (int) ((cSession.GetCloseTimeForDaylight() - cSession.GetStartTimeForDaylight()).TotalSeconds / dataRequest.Resolution.TotalSeconds + 1); Indexer.HistoryIndex = 0; Indexer.RealtimeIndex = -1; __cOpens = new Series<double>(__iRealtimeCount); __cOpens.onRequest += Series_onRequest; __cHighs = new Series<double>(__iRealtimeCount); __cHighs.onRequest += Series_onRequest; __cLows = new Series<double>(__iRealtimeCount); __cLows.onRequest += Series_onRequest; __cCloses = new Series<double>(__iRealtimeCount); __cCloses.onRequest += Series_onRequest; __cTimes = new Series<DateTime>(__iRealtimeCount); __cTimes.onRequest += Series_onRequest; __cVolumes = new Series<double>(__iRealtimeCount); __cVolumes.onRequest += Series_onRequest; __cDataRequest.Range.Count = 0; //將資料筆數設定為0(因為一開始沒有請求任何資訊) }
private void checkDaylight_CheckedChanged(object sender, EventArgs e) { bool bEnabled = checkDaylight.Checked; pickerDaylightStart.Enabled = bEnabled; pickerDaylightEnd.Enabled = bEnabled; if (gridSession.SelectedDataRows.Length > 0) { SessionObject cSession = gridSession.SelectedDataRows[0] as SessionObject; DaylightTime cDaylightTime = cSession.Daylight; if (bEnabled) { if (cDaylightTime == null) { cDaylightTime = new DaylightTime(); cDaylightTime.StartDate = DateTime.UtcNow; cDaylightTime.EndDate = DateTime.UtcNow; cSession.Daylight = cDaylightTime; } } else { if (cDaylightTime != null) { cSession.Daylight = null; } } } }
public Boolean ValidateCurrentRequestToken(string Key) { Boolean Flag = false; ObjExistingSessionObject = null; ((ConcurrentDictionary <string, SessionObject>)ObjSesstionCache).TryGetValue(Key, out ObjExistingSessionObject); if (ObjExistingSessionObject != null) { Double TotalSeconds = (DateTime.Now - ObjExistingSessionObject.LastUpdatedOn).TotalSeconds; if (TotalSeconds > 1200) { SetClientCookies(null); ObjSesstionCache.TryRemove(Key, out ObjExistingSessionObject); FireException("Token expired.", EFlags.TokenExpired, Key); } else { ObjExistingSessionObject.LastUpdatedOn = DateTime.Now; //ObjSesstionCache[Key] = ObjExistingSessionObject; SetClientCookies(Key); Flag = true; } } else { FireException("Token not found.", EFlags.TokenNotFound, Key); } return(Flag); }
//Returning object for Com_members of DataTable public JsonResult CMDataTableViewer() { obj = GetData(); var dbVisitApp = db.Affi_ins_Pop_Visit_applications(Convert.ToInt32(obj.Institute_Id)); return(Json(dbVisitApp, JsonRequestBehavior.AllowGet)); }
void AcceptCallBack(IAsyncResult ar) { allDone.Set(); try { var session = new SessionObject(_Settings.PacketSize, Settings.BufferSize); session.mSocket = ((Socket) ar.AsyncState).EndAccept(ar); session.ConnGuid = Guid.NewGuid(); if (!AddSession(session)) { session.mSocket.Shutdown(SocketShutdown.Both); session.mSocket.Close(); OnClassInformation(new ClassInformationEventArgs(_Settings.InstaceGuid, "The connection attempt was rejected because the limit established has been reached. To avoid this situation you must increase the value of the Capacity property")); } else { session._ConnectedOn = DateTime.Now; session._RemoteHost = ((IPEndPoint) session.mSocket.RemoteEndPoint).Address; session._RemotePort = ((IPEndPoint) session.mSocket.RemoteEndPoint).Port; OnOpenConnection(new OpenConnectionEventArgs(session.ConnGuid)); if (session.mSocket.Connected) BeginReceive(session); else RemoveSession(session.ConnGuid); } } catch (ObjectDisposedException exception) { exception.GetType(); } catch (Exception exception2) { OnClassException(new ClassExceptionEventArgs(_Settings.InstaceGuid, exception2)); } }
private Boolean AddSession(string Key, Object UserObject, string CurrentSessionConnectionString) { Boolean Flag = false; ObjExistingSessionObject = null; ((ConcurrentDictionary <string, SessionObject>)ObjSesstionCache).TryGetValue(Key, out ObjExistingSessionObject); if (ObjExistingSessionObject != null) { if (UserObject != null) { ObjExistingSessionObject.UserObject = UserObject; } if (!string.IsNullOrEmpty(CurrentSessionConnectionString)) { ObjExistingSessionObject.SessionConnectionString = CurrentSessionConnectionString; } ObjExistingSessionObject.LastUpdatedOn = DateTime.Now; ObjSesstionCache[Key] = ObjExistingSessionObject; } else { SessionObject ObjUserObject = new SessionObject(); ObjUserObject.UserObject = UserObject; ObjUserObject.LastUpdatedOn = DateTime.Now; ObjUserObject.SessionConnectionString = CurrentSessionConnectionString; ObjSesstionCache.TryAdd(Key, ObjUserObject); Flag = true; } return(Flag); }
// view for insertion feed back of committee members public ActionResult FeedbackRcmdSeats() { obj = GetData(); var VisitedInst = db.BI_Affi_ins_pop_visited_institute(Convert.ToInt32(obj.Institute_Id)).ToList();// give id from section ComFeedbackRcmdSeats objfb = new ComFeedbackRcmdSeats(); List <DDLFeedbackRecommandedSeats> objlist = new List <DDLFeedbackRecommandedSeats>(); foreach (var item in VisitedInst) { DDLFeedbackRecommandedSeats objj = new DDLFeedbackRecommandedSeats(); objj.instituteID = Convert.ToInt16(item.Institute_ID); objj.instituteName = item.Institute_Name; objlist.Add(objj); } //pop and fill course according to visited institute //var courseswId = db.BI_pop_applyed_courses(Convert.ToInt16(VisitedInst[0].Institute_ID)).ToList(); List <DDLFeedbackRcmdSeatsCourse> objlist1 = new List <DDLFeedbackRcmdSeatsCourse>(); //foreach (var item in courseswId) //{ DDLFeedbackRcmdSeatsCourse obj1 = new DDLFeedbackRcmdSeatsCourse(); obj1.CourseId = 0; obj1.CourseDesc = "------Select Program------"; objlist1.Add(obj1); //} objfb.CourseName = objlist1; objfb.instNames = objlist; return(View(objfb)); }
public void BuildFrameRecentChangeItems() { if (SessionObject.HasPermission(FunctionalityEnum.DataCollectionsEditData)) { BaseCollection <DataCollection> dataCollectionList = BaseCollection <DataCollection> .Get("FK_Site = '" + SessionObject.CurrentSite.ID.ToString() + "'", "ModifiedDate DESC", 1, 5); //List<DataCollection> TopDataCollections = DataCollectionList.Take(5).ToList(); TopDataCollectionList.Text = "<ul>"; foreach (DataCollection collection in dataCollectionList) { TopDataCollectionList.Text += String.Format("<li><a href=\"DataCollections/DataCollectionData.aspx?datacollectionid={0}\"><div class=\"lastChangedItemName bitTableColumnEllipsis\" title=\"{1}\">{1}</div><div class=\"lastChangedItemDate\">{2:dd-MM-yy HH:mm}</div></a></li>", collection.ID, collection.Name, collection.ModifiedDate); } TopDataCollectionList.Text += "</ul>"; } if (SessionObject.HasPermission(FunctionalityEnum.PagesEdit)) { //Is LoadFromSQL misschien een betere oplossing ipv get? BaseCollection <CmsPage> PageList = BaseCollection <CmsPage> .Get("FK_Site = '" + SessionObject.CurrentSite.ID.ToString() + "'", "ModifiedDate DESC", 1, 5); //List<CmsPage> TopCMSPages = PageList.Take(5).ToList(); TopPageList.Text = "<ul>"; foreach (CmsPage page in PageList) { //TopPageList.Text += string.Format("<li><a href=\"/_bitplate/EditPage/EditPage.aspx?pageid={0}\"><div class=\"lastChangedItemName bitTableColumnEllipsis\" title=\"{1}\">{1}</div><div class=\"lastChangedItemDate\">{2:dd-MM-yy HH:mm}</div></a></li>", page.ID, page.Name, page.ModifiedDate); TopPageList.Text += string.Format("<li><a href=\"{1}?mode=edit\"><div class=\"lastChangedItemName bitTableColumnEllipsis\" title=\"{1}\">{1}</div><div class=\"lastChangedItemDate\">{2:dd-MM-yy HH:mm}</div></a></li>", page.ID, page.RelativeUrl, page.ModifiedDate); } TopPageList.Text += "</ul>"; } }
protected void Page_Load(object sender, EventArgs e) { base.CheckSite(); base.CheckLogin(); if (SessionObject.CurrentLicense == null) { base.CheckPermissions(BitPlate.Domain.Licenses.FunctionalityEnum.SiteConfig, false); } else { base.CheckPermissions(BitPlate.Domain.Licenses.FunctionalityEnum.SiteConfig, true); } if (Request.QueryString["InvalidLicense"] != null) { //LiteralMsg.Text = "<h2 style='color:darkred'>Licentie is ongeldig</h2>"; } if (Request.QueryString["Referer"] != null) { this.BackLink.HRef = Request.QueryString["Referer"]; //if (Request.QueryString["Template"] != null) //{ // this.BackLink.HRef += "?Template"; //} //if (Request.QueryString["id"] != null) //{ // this.BackLink.HRef += "#" + Request.QueryString["id"]; //} } if (!SessionObject.HasPermission(FunctionalityEnum.SiteConfig, false)) { throw new Exception("U heeft geen rechten op deze pagina"); } else { if (SessionObject.CurrentLicense != null) { if (!SessionObject.CurrentLicense.AllowMultipleLanguages) { //languageWrapper.InnerHtml = "Uw licentie staat het gebruik van meertaligheid niet toe."; } } } foreach (CmsPage page in SessionObject.CurrentSite.Pages) { ListItem li = new ListItem(page.RelativeUrl, page.ID.ToString()); if (this.hasPageOptinModule(page)) { selectOptInEmailPage.Items.Add(li); } if (this.hasPageOptOutModule(page)) { selectOptOutEmailPage.Items.Add(li); } } }
protected void Page_Load(object sender, EventArgs e) { if (!SessionObject.HasPermission(FunctionalityEnum.UserRights)) { this.PanelMain.Visible = false; this.LiteralMsg.Text = "U heeft geen rechten om autorisatie in te stellen. Vraag de websitebeheerder voor meer toegang."; } }
public static Boolean Remove(string Key) { Boolean Flag = false; SessionObject RemovedSessionObject = null; Flag = instance.ObjSesstionCache.TryRemove(Key, out RemovedSessionObject); return(Flag); }
protected void Button3_Click(object sender, EventArgs e) { SessionObject userObject = (SessionObject)HttpContext.Current.Session["ID"]; UserManager userManager = new UserManager(userObject.connector); userManager.DelUser(userObject.adminUserIdSelected); Response.Redirect("UserManagement.aspx"); }
protected void Page_Load(object sender, EventArgs e) { base.CheckLoginAndLicense(); base.CheckPermissions(BitPlate.Domain.Licenses.FunctionalityEnum.FileManager); string js = @"<script type=""text/javascript""> $(document).ready(function(){ BITFILEMANAGEMENT.siteDomain = '" + SessionObject.CurrentSite.DomainName + @"'; }); </script>"; LiteralScript.Text = js; if (Request.QueryString["Referer"] != null) { this.BackLink.HRef = Request.QueryString["Referer"]; if (Request.QueryString["Template"] != null) { this.BackLink.HRef += "?Template"; } if (Request.QueryString["id"] != null) { this.BackLink.HRef += "#" + Request.QueryString["id"]; } } tumbnailWith.Value = SessionObject.CurrentSite.MaxWidthThumbnails.ToString(); if (!SessionObject.HasPermission(FunctionalityEnum.FileManagerUpload)) { liFileUpload.Disabled = true; aFileUpload.HRef = "#"; } if (!SessionObject.HasPermission(FunctionalityEnum.FileManagerDownload)) { liFileDownload.Disabled = true; aFileDownload.HRef = "#"; } if (!SessionObject.HasPermission(FunctionalityEnum.FileManagerRename)) { liFileRename.Disabled = true; aFileRename.HRef = "#"; } if (!SessionObject.HasPermission(FunctionalityEnum.FileManagerCreateThumbnail)) { liCreateThumb.Disabled = true; aCreateThumb.HRef = "#"; } if (!SessionObject.HasPermission(FunctionalityEnum.FileManagerCCP)) { liFileCut.Disabled = true; aFileCut.HRef = "#"; liFileCopy.Disabled = true; aFileCopy.HRef = "#"; liFilePaste.Disabled = true; aFilePaste.HRef = "#"; } }
public void OnGameSessionReset(SessionObject obj) { m_pSession = obj; m_pSession.m_pfOnConnect.Add(OnConnect); m_pSession.m_pfOnError.Add(OnError); m_pSession.m_pfOnClose.Add(OnClose); m_pSession.RegistMessage("GameProto.PlayerRequestGameTest", OnPlayerRequestGameTest); }
public JsonResult StatusViewer() { obj = GetData(); int instId = Convert.ToInt32(obj.Institute_Id); var list = ""; //store procedure for status return(Json(list, JsonRequestBehavior.AllowGet)); }
protected void Page_Load(object sender, EventArgs e) { clsCommonFunctions.ValidateSessionExpired(this, "SessionDetails"); objLogin = (SessionObject)Session["SessionDetails"]; lblScheme.Text = Request.QueryString[0]; lblMonth.Text = Request.QueryString[1]; BindGridMonthlyInterestSummary(); lblreportdate.Text = DateTime.Now.ToString("dd-MMMM-yyyy"); }
public ActionResult status() { using (UOSEntities db = new UOSEntities()) { obj = GetData(); int instid = Convert.ToInt32(obj.Institute_Id); var list = db.AJ_Affi_Ins_Pop_Instu_Info(instid); UserStatus status = new UserStatus(); foreach (var item in list) { status.Email = item.Ins_Email; status.InstituteName = item.Ins_Name; status.MobileNumber = item.Ins_OfficMobile; status.Nature = item.College_Catg; status.PhoneNumber = item.Ins_ContactPTCL; status.PostalAddress = item.Ins_PostAddres; status.PrincipalName = item.Ins_PrinciPal_Name; obj.Application_id = Convert.ToInt32(item.application_id); if (item.Securty_status == 1) { status.Status = "successfully Granted"; status.ReturnStatusIdentity = 1; } else if (item.is_grant_Affiliation == true && (item.Securty_status == 0 || item.Securty_status == null)) { var dv = db.Aj_affi_Get_application_Prog_scurity_Fee(item.application_id); foreach (var ite in dv) { status.Status = "Affiliation conditionally granted Submit your Secuirty Fee as soon as possiable with demand daraf of RS."; status.StatusValueFOrLink = ite.Value.ToString(); status.Status1 = "And Upload Draft."; status.ReturnStatusIdentity = 2; } } else if (item.Is_visit == true && (item.is_grant_Affiliation == false || item.is_grant_Affiliation == null) && (item.Securty_status == 0 || item.Securty_status == null)) { status.Status = "Application is in visiting schedule. Affiliation Inspection committee will visit you soon."; } else if (item.Is_visit_assign == true && (item.Is_visit == false || item.Is_visit == null)) { status.Status = "Application is in process wait for visit of affiliation insecption committee."; } else if (item.IS_submit == true && (item.Is_visit_assign == false || item.Is_visit_assign == null)) { status.Status = "Your Application Is submit from your side please wait for further action from Affiliation Branch of UOS."; } else if ((item.IS_submit == false || item.IS_submit == null) && (item.Is_visit_assign == false || item.Is_visit_assign == null)) { status.Status = "You Application Is not complet Or Reject from Admin due to some deficieny."; } } return(View(status)); } }
/// <summary> /// 根據設定資訊調整 InstrumentDataRequest 設定並回傳目前的設定類別 /// </summary> /// <param name="request">InstrumentDataRequest類別</param> /// <returns>回傳值: 目前的 InstrumentSettings類別</returns> public InstrumentSettings Create(ref InstrumentDataRequest request) { SessionObject cSession = GetSessionFromToday(); DataRequestType cRequestType = request.Range.RequestType; request.Resolution.CalculateRate(cSession.GetStartTimeForDaylight(), cSession.GetCloseTimeForDaylight(), __cProperty.Sessions.Count); if (cRequestType == DataRequestType.DaysBack || cRequestType == DataRequestType.FromTo) { request.Range.Count = request.Resolution.ConvertDaysToBars(request.Range.Count); } return this; }
public override void SetAndReleaseItemExclusive(System.Web.HttpContext context, string id, SessionStateStoreData item, object lockId, bool newItem) { var sessItems = Serialize((SessionStateItemCollection)item.Items); var collection = this._mongo.GetCollection(); this._mongo.EnsureTTLIndex(collection, this._timeoutInMinutes); this.LogSessionObjects(item.Items, id, context.Request.RawUrl, GetUsername(context.User)); if (newItem) { var newSession = new SessionObject() { SessionID = id, ApplicationName = this._applicationName, Username = this.GetUsername(context.User), SessionData = sessItems, Timeout = (int)this._timeoutInMinutes, Flags = 0, CreatedDate = DateTime.UtcNow, ExpiresDate = DateTime.UtcNow.AddMinutes(this._timeoutInMinutes), IsLocked = false, LockID = (int)lockId, LockedDate = DateTime.UtcNow }; collection.Save(newSession); this.LogEvent(id, context.Request.RawUrl, GetUsername(context.User), "Insert new session"); } else { var query = Query.And( Query<SessionObject>.EQ(x => x.BsonID, SessionObject.GetBsonId(this._applicationName, id)), Query<SessionObject>.EQ(y => y.LockID, lockId) ); var update = Update<SessionObject> .Set(x => x.SessionData, sessItems) .Set(y => y.IsLocked, false) .Set(z => z.Username, this.GetUsername(context.User)); collection.Update(query, update); this.LogEvent(id, context.Request.RawUrl, GetUsername(context.User), "Set items and unlock session - " + lockId); } }
public override void CreateUninitializedItem(System.Web.HttpContext context, string id, int timeout) { var collection = this._mongo.GetCollection(); this._mongo.EnsureTTLIndex(collection, this._timeoutInMinutes); var newSession = new SessionObject() { SessionID = id, ApplicationName = this._applicationName, Username = this.GetUsername(context.User), SessionData = string.Empty, Timeout = (int)this._timeoutInMinutes, Flags = 0, CreatedDate = DateTime.UtcNow, ExpiresDate = DateTime.UtcNow.AddMinutes(this._timeoutInMinutes), IsLocked = false, LockID = (int)0, LockedDate = DateTime.UtcNow }; collection.Save(newSession); this.LogEvent(id, context.Request.RawUrl, GetUsername(context.User), "Create uninitialized session"); }
bool AddSession(SessionObject Session) { bool flag; try { lock (Connections.SyncRoot) { if (Connections.Count >= _Settings.Capacity) return false; Connections.Add(Session.ConnGuid, Session); flag = true; } } catch { flag = false; } return flag; }
internal DataReceivedEventArgs(SessionObject Session, int StartIndex, int Length) { this.Session = Session; this.StartIndex = StartIndex; this.Length = Length; }
void Disconnect(SessionObject mClient, Guid ConnGuid) { try { if (mClient != null) if ((mClient.mSocket != null) && mClient.mSocket.Connected) mClient.mSocket.Close(); else RemoveSession(mClient.ConnGuid); else if (ConnGuid != Guid.Empty) RemoveSession(ConnGuid); } catch (Exception exception) { exception.GetType(); } }
void BeginReceive(SessionObject mClient) { try { if (mClient.mSocket.Connected) mClient.mSocket.BeginReceive(mClient.Buffer, 0, _Settings.PacketSize, SocketFlags.None, new AsyncCallback(ReadCallBack), mClient); else RemoveSession(mClient.ConnGuid); } catch { Disconnect(mClient, mClient.ConnGuid); } }