本文整理汇总了C#中BasePage类的典型用法代码示例。如果您正苦于以下问题:C# BasePage类的具体用法?C# BasePage怎么用?C# BasePage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BasePage类属于命名空间,在下文中一共展示了BasePage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BasePage objBase = new BasePage();
DataSet ds = UserInfo.GetAllActiveLanguages();
DataRow dr = ds.Tables[0].Select("LanguageId =" + objBase.LanguageId)[0];
litLangauge.Text = Convert.ToString(dr["CountryName"]);
img.Src = "/images/" + Convert.ToString(dr["Flag"]);
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = "LanguageId <>" + objBase.LanguageId;
rptLanguage.DataSource = dv;
rptLanguage.DataBind();
if (!string.IsNullOrEmpty(HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"]))
{
Utils.SetCulture(HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"].ToString(), HttpContext.Current.Request.Cookies["CultureCookie"]["UICulture"].ToString());
}
}
}
开发者ID:AsmaBabarISL,项目名称:Epr_General,代码行数:25,代码来源:landingHeader.ascx.cs
示例2: ProcessRequest
//private const string uploadPath = "../commup/upload/";
public void ProcessRequest(HttpContext context)
{
string vlreturn = "", error = "", json = "";
BasePage basepage = new BasePage();
if (context.Request.Files.Count == 0)
{
vlreturn = "";
error = CCommon.Get_Definephrase(Definephrase.Invalid_file);
}
else
{
string uploadPath = context.Request.QueryString["up"];
uploadPath = CFunctions.IsNullOrEmpty(uploadPath) ? "commup/upload/" : CFunctions.MBDecrypt(uploadPath);
DirectoryInfo pathInfo = new DirectoryInfo(context.Server.MapPath(uploadPath));
for (int i = 0; i < context.Request.Files.Count; i++)
{
HttpPostedFile fileUpload = context.Request.Files[i];
if (CFunctions.IsNullOrEmpty(fileUpload.FileName)) continue;
vlreturn = ""; error = "";
string fileExtension = Path.GetExtension(fileUpload.FileName).ToLower();
if (extension_img.IndexOf(fileExtension) == -1)
{
error = CCommon.Get_Definephrase(Definephrase.Invalid_filetype_image);
}
else
{
string fileName;
if (pathInfo.GetFiles(fileUpload.FileName).Length == 0)
{
fileName = Path.GetFileName(fileUpload.FileName);
}
else
{
fileName = this.Get_Filename() + fileExtension;
//error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_duplicate);
}
string uploadLocation = context.Server.MapPath(uploadPath) + "\\" + fileName;
if (fileUpload.ContentLength > CConstants.FILEUPLOAD_SIZE)
{
this.ResizeImage(fileUpload, uploadLocation, 800, 760, true);
}
else
{
fileUpload.SaveAs(uploadLocation);
}
vlreturn = uploadPath.Replace("../", "") + fileName;
error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_done);
}
json += (CFunctions.IsNullOrEmpty(json) ? "" : ",") + "{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}";
}
}
context.Response.ContentType = "text/plain";
//context.Response.Write("{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}");
context.Response.Write("{\"bindings\": [" + json + "]}");
}
开发者ID:thienchi,项目名称:my-bfinance,代码行数:61,代码来源:FPUploadHandler.ashx.cs
示例3: GoToPage
public void GoToPage(PageType pageType)
{
if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything
BasePage pageToCreate = null;
if(pageType == PageType.TitlePage)
{
pageToCreate = new TitlePage();
}
if(pageType == PageType.InGamePage)
{
pageToCreate = new InGamePage();
}
else if (pageType == PageType.ScorePage)
{
pageToCreate = new ScorePage();
}
if(pageToCreate != null) //destroy the old page and create a new one
{
_currentPageType = pageType;
if(_currentPage != null)
{
_currentPage.Destroy();
_stage.RemoveChild(_currentPage);
}
_currentPage = pageToCreate;
_stage.AddChild(_currentPage);
_currentPage.Start();
}
}
开发者ID:jrendel,项目名称:LD27,代码行数:34,代码来源:Main.cs
示例4: CargaMenuUsuario
protected void CargaMenuUsuario()
{
BasePage oPagina = new BasePage();
Usuarios objUsuario = (Usuarios)oPagina.LeerVariableSesion("oUsuario");
string cUrl = "";
string menuTitle = "";
//string cDescription = "";
int nNumCor = 1;
string menuItemID = "";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("~/" + objUsuario.Roles.rolMenu.ToString()));
XmlNode SiteMap = xmlDoc.LastChild;
///MENU PRINCIAL
foreach (XmlNode menuNode in SiteMap)
{
cUrl = menuNode.Attributes["url"].Value;
menuTitle = menuNode.Attributes["title"].Value;
//cDescription = menuNode.Attributes["description"].Value;
menuItemID = menuTitle + "_" + nNumCor.ToString();
EasymenuMain.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(menuItemID, menuTitle, "", "", "", ""));
EasymenuMain.AddSeparator("MenuSeparator" + nNumCor.ToString(), "|");
if (cUrl == "#")
LeerSubmenu(menuNode, menuItemID, true);
nNumCor++;
}
}
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:31,代码来源:Site.Master.cs
示例5: ReadPageJournal
private BasePage ReadPageJournal(BinaryReader reader)
{
var stream = reader.BaseStream;
var posStart = stream.Position * BasePage.PAGE_SIZE;
var posEnd = posStart + BasePage.PAGE_SIZE;
// Create page instance and read from disk (read page header + content page)
var page = new BasePage();
// read page header
page.ReadHeader(reader);
// Convert BasePage to correct Page Type
if (page.PageType == PageType.Header) page = page.CopyTo<HeaderPage>();
else if (page.PageType == PageType.Collection) page = page.CopyTo<CollectionPage>();
else if (page.PageType == PageType.Index) page = page.CopyTo<IndexPage>();
else if (page.PageType == PageType.Data) page = page.CopyTo<DataPage>();
else if (page.PageType == PageType.Extend) page = page.CopyTo<ExtendPage>();
// read page content if page is not empty
if (page.PageType != PageType.Empty)
{
// read page content
page.ReadContent(reader);
}
// read non-used bytes on page and position cursor to next page
reader.ReadBytes((int)(posEnd - stream.Position));
return page;
}
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:31,代码来源:RecoveryService.cs
示例6: butCierre_Click
protected void butCierre_Click(object sender, EventArgs e)
{
//elimina objeto sesión que contiene objeto USUARIO
BasePage oPaginaBase = new BasePage();
oPaginaBase.EliminarVariableSesion("oUsuario");
Response.Redirect("~/index.html");
}
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:9,代码来源:Site.Master.cs
示例7: EmptyPage
public EmptyPage(BasePage page)
: base(page.PageID)
{
if(page.DiskData.Length > 0)
{
this.DiskData = new byte[BasePage.PAGE_SIZE];
Buffer.BlockCopy(page.DiskData, 0, this.DiskData, 0, BasePage.PAGE_SIZE);
}
}
开发者ID:apkd,项目名称:LiteDB,代码行数:9,代码来源:EmptyPage.cs
示例8: EmptyPage
public EmptyPage(BasePage page)
: this(page.PageID)
{
// if page is not dirty but it´s changing to empty, lets copy disk content to add in journal
if (!page.IsDirty && page.DiskData.Length > 0)
{
this.DiskData = new byte[BasePage.PAGE_SIZE];
Buffer.BlockCopy(page.DiskData, 0, this.DiskData, 0, BasePage.PAGE_SIZE);
}
}
开发者ID:AshishVishwakarma,项目名称:LiteDB,代码行数:10,代码来源:EmptyPage.cs
示例9: AddPage
/// <summary>
/// Add a page to cache. if this page is in cache, override
/// </summary>
public void AddPage(BasePage page)
{
// do not cache extend page - never will be reused
if (page.PageType != PageType.Extend)
{
lock(_cache)
{
_cache[page.PageID] = page;
}
}
}
开发者ID:AshishVishwakarma,项目名称:LiteDB,代码行数:14,代码来源:CacheService.cs
示例10: ProcessRequest
public void ProcessRequest(HttpContext context)
{
string vlreturn = "", error = "";
BasePage basepage = new BasePage();
if (context.Request.Files.Count == 0)
{
vlreturn = "";
error = CCommon.Get_Definephrase(Definephrase.Invalid_file);
}
else
{
HttpPostedFile fileUpload = context.Request.Files[0];
string fileExtension = Path.GetExtension(fileUpload.FileName).ToLower();
if (extension_img.IndexOf(fileExtension) == -1)
{
vlreturn = "";
error = CCommon.Get_Definephrase(Definephrase.Invalid_filetype_image);
}
else
{
string uploadPath = context.Request.QueryString["up"];
uploadPath = CFunctions.IsNullOrEmpty(uploadPath) ? "../commup/upload/" : CFunctions.MBDecrypt(uploadPath);
string uploadPathDir = context.Server.MapPath(uploadPath);
DirectoryInfo pathInfo = new DirectoryInfo(uploadPathDir);
string fileName;
if (pathInfo.GetFiles(fileUpload.FileName).Length == 0)
{
fileName = Path.GetFileName(fileUpload.FileName);
}
else
{
fileName = this.Get_Filename() + fileExtension;
error = CCommon.Get_Definephrase(Definephrase.Notice_fileupload_duplicate);
}
if (CConstants.FILEUPLOAD_THUMBNAIL)
{
string uploadLocation_thumb = uploadPathDir + "\\thumb_" + fileName;
this.CreateThumbnail(fileUpload, uploadLocation_thumb, true);
}
string uploadLocation = uploadPathDir + "\\" + fileName;
fileUpload.SaveAs(uploadLocation);
vlreturn = uploadPath.Replace("../", "") + fileName;
error += CCommon.Get_Definephrase(Definephrase.Notice_fileupload_done);
}
}
context.Response.ContentType = "text/plain";
context.Response.Write("{\"name\":\"" + vlreturn + "\", \"error\":\"" + error + "\"}");
}
开发者ID:thienchi,项目名称:my-bfinance,代码行数:51,代码来源:FPUploadHandler.ashx.cs
示例11: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
Model.contents.article_category model = new BLL.channels.category().GetModel(this.category_id);
if (model != null)
{
string _name = model.call_index;
string _class_list = model.class_list;
string _key = BasePage.pageUrl(model.model_id);
string _where = "status=0 and category_id=" + this.category_id;
DataRowCollection list = new BasePage().get_article_list(_name, page, _where, out totalcount, out pagelist, _key, this.category_id, "__id__").Rows;
vh.Put("channel_id", category_id);
vh.Put("list", list);
vh.Put("page", pagelist);
vh.Display("../Template/newList.html");
}
}
开发者ID:eyren,项目名称:OScms,代码行数:19,代码来源:article_list.cs
示例12: CargaNombreUsuario
protected bool CargaNombreUsuario()
{
BasePage oPagina = new BasePage();
Usuarios objUsuario = (Usuarios)oPagina.LeerVariableSesion("oUsuario");
if (objUsuario != null)
lblUsuario.Text = "Bienvenido " + objUsuario.usrLogin.ToString();
else
{
return false;
//oPagina.MessageBox("El Usuario tiene que Iniciar una Sesion");
//String scriptMsj = "";
//scriptMsj = "window.location = '~/index.html'";
//ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MENSAJE", scriptMsj, true);
//Server.Transfer("~/index.html");
}
return true;
}
开发者ID:sestremadoyro,项目名称:Agrocomercio,代码行数:19,代码来源:Site.Master.cs
示例13: WritePageInJournal
/// <summary>
/// Write a page in sequence, not in absolute position
/// </summary>
private void WritePageInJournal(BinaryWriter writer, BasePage page)
{
// no need position cursor - journal writes in sequence
var stream = writer.BaseStream;
var posStart = stream.Position;
var posEnd = posStart + BasePage.PAGE_SIZE;
// Write page header
page.WriteHeader(writer);
// write content except for empty pages
if (page.PageType != PageType.Empty)
{
page.WriteContent(writer);
}
// write with zero non-used page
writer.Write(new byte[posEnd - stream.Position]);
}
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:22,代码来源:JournalService.cs
示例14: initParam
/// <summary>
/// 分页初始化参数
/// </summary>
/// <param name="page"></param>
public static void initParam(BasePage page)
{
try
{
HiddenField hfPageIndex = (HiddenField)page.FindControl("hfPageIndex");
HiddenField hfPageSize = (HiddenField)page.FindControl("hfPageSize");
if (!String.IsNullOrEmpty(hfPageIndex.Value))
{
page.pageIndex = Convert.ToInt32(hfPageIndex.Value);
}
if (!String.IsNullOrEmpty(hfPageSize.Value))
{
page.pageSize = Convert.ToInt32(hfPageSize.Value);
}
}
catch (Exception)
{
}
}
开发者ID:woailuoli993,项目名称:graduate_old,代码行数:24,代码来源:MyUtil.cs
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BasePage objBase = new BasePage();
DataSet ds = UserInfo.GetAllActiveLanguages();
DataRow dr = ds.Tables[0].Select("LanguageId =" + objBase.LanguageId)[0];
litLangauge.Text = Convert.ToString(dr["CountryName"]);
img.Src = "/images/" + Convert.ToString(dr["Flag"]);
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = "LanguageId <>" + objBase.LanguageId;
rptLanguage.DataSource = dv;
rptLanguage.DataBind();
}
}
开发者ID:AsmaBabarISL,项目名称:Epr_General,代码行数:20,代码来源:editionControl.ascx.cs
示例16: bnLogin_Click
protected void bnLogin_Click(object sender, EventArgs e)
{
//check and see if the login exists
BasePage bp = new BasePage();
//Clear any previous login Sessions
HttpContext.Current.Session["BPRDevLogin"] = null;
SqlParameter SqlUSERID = new SqlParameter("@USERID", SqlDbType.VarChar, 50, ParameterDirection.Input,
false, 0, 0, "USERID", DataRowVersion.Default, txtUser.Text);
SqlParameter SqlPASSWORD = new SqlParameter("@PASSWORD", SqlDbType.VarChar, 50, ParameterDirection.Input,
false, 0, 0, "PASSWORD", DataRowVersion.Default, txtPassword.Text);
DataSet dsTemp = _dataAccessHelper.Data.ExecuteDataset("SELECT * FROM LOGIN WHERE [email protected] AND [email protected]",
SqlUSERID, SqlPASSWORD);
if (dsTemp != null)
{
if (dsTemp.Tables[0].Rows.Count >= 1)
{
//SET Session Variable
HttpContext.Current.Session["BPRDevLogin"] = true;
HttpContext.Current.Session["BPRDevReferer"] = txtRefer.Text.ToString().Trim();
lblLoginError.Visible = false;
Response.Redirect("/default.aspx");
}
else
{
HttpContext.Current.Session["BPRDevLogin"] = false;
HttpContext.Current.Session["BPRDevReferer"] = "";
//Then return back to the login page with error
txtPassword.Text = "";
lblLoginError.Text = "Username or Password is incorrect.";
lblLoginError.Visible = true;
//log incorrect login attempt
//after 3 lock the account
}
}
}
开发者ID:SStewart-Ebsco,项目名称:TFS-Merge,代码行数:40,代码来源:login.aspx.cs
示例17: SetPageDirty
/// <summary>
/// Add a page as dirty page
/// </summary>
public void SetPageDirty(BasePage page)
{
lock(_cache)
{
// add page to dirty list
_dirty[page.PageID] = page;
// and remove from clean cache (keeps page in only one list)
_cache.Remove(page.PageID);
if (page.IsDirty) return;
page.IsDirty = true;
// if page is new (not exits on datafile), there is no journal for them
if (page.DiskData.Length > 0)
{
// call action passing dirty page - used for journal file writes
MarkAsDirtyAction(page);
}
}
}
开发者ID:AshishVishwakarma,项目名称:LiteDB,代码行数:25,代码来源:CacheService.cs
示例18: GetDatabaseContext
public static UserManagementDataContext GetDatabaseContext()
{
UserManagementDataContext result = null;
BasePage bp = new BasePage();
XElement context = bp.UserContext;
if (HttpContext.Current != null)
{
result = (UserManagementDataContext)HttpContext.Current.Items["UserManagementDataContext"];
}
if (result == null)
{
result = new UserManagementDataContext(context);
if (HttpContext.Current != null)
{
HttpContext.Current.Items["UserManagementDataContext"] = result;
}
}
return result;
}
开发者ID:jandppw,项目名称:ppwcode-recovered-from-google-code,代码行数:23,代码来源:BasePage.cs
示例19: user_message_add
private void user_message_add(HttpContext context)
{
//检查用户是否登录
Model.users model = new BasePage().GetUserInfo();
if (model == null)
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,用户没有登录或登录超时啦!\"}");
return;
}
string code = context.Request.Form["txtCode"];
string send_save = DTRequest.GetFormString("sendSave");
string user_name = DTRequest.GetFormString("txtUserName");
string title = DTRequest.GetFormString("txtTitle");
string content = DTRequest.GetFormString("txtContent");
//校检验证码
string result = verify_code(context, code);
if (result != "success")
{
context.Response.Write(result);
return;
}
//检查用户名
if (user_name == "" || !new BLL.users().Exists(user_name))
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,该用户名不存在或已经被删除啦!\"}");
return;
}
//检查标题
if (title == "")
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,请输入短消息标题!\"}");
return;
}
//检查内容
if (content == "")
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,请输入短消息内容!\"}");
return;
}
//保存数据
Model.user_message modelMessage = new Model.user_message();
modelMessage.type = 2;
modelMessage.post_user_name = model.user_name;
modelMessage.accept_user_name = user_name;
modelMessage.title = title;
modelMessage.content = Utils.ToHtml(content);
new BLL.user_message().Add(modelMessage);
if (send_save == "true") //保存到收件箱
{
modelMessage.type = 3;
new BLL.user_message().Add(modelMessage);
}
context.Response.Write("{\"msg\":1, \"msgbox\":\"发布短信息成功啦!\"}");
return;
}
开发者ID:qljiong,项目名称:LearnDTCMS,代码行数:55,代码来源:submit_ajax.ashx.cs
示例20: user_invite_code
private void user_invite_code(HttpContext context)
{
//检查用户是否登录
Model.users model = new BasePage().GetUserInfo();
if (model == null)
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,用户没有登录或登录超时啦!\"}");
return;
}
//检查是否开启邀请注册
if (userConfig.regstatus != 2)
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,系统不允许通过邀请注册!\"}");
return;
}
BLL.user_code codeBll = new BLL.user_code();
//检查申请是否超过限制
if (userConfig.invitecodenum > 0)
{
int result = codeBll.GetCount("user_name='" + model.user_name + "' and type='" + DTEnums.CodeEnum.Register.ToString() + "' and datediff(d,add_time,getdate())=0");
if (result >= userConfig.invitecodenum)
{
context.Response.Write("{\"msg\":0, \"msgbox\":\"对不起,您申请的邀请码数量已超过每天的限制!\"}");
return;
}
}
//删除过期的邀请码
codeBll.Delete("type='" + DTEnums.CodeEnum.Register.ToString() + "' and status=1 or datediff(d,eff_time,getdate())>0");
//随机取得邀请码
string str_code = Utils.GetCheckCode(8);
Model.user_code codeModel = new Model.user_code();
codeModel.user_id = model.id;
codeModel.user_name = model.user_name;
codeModel.type = DTEnums.CodeEnum.Register.ToString();
codeModel.str_code = str_code;
if (userConfig.invitecodeexpired > 0)
{
codeModel.eff_time = DateTime.Now.AddDays(userConfig.invitecodeexpired);
}
codeBll.Add(codeModel);
context.Response.Write("{\"msg\":1, \"msgbox\":\"恭喜您,申请邀请码已成功!\"}");
return;
}
开发者ID:qljiong,项目名称:LearnDTCMS,代码行数:43,代码来源:submit_ajax.ashx.cs
注:本文中的BasePage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论