private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby) { this.page = Globals.RequestQueryNum("page"); if (this.page == 0) { this.page = 1; } this.txtKeywords.Text = this.keywords; //图表或列表显示 BLL.article bll = new BLL.article(); DataSet ds = bll.GetWCodeList(this.wid, _channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; int cout = ds.Tables[0].Rows.Count; for (int i = 0; i < cout; i++) { dr = ds.Tables[0].Rows[i]; dr["link_url"] = SFUtils.getWebSite() + "/content.aspx?wid=" + SFUtils.ObjectToStr(dr["wid"]) + "&aid=" + dr["id"].ToString(); } ds.AcceptChanges(); } this.rptList1.DataSource = ds; this.rptList1.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = SFUtils.CombUrlTxt("article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__"); PageContent.InnerHtml = SFUtils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
/// <summary> /// ²éÕÒ²»´æÔÚµÄͼƬ²¢É¾³ýÒÑɾ³ýµÄͼƬ¼°Êý¾Ý /// </summary> public void DeleteList(SqlConnection conn, SqlTransaction trans, List <Model.article_albums> models, int article_id) { StringBuilder idList = new StringBuilder(); if (models != null) { foreach (Model.article_albums modelt in models) { if (modelt.id > 0) { idList.Append(modelt.id + ","); } } } string id_list = SFUtils.DelLastChar(idList.ToString(), ","); StringBuilder strSql = new StringBuilder(); strSql.Append("select id,thumb_path,original_path from " + databaseprefix + "article_albums where article_id=" + article_id); if (!string.IsNullOrEmpty(id_list)) { strSql.Append(" and id not in(" + id_list + ")"); } DataSet ds = DbHelperSQL.Query(conn, trans, strSql.ToString()); foreach (DataRow dr in ds.Tables[0].Rows) { int rows = DbHelperSQL.ExecuteSql(conn, trans, "delete from " + databaseprefix + "article_albums where id=" + dr["id"].ToString()); //ɾ³ýÊý¾Ý¿â if (rows > 0) { SFUtils.DeleteFile(dr["thumb_path"].ToString()); //ɾ³ýËõÂÔͼ SFUtils.DeleteFile(dr["original_path"].ToString()); //ɾ³ýÔͼ } } }
void Start() { #if UNITY_EDITOR var time1 = DateTime.Now; #endif GameObject btnJoinGO = SFUtils.findChildWithParent(gameObject, "btnJoin"); if (btnJoinGO != null) { m_btnJoin = btnJoinGO.GetComponent <Button>(); } GameObject lblInfoGO = SFUtils.findChildWithParent(gameObject, "lblInfo"); if (lblInfoGO != null) { m_lblInfo = lblInfoGO.GetComponent <Text>(); } m_presenter = new SFPlayPresenter() as ISFBasePresenter; m_presenter.initWithView(this); #if UNITY_EDITOR var time2 = DateTime.Now; var diff = time2.Subtract(time1); SFUtils.log(string.Format("View created: vwPlay, cost {0}ms", diff.TotalMilliseconds)); #else SFUtils.log("View created: vwPlay"); #endif }
void Start() { #if UNITY_EDITOR var time1 = DateTime.Now; #endif GameObject lblUidGO = SFUtils.findChildWithParent(gameObject, "lblUid"); if (lblUidGO != null) { m_lblUid = lblUidGO.GetComponent <Text>(); } GameObject btnLogoutGO = SFUtils.findChildWithParent(gameObject, "btnLogout"); if (btnLogoutGO != null) { m_btnLogout = btnLogoutGO.GetComponent <Button>(); } GameObject imgPosGO = SFUtils.findChildWithParent(gameObject, "imgPos"); if (imgPosGO != null) { m_imgPos = imgPosGO.GetComponent <Image>(); } m_presenter = new SFMainPresenter() as ISFBasePresenter; m_presenter.initWithView(this); #if UNITY_EDITOR var time2 = DateTime.Now; var diff = time2.Subtract(time1); SFUtils.log(string.Format("View created: vwMain, cost {0}ms", diff.TotalMilliseconds)); #else SFUtils.log("View created: vwMain"); #endif }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } this.channel_id = Globals.RequestQueryNum("channel_id"); this.category_id = Globals.RequestQueryNum("category_id"); this.keywords = Globals.RequestQueryStr("keywords"); this.property = Globals.RequestQueryStr("property"); if (channel_id == 0) { JscriptMsg("频道参数不正确!", "back", "Error"); return; } //this.channel_name = new BLL.channel().GetChannelName(this.channel_id); //取得频道名称 this.pageSize = GetPageSize(10); //每页数量 this.prolistview = SFUtils.GetCookie("wx_article_list_view"); //显示方式 if (!Page.IsPostBack) { ChkAdminLevel("articlemgr", DTEnums.ActionEnum.View.ToString()); //检查权限 TreeBind(this.channel_id); //绑定类别 RptBind(this.channel_id, this.category_id, "id>0" + CombSqlTxt(this.keywords, this.property), "sort_id asc,add_time desc,id desc"); } }
/// <summary> /// 根据登陆信息初始化自己以及场上的其他角色 /// </summary> public void initUnits() { m_runTime = SFBattleData.instance.enterBattle_initRunTime; SFUtils.log("初始化角色..."); // 自己 SFUnitConf heroConf = new SFUnitConf(); heroConf.uid = SFUserData.instance.uid; heroConf.posX = SFBattleData.instance.enterBattle_posX; heroConf.posY = SFBattleData.instance.enterBattle_posY; heroConf.rotation = SFBattleData.instance.enterBattle_rotation; heroConf.speedX = 0; heroConf.speedY = 0; heroConf.life = SFBattleData.instance.enterBattle_maxLife; heroConf.maxLife = SFBattleData.instance.enterBattle_maxLife; m_heroController.setHero(addUnit(heroConf)); // 其他角色 var users = SFBattleData.instance.enterBattle_remoteUsers; foreach (var item in users) { SFUnitConf conf = new SFUnitConf(); conf.uid = item.uid; conf.posX = item.posX; conf.posY = item.posY; conf.rotation = item.rotation; conf.speedX = item.speedX; conf.speedY = item.speedY; conf.life = item.life; conf.maxLife = item.maxLife; addUnit(conf); } SFUtils.log("初始化角色完成"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("articlemgr", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.article bll = new BLL.article(); Repeater rptList = new Repeater(); switch (this.prolistview) { case "Txt": rptList = this.rptList1; break; default: rptList = this.rptList2; break; } for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道内容排序"); //记录日志 JscriptMsg("保存排序成功啦!", SFUtils.CombUrlTxt("wx_article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}", this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success"); }
// Use this for initialization void Start() { if (unitContainer) { unitMgr = unitContainer.GetComponent <SFUnitManager>(); } SFBattleController.currentBattle = this; // 加载场景 SFUtils.log("mapId:{0}", SFBattleData.instance.enterBattle_mapId); string mapName = string.Format("map_{0}", SFBattleData.instance.enterBattle_mapId); var mapPrefab = Resources.Load("Prefabs/Maps/" + mapName) as GameObject; if (mapPrefab == null) { SFUtils.log("场景加载失败:Prefabs/Maps/" + mapName); } else { GameObject.Instantiate(mapPrefab, unitContainer.transform.parent); } // 加载HUD SFSceneManager.addView("vwHUD"); // 加载角色 if (unitMgr) { unitMgr.initUnits(); } // 网络断开 SFNetworkManager.instance.dispatcher.addEventListener(this, SFEvent.EVENT_NETWORK_INTERRUPTED, onNetworkInterrupted); }
private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby) { this.page = Globals.RequestQueryNum("page"); if (this.page == 0) { this.page = 1; } if (this.category_id > 0) { this.ddlCategoryId.SelectedValue = _category_id.ToString(); } this.ddlProperty.SelectedValue = this.property; this.txtKeywords.Text = this.keywords; //图表或列表显示 BLL.article bll = new BLL.article(); this.rptList2.DataSource = bll.GetWCodeList(this.wid, _channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList2.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = SFUtils.CombUrlTxt("photoHdp_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__"); PageContent.InnerHtml = SFUtils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void TreeBind(int _channel_id) { BLL.article_category bll = new BLL.article_category(); DataTable dt = bll.GetWCodeList(this.wid, 0, _channel_id); this.ddlCategoryId.Items.Clear(); this.ddlCategoryId.Items.Add(new ListItem("所有类别", "")); foreach (DataRow dr in dt.Rows) { string Id = dr["id"].ToString(); int ClassLayer = int.Parse(dr["class_layer"].ToString()); string Title = dr["title"].ToString().Trim(); if (ClassLayer == 1) { this.ddlCategoryId.Items.Add(new ListItem(Title, Id)); } else { Title = "├ " + Title; Title = SFUtils.StringOfChar(ClassLayer - 1, " ") + Title; this.ddlCategoryId.Items.Add(new ListItem(Title, Id)); } } }
/// <summary> /// 裁剪图片并保存 /// </summary> public bool cropSaveAs(string fileName, string newFileName, int maxWidth, int maxHeight, int cropWidth, int cropHeight, int X, int Y) { string fileExt = SFUtils.GetFileExt(fileName); //文件扩展名,不含“.” if (!IsImage(fileExt)) { return(false); } string newFileDir = SFUtils.GetMapPath(newFileName.Substring(0, newFileName.LastIndexOf(@"/") + 1)); //检查是否有该路径,没有则创建 if (!Directory.Exists(newFileDir)) { Directory.CreateDirectory(newFileDir); } try { string fileFullPath = SFUtils.GetMapPath(fileName); string toFileFullPath = SFUtils.GetMapPath(newFileName); return(Thumbnail.MakeThumbnailImage(fileFullPath, toFileFullPath, 180, 180, cropWidth, cropHeight, X, Y)); } catch { return(false); } }
void Start() { #if UNITY_EDITOR var time1 = DateTime.Now; #endif GameObject proLifeGO = SFUtils.findChildWithParent(gameObject, "proLife"); if (proLifeGO != null) { m_proLife = proLifeGO.GetComponent <SFProgressBar>(); } GameObject lblUserNameGO = SFUtils.findChildWithParent(gameObject, "lblUserName"); if (lblUserNameGO != null) { m_lblUserName = lblUserNameGO.GetComponent <Text>(); } m_presenter = new SFUnitStatusItemPresenter() as ISFBasePresenter; m_presenter.initWithView(this); #if UNITY_EDITOR var time2 = DateTime.Now; var diff = time2.Subtract(time1); SFUtils.log(string.Format("View created: vwUnitStatusItem, cost {0}ms", diff.TotalMilliseconds)); #else SFUtils.log("View created: vwUnitStatusItem"); #endif }
/// <summary> /// 查找不存在的图片并删除已删除的图片及数据 /// </summary> public void DeleteList(SqlConnection conn, SqlTransaction trans, List <Model.article_images_size> models, int category_id) { StringBuilder idList = new StringBuilder(); if (models != null) { foreach (Model.article_images_size modelt in models) { if (modelt.id > 0) { idList.Append(modelt.id + ","); } } } string id_list = SFUtils.DelLastChar(idList.ToString(), ","); StringBuilder strSql = new StringBuilder(); strSql.Append("select id,height,width,category_id from " + databaseprefix + "article_images_size where category_id=" + category_id); if (!string.IsNullOrEmpty(id_list)) { strSql.Append(" and id not in(" + id_list + ")"); } DataSet ds = DbHelperSQL.Query(conn, trans, strSql.ToString()); foreach (DataRow dr in ds.Tables[0].Rows) { DbHelperSQL.ExecuteSql(conn, trans, "delete from " + databaseprefix + "article_images_size where id=" + dr["id"].ToString()); //删除数据库 } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("manager_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; SF.BLL.manager bll = new SF.BLL.manager(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除商户" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", SFUtils.CombUrlTxt("business_list.aspx", "keywords={0}", this.keywords)); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; //成功数量 int errorCount = 0; //失败数量 BLL.article bll = new BLL.article(); Repeater rptList = new Repeater(); rptList = this.rptList1; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount++; } else { errorCount++; } } } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "单页内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", SFUtils.CombUrlTxt("article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}", this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success"); }
public List <Chenduo.Model.imgHistory> GetImgHistory(int productId) { List <Chenduo.Model.imgHistory> list = new List <Chenduo.Model.imgHistory>(); StringBuilder strSql = new StringBuilder(); strSql.Append("select * from imgHistory where goodsid=@ProductId"); SqlParameter[] parameters = { new SqlParameter("@ProductId", SqlDbType.Int, 4) }; parameters[0].Value = productId; DataTable dt = DbHelperSQL.Query(strSql.ToString(), parameters).Tables[0]; Chenduo.Model.imgHistory model = null; for (int n = 0; n < dt.Rows.Count; n++) { model = new Chenduo.Model.imgHistory(); if (dt.Rows[n]["goodsid"].ToString() != "") { model.goodsid = SFUtils.ObjToInt(dt.Rows[n]["goodsid"]); } model.url = dt.Rows[n]["url"].ToString() != "" ? SFUtils.getWebSite() + dt.Rows[n]["url"].ToString() : ""; list.Add(model); } return(list); }
private void ShowInfo(int _id) { BLL.article_comment bll = new BLL.article_comment(); model = bll.GetModel(_id); txtReContent.Text = SFUtils.ToTxt(model.reply_content); rblIsLock.SelectedValue = model.is_lock.ToString(); //this.channel_name = new BLL.channel().GetChannelName(model.channel_id); //取得频道名称 }
//删除更新的旧文件 public void DeleteFile(int id, string filePath) { Model.article_attach model = GetModel(id); if (model != null && model.file_path != filePath) { SFUtils.DeleteFile(model.file_path); } }
private bool DoAdd() { bool result = false; SF.BLL.sf_website bll = new SF.BLL.sf_website(); SF.Model.sf_website model = new SF.Model.sf_website(); ManagerInfo model1 = (ManagerInfo)Session[DTKeys.SESSION_ADMIN_INFO]; //model.businessNum = model1.businessNum; model.sitename = txtsitename.Text.Trim(); //model.appid_name = txtappid_name.Text.Trim(); //model.appid_origin_id = txtappid_origin_id.Text.Trim(); //model.weixin_account = txtweixin_account.Text.Trim(); //model.avatar = txtavatar.Text; //model.interface_url = txtinterface_url.Text.Trim(); //model.token_value = txttoken_value.Text.Trim(); //if (string.IsNullOrEmpty(model.token_value)) //{ // //model.token_value = this.CreateKey(8); //} //model.encodingaeskey = txtencodingaeskey.Text.Trim(); //model.appid = txtappid.Text.Trim().Trim(); //model.appsecret = txtappsecret.Text.Trim(); //model.payment_name = txtpayment_name.Text; ////model.state = cbstate.Checked ? 1 : 0; //model.weixin_pay_account = txtweixin_pay_account.Text.Trim(); //model.account_pay_key = txtaccount_pay_key.Text.Trim(); //model.send_type = int.Parse(rblsend_type.SelectedValue); //model.logo = txtlogo.Text; //model.description = txtdescription.Text; model.create_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); model.create_user = model1.realname; model.mid = model1.UserId; model.wid = "W" + SFUtils.GetCheckCode(4).ToString() + DateTime.Now.ToString("yyyyMMddHHmmss"); if (bll.Add(model) > 0) { //AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加公众服务号:" + model.appid_name); //记录日志 //1.拷贝默认模板 CopyTemplate(model.wid); //2.增加默认会员类别 MemberGradeInfo memberGrade = new MemberGradeInfo(); memberGrade.wid = model.wid; memberGrade.Name = "普通会员"; memberGrade.Description = "普通会员"; memberGrade.IsDefault = true; memberGrade.TranVol = 999999999.00; memberGrade.TranTimes = 999999999; //折扣 memberGrade.Discount = 100; result = MemberHelper.CreateMemberGrade(memberGrade); } return(result); }
// Use this for initialization void Awake() { var uiRootGO = GameObject.Find("UIRoot"); if (uiRootGO == null) { SFUtils.logWarning("当前场景没有找到UIRoot节点"); } uiRoot = uiRootGO; }
/// <summary> /// 删除附件文件 /// </summary> public void DeleteFile(List <Model.article_attach> models) { if (models != null) { foreach (Model.article_attach modelt in models) { SFUtils.DeleteFile(modelt.file_path); } } }
override protected void OnInit(EventArgs e) { base.OnInit(e); tPath = SFUtils.GetRootPath() + "/templates/common/detail/type1/news_show.html"; TemplateMgr template = new TemplateMgr(tPath, this.wid); template.tType = TemplateType.News; //template.openid = MyCommFun.RequestOpenid(); template.OutPutHtml("type1", this.wid); }
private static string GetDnsRealHost() { string host = HttpContext.Current.Request.Url.DnsSafeHost; string ts = string.Format(GetUrl("Key"), host, GetServerString("LOCAL_ADDR"), SFUtils.GetVersion()); if (!string.IsNullOrEmpty(host) && host != "localhost") { SFUtils.GetDomainStr("dt_cache_domain_info", ts); } return(host); }
/// <summary> /// ɾ³ýÏà²áͼƬ /// </summary> public void DeleteFile(List <Model.article_albums> models) { if (models != null) { foreach (Model.article_albums modelt in models) { SFUtils.DeleteFile(modelt.thumb_path); SFUtils.DeleteFile(modelt.original_path); } } }
/// <summary> /// 根据viewName获取prefab /// </summary> /// <returns>The view.</returns> /// <param name="viewName">View name.</param> static public GameObject getView(string viewName) { // TODO: 用Dictionary缓存已经加载过的View var prefab = Resources.Load("Prefabs/Views/" + viewName) as GameObject; if (prefab == null) { SFUtils.logWarning(string.Format("找不到view:{0}", viewName)); return(null); } return(prefab); }
void Start() { #if UNITY_EDITOR var time1 = DateTime.Now; #endif GameObject lblPingGO = SFUtils.findChildWithParent(gameObject, "lblPing"); if (lblPingGO != null) { m_lblPing = lblPingGO.GetComponent <Text>(); } GameObject btnMenuGO = SFUtils.findChildWithParent(gameObject, "btnMenu"); if (btnMenuGO != null) { m_btnMenu = btnMenuGO.GetComponent <Button>(); } GameObject scrLeftPlayersGO = SFUtils.findChildWithParent(gameObject, "scrLeftPlayers"); if (scrLeftPlayersGO != null) { m_scrLeftPlayers = scrLeftPlayersGO.GetComponent <ScrollRect>(); } GameObject lblTimeGO = SFUtils.findChildWithParent(gameObject, "lblTime"); if (lblTimeGO != null) { m_lblTime = lblTimeGO.GetComponent <Text>(); } GameObject scrSkillsGO = SFUtils.findChildWithParent(gameObject, "scrSkills"); if (scrSkillsGO != null) { m_scrSkills = scrSkillsGO.GetComponent <ScrollRect>(); } GameObject proLifeGO = SFUtils.findChildWithParent(gameObject, "proLife"); if (proLifeGO != null) { m_proLife = proLifeGO.GetComponent <SFProgressBar>(); } m_presenter = new SFHUDPresenter() as ISFBasePresenter; m_presenter.initWithView(this); #if UNITY_EDITOR var time2 = DateTime.Now; var diff = time2.Subtract(time1); SFUtils.log(string.Format("View created: vwHUD, cost {0}ms", diff.TotalMilliseconds)); #else SFUtils.log("View created: vwHUD"); #endif }
/// <summary> /// 创建 /// </summary> /// <param name="FileName">原始图片路径</param> public bool SetImage(string FileName) { srcFileName = SFUtils.GetMapPath(FileName); try { srcImage = Image.FromFile(srcFileName); } catch { return(false); } return(true); }
//设置分页数量 protected void txtPageNum_TextChanged(object sender, EventArgs e) { int _pagesize; if (int.TryParse(txtPageNum.Text.Trim(), out _pagesize)) { if (_pagesize > 0) { SFUtils.WriteCookie("manager_page_size", "DTcmsPage", _pagesize.ToString(), 14400); } } Response.Redirect(SFUtils.CombUrlTxt("business_list.aspx", "keywords={0}", this.keywords)); }
private int GetPageSize(int _default_size) { int _pagesize; if (int.TryParse(SFUtils.GetCookie("manager_page_size", "DTcmsPage"), out _pagesize)) { if (_pagesize > 0) { return(_pagesize); } } return(_default_size); }
private int GetPageSize(int _default_size) { int _pagesize; if (int.TryParse(SFUtils.GetCookie("wx_article_page_size"), out _pagesize)) { if (_pagesize > 0) { return(_pagesize); } } return(_default_size); }