public string Add() { string name = Request["Name"]; string showOrder = Request["ShowOrder"]; string pid = Request["Pid"]; string isMenu = Request["IsMenu"]; string menuUrl = Request["menuUrl"]; string FuncIconUrl = Request["FuncIconUrl"]; var model = new SysFunc(); model.Id = Guid.NewGuid(); model.Name = name; model.IsMenu = isMenu == "true"; model.MenuUrl = menuUrl; model.FuncIconUrl = FuncIconUrl; model.ShowOrder = showOrder; model.CreateId = CurrentUser.UserId; model.CreateName = CurrentUser.UserName; model.CreateTime = System.DateTime.Now; model.ParentId = new Guid(pid); model.IsValid = true; try { unitOfWork.SysFuncBLL.InsertEntity(model); unitOfWork.Save(); return ""; } catch (Exception ex) { Log.Error("保存功能信息异常:" + ex.Message, ex); return "系统异常,请联系管理员!"; } }
protected void Button_search_Click(object sender, EventArgs e) { this.U_landdata1.Visible = false; IList <LanData> lanlist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (Session["Type"].ToString() == "0") // 超级权限 { lanlist = uf.GetLandataList(this.TextBox_key.Text); //lanlist = uf.GetLandataList(); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(this.TextBox_key.Text, areas[i].ID); for (int j = 0; j < tmp.Count; j++) { lanlist.Add(tmp[j]); } } } else { lanlist = uf.GetLandataList(this.TextBox_key.Text, short.Parse(Session["Areaid"].ToString())); } } bindlist(lanlist); }
public ActionResult GetRemindinfo() { //查看权限 //判断用户是否有“报警处理”的权限 IList <SysFunc> FuncList = this.service.User.GetUserFuncs(AuthorizationService.CurrentUserID); SysFunc sf = FuncList.Where(p => p.ID == "410301").FirstOrDefault(); if (sf != null) //有权限 { } else { return(OperateResult(true, "查询超额警告成功", null)); } Remindinfo[] objs; objs = this.service.Remindinfo.GetRemindinfo(); //没有查到 if (objs == null || objs.Length == 0) { return(OperateResult(true, "查询超额警告成功", null)); } System.Text.StringBuilder bu = new System.Text.StringBuilder(); bu.Append(string.Format("任务单:{0} 调度编号:{1} <br> 工程名:{2} 有如下警告: ", objs[0].TaskID, objs[0].DispatchID, objs[0].ProjectName)); foreach (Remindinfo obj in objs) { bu.Append(string.Format("<br>第{2}盘中 {0}超额比率{1}% ", obj.StuffName, obj.ErrorValue, obj.PotTimes)); } string[] _strs = new string[] { objs[0].DispatchID, bu.ToString() }; return(OperateResult(true, "查询超额警告成功", _strs)); }
public FrmView(string filter) { InitializeComponent(); SmLib.SysFunc.LoadIcon(this); dsHdm = StartUp.GetHdb(filter); GrdBrowse.DataSource = dsHdm.Tables[0].DefaultView; GrdBrowseCt.DataSource = dsHdm.Tables[1].DefaultView; //PH FieldLayout GrdLayoutPH = SysFunc.CreateFieldLayout(StartUp.SysObj, GrdBrowse, StartUp.stringBrowse3, dsHdm.Tables[0]); GrdBrowse.FieldLayouts.Add(GrdLayoutPH); SysFunc.CreateSumFieldList(StartUp.SysObj, GrdBrowse, StartUp.stringBrowse3); //CT FieldLayout GrdLayoutCT = SysFunc.CreateFieldLayout(StartUp.SysObj, GrdBrowseCt, StartUp.stringBrowse4, dsHdm.Tables[1]); GrdBrowseCt.FieldLayouts.Add(GrdLayoutCT); SysFunc.CreateSumFieldList(StartUp.SysObj, GrdBrowseCt, StartUp.stringBrowse4); this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { if (GrdBrowse.Records.Count > 0) { GrdBrowse.ActiveRecord = GrdBrowse.Records[0]; } })); }
public SymbolTableRec(SysFunc function) { Name = function.Name; Type = function.Type; Designation = SymbolTableRecDesig.FUNCTION; Function = function; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SysFunc sf = new SysFunc(); IList <Area> list = new List <Area>(); if (Session["Type"].ToString() == "0")//my.Type == 0) { list = sf.GetAreaList(false); } else { Area area = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (area.Type == true) { list = sf.GetAreaList(area.Cid, false); } else { list.Add(area); } } bind(list); } }
protected override void OnElementChanged(ElementChangedEventArgs <Entry> e) { base.OnElementChanged(e); if (e.NewElement != null) { Control.Background = DrawableSimpleExt.FromResource(R.Drawable.Empty); //Control.Background = DrawableSimpleExt.FromResource(R.Drawable.editText_back); Control.SetPadding(0, 0, 0, 0); //Control.SetCursorVisible(true); // Control.BorderStyle = UITextBorderStyle.None; UpdateEtcOption(); if (ElementEx.BecomeFirstResponderAction > 0) { SysFunc.RequestMainThread(async() => { await Task.Yield(); RunBecomeFirstResponder(); }); } //!!!!!RemoveOnKeyboardBackPressedEvent(); UpdateVerticalTextAlignment(); // AddToolbarHide(); // //AddToolbarHide2(); } }
public void Execute(SysFuncCommand command) { if (command.SysType == SysType.AddChild) { SysFunc sysFunc = new SysFunc(IdWorker.NextId()); sysFunc.Mapp(command); sysFunc.Pid = command.Id; _sysFuncRepository.Add(sysFunc); command.Result.Status = true; } else if (command.SysType == SysType.AddFlatLevel) { SysFunc sysFunc = new SysFunc(IdWorker.NextId()); sysFunc.Mapp(command); _sysFuncRepository.Add(sysFunc); command.Result.Status = true; } else if (command.SysType == SysType.Remove) { var rlt = _sysFuncRepository.Remove(command.Id); if (!rlt.success) { command.Result.Status = false; command.Result.Msg = rlt.msg; } command.Result.Status = true; } else if (command.SysType == SysType.Update) { SysFunc sysFunc = new SysFunc(); sysFunc.Mapp(command); _sysFuncRepository.SaveChange(sysFunc); command.Result.Status = true; } }
public bool SaveChange(SysFunc entity) { var func = new sys_func(); func.Mapp(entity); return(_baseQueryRepository.Context.Updateable(func).Where(r => r.ID == entity.ID).ExecuteCommand() > 0); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (this.DropDownList1.SelectedValue == "1") { SysFunc sf = new SysFunc(); Area marea = sf.GetArea(short.Parse(Session["Areaid"].ToString())); ReportData rd = new ReportData(); this.GridView1.DataSource = rd.Show_Report_1(marea); this.GridView1.DataBind(); } else if (this.DropDownList1.SelectedValue == "2") { ReportData rd = new ReportData(); this.GridView1.DataSource = rd.Show_Report_2(0); this.GridView1.DataBind(); } else if (this.DropDownList1.SelectedValue == "3") { ReportData rd = new ReportData(); this.GridView1.DataSource = rd.Show_Report_3(0); this.GridView1.DataBind(); } else { this.GridView1.DataSource = null; this.GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Areaid"] == null || Session["Type"].ToString() == null) { Response.Write("<script language='javascript'>alert('请重新登录.'); location.href='Default.aspx'</script>"); } else { IList <Area> list = new List <Area>(); SysFunc sf = new SysFunc(); if (Session["Type"].ToString() == "0") { list = sf.GetAreaList(); } else { Area area = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (area.Type == true) { list = sf.GetAreaList(area.Cid); } else { list.Add(area); } } bind(list); } }
protected void show_firehouse(object sender, CommandEventArgs e) { this.U_firehouse1.Visible = false; this.U_updateFirehouse1.Visible = true; SysFunc sf = new SysFunc(); this.U_updateFirehouse1.firehouse = sf.GetFireHouse(short.Parse(e.CommandName.ToString())); }
public ActionResult DeleteConfirmed(string id) { SysFunc sysFunc = db.SysFunc.Find(id); db.SysFunc.Remove(sysFunc); db.SaveChanges(); return(RedirectToAction("Index")); }
public (bool success, string msg) Add(SysFunc sysFunc) { var func = new sys_func(); func.Mapp(sysFunc); var success = _baseQueryRepository.Context.Insertable(func).ExecuteCommand() > 0; return(success, success ? null : "添加失败!"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SysFunc sf = new SysFunc(); bindtype(sf.GetEquipType()); bindstatus(sf.GetEquipStatus()); } }
public ActionResult Edit([Bind(Include = "SysFuncID,FuncName,FuncDesc,ParentID,IsLeaf,IsButton,URL,IsDisabled,HandlerName,OrderNum")] SysFunc sysFunc) { if (ModelState.IsValid) { db.Entry(sysFunc).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sysFunc)); }
//ExUserFunction eu = new ExUserFunction(); protected void Page_Load(object sender, EventArgs e) { if (Session["Areaid"] == null || Session["LinkId"] == null || Session["Type"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } else { short type = short.Parse(Session["Type"].ToString()); if (type != 0 && type != 3 && type != 1 && type != 6) { Response.Write("<script language='javascript'>alert('该账号无此操作权限.'); location.href='HomePage.aspx'</script>"); return; } if (!IsPostBack) { this.U_landdata1.Visible = false; IList <LanData> lanlist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["Areaid"].ToString())); int linkid = int.Parse(Session["LinkId"].ToString()); if (type == 0) // 超级权限 { lanlist = uf.GetLandataList(); } else if (type == 6) { lanlist.Add(uf.GetLandata(short.Parse(Session["LinkId"].ToString()))); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { lanlist.Add(tmp[j]); } } } else { lanlist = uf.GetLandataList(currentarea.ID); } } bindlist(lanlist); } //this.Button_back.Attributes["onclick"] = "javascript:location.href='HomePage.aspx'"; //this.ImageButton_submit.Attributes["onclick"] = "javascript:return confirm('确认提交?提交后无法更改');"; } }
/// <summary> /// 重写OnAuthorization /// </summary> /// <param name="filterContext"></param> public override void OnAuthorization(AuthorizationContext filterContext) { //移动版不验证 if (filterContext.RouteData.DataTokens["area"] != null && filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "mobile") { return; } string controller = filterContext.RouteData.Values["controller"].ToString().ToLower(); string action = filterContext.RouteData.Values["action"].ToString().ToLower(); //登录 if (isAllowAnyone(controller, action)) { return; } if (!filterContext.RequestContext.HttpContext.User.Identity.IsAuthenticated) { RedirectToLogin(filterContext); return; } if (isRequiredLogin(controller, action)) { return; } string requestUrl = filterContext.HttpContext.Request.Url.AbsolutePath.ToLower(); requestUrl = Regex.Replace(requestUrl, @"(&|\?)f=\d+", "", RegexOptions.IgnoreCase); using (PublicService ps = new PublicService()) { IList <SysFunc> userFuncs = ps.User.GetUserFuncs(AuthorizationService.CurrentUserID); if (userFuncs == null || userFuncs.Count == 0) { RedirectToUnauthorized(filterContext); } else { //SysFunc func1 = userFuncs.Where(p => p.ID == "0103").FirstOrDefault(); SysFunc func = userFuncs.Where( p => !string.IsNullOrEmpty(p.URL) && p.LowerUrls.Where(u => u.StartsWith(requestUrl)).Count() > 0) .FirstOrDefault(); if (func == null) { RedirectToUnauthorized(filterContext); } } } }
// GET: SysFunc/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SysFunc sysFunc = db.SysFunc.Find(id); if (sysFunc == null) { return(HttpNotFound()); } return(View(sysFunc)); }
public ArgumentError(SysFunc func) : base(func, "valid arguments: ") { ErrorMessage += "["; for (int i = 0; i < func.ValidArguments.Count; i++) { ErrorMessage += func.ValidArguments[i].ToString(); if (i < func.ValidArguments.Count - 1) { ErrorMessage += ','; } } ErrorMessage += "]"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SysFunc sf = new SysFunc(); bindcate(sf.GetLanCate()); bindtype(sf.GetLanType()); bindmaintenance(sf.GetMaintenance()); bindproperty(sf.GetProperty()); //EpControl ec = new EpControl(); //this.DropDownList_state.SelectedValue = ec.gethost(landata.ID).STATE.ToString(); } this.Label_fix_tip.Text = ""; }
public JsonResult SaveFunc() { var data = Request.GetArrayList("data"); String siteID = Request["SiteID"].ToString(); String sysMenuID = Request.GetString("SysMenuID"); var sysFuncDal = flexibleContext.GetService <SysFuncDal>(); for (int i = 0, l = data.Count; i < l; i++) { Hashtable o = (Hashtable)data[i]; String id = o.GetString("ID"); //根据记录状态,进行不同的增加、删除、修改操作 String state = o.GetString("_state"); String funcName = o["FuncName"].ToString(); String funcDescribe = o.GetString("FuncDescribe"); decimal sortNo = Convert.ToDecimal(o["SortNo"]); if (state == "added" || id == "") //新增:id为空,或_state为added { SysFunc model = new SysFunc(); model.ID = "{" + Guid.NewGuid() + "}"; model.WebSiteID = siteID; model.SysMenuID = sysMenuID; model.FuncName = funcName; model.FuncDescribe = funcDescribe; model.SortNo = sortNo; sysFuncDal.Insert(model); } else if (state == "removed" || state == "deleted") { sysFuncDal.Delete(id); } else if (state == "modified" || state == "") //更新:_state为空或modified { var model = sysFuncDal.GetModel(id); model.WebSiteID = siteID; model.SysMenuID = sysMenuID; model.FuncName = funcName; model.FuncDescribe = funcDescribe; model.SortNo = sortNo; sysFuncDal.Update(model, x => x.ID); } } var result = new { }; return(Json(result)); }
/// <summary> /// //根据模块ID查找模块的URL、PID以便页面跳转 /// </summary> /// <param name="BelongFuncID">模块ID</param> /// <param name="Url">输出变量</param> /// <param name="Pid">输出变量</param> public void getUrlAndPid(string BelongFuncID, out string Url, out string Pid) { SysFunc sf = this.m_UnitOfWork.GetRepositoryBase <SysFunc>().Get(BelongFuncID); Url = sf.Urls.FirstOrDefault(); if (Url.IndexOf("?") > 0) { Url += "&f=" + BelongFuncID; } else { Url += "?f=" + BelongFuncID; } Pid = sf.ParentID; }
public override void OnAuthorization(AuthorizationContext filterContext) { string controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; string actionName = filterContext.ActionDescriptor.ActionName; //登录 if (controllerName == "Authentication") { return; } //登录 if (!filterContext.RequestContext.HttpContext.User.Identity.IsAuthenticated) { RedirectToLogin(filterContext); return; } string requestUrl = filterContext.HttpContext.Request.Url.AbsolutePath.ToLower(); requestUrl = Regex.Replace(requestUrl, @"(&|\?)f=\d+", "", RegexOptions.IgnoreCase); //确定当前用户是否属于指定角色 string query = @"select * from SysFunc where SysFuncID in (select SysFuncID from SysPower where SysRoleID in (select ID from SysRole where ID in (select SysRoleID from SysUserRole where UserName='******')))"; string currentUser = filterContext.HttpContext.User.Identity.Name; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@userName", currentUser) }; IList <SysFunc> userFuncs = db.Database.SqlQuery <SysFunc>(query, paras).ToList(); if (userFuncs == null || userFuncs.Count == 0) { RedirectToUnauthorized(filterContext); } else { SysFunc func = userFuncs.Where( p => !string.IsNullOrEmpty(p.URL) && p.LowerUrls.Where(u => u.StartsWith(requestUrl)).Count() > 0) .FirstOrDefault(); if (func == null) { RedirectToUnauthorized(filterContext); } } }
public JsonResult GetRemaincubeByCarId(string carId) { //ShippingDocument doc = this.service.ShippingDocument.Query() // .Where(p => p.CarID == carId && p.IsEffective) // .OrderByDescending(p => p.BuildTime) // .FirstOrDefault(); //if (doc != null) //{ //判断该车是否有未处理的转退料(自动过磅才用到) TZRalation objchk = this.service.TZRalation.Query() .Where(p => p.CarID == carId && p.IsCompleted == false).OrderByDescending(p => p.BuildTime) .FirstOrDefault(); if (objchk != null) { if (string.IsNullOrEmpty(objchk.ActionType)) { //判断用户是否有“转退料方式处理”的权限 IList <SysFunc> FuncList = this.service.User.GetUserFuncs(AuthorizationService.CurrentUserID); SysFunc sf = FuncList.Where(p => p.ID == "410505").FirstOrDefault(); if (sf != null) //有权限 { return(OperateResult(false, "", objchk)); } else { return(OperateResult(false, "", null)); } } } TZRalation obj = this.service.TZRalation.Query() .Where(p => p.CarID == carId && p.IsCompleted == false && p.ActionType == "AT1").FirstOrDefault(); if (obj == null) { return(OperateResult(false, "", 0)); } else { return(OperateResult(true, "本车有转退料记录,方量为:" + obj.Cube.ToString(), obj.Cube)); } //} //else //{ // return OperateResult(false, "", 0); //} }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SysFunc esf = new SysFunc(); this.DropDownList_type.SelectedValue = "1"; this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetFireManageList(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } }
private IList <LanData> get_my_lanlist() { IList <LanData> landatalist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["curAreaid"].ToString())); short type = short.Parse(Session["Type"].ToString()); if (type == 0) // 超级权限 { landatalist = uf.GetLandataList(); } else if (type == 6) { landatalist.Add(uf.GetLandata(short.Parse(Session["LinkId"].ToString()))); } else if (type == 5) { landatalist = uf.GetLandataListPt(short.Parse(Session["LinkId"].ToString())); } else if (type == 4) { landatalist = uf.GetLandataListMt(short.Parse(Session["LinkId"].ToString())); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } //landatalist = eu.getLandatalist_by_areaid(short.Parse(Session["Areaid"].ToString())); } else { landatalist = uf.GetLandataList(currentarea.ID); } } return(landatalist); }
public Expression InvertOn(Expression other) { //When right is 2, the invert is sqrt. x^2 -> sqrt[other], -sqrt[other] if (Right.CompareTo(Constant.Two)) { var args = new List(); args.Items.Add(other); var answer1 = SysFunc.MakeFunction(args, new Scope(), "sqrt"); var answer2 = new Minus(); answer2.Child = answer1; var answers = new List(); answers.Items.Add(answer1); answers.Items.Add(answer2); return(answers); } //Couln't InvertOn. return(null); }
public override ActionResult Find(JqGridRequest request, string condition) { //有审核按钮的是领导都可以看见 //没有审核按钮权限的只能看到自己的 IList <SysFunc> FuncList = this.service.User.GetUserFuncs(AuthorizationService.CurrentUserID); SysFunc sf = FuncList.Where(p => p.ID == "232005" || p.ID == "232006").FirstOrDefault(); if (sf != null) { //有权限 } else { if (!string.IsNullOrEmpty(condition)) { condition = " AND "; } condition += " PurchasePlan_claimer='" + AuthorizationService.CurrentUserID + "'"; } //return base.Find(request, condition); ActionResult r = base.Find(request, condition); GoodsInfo g = null; foreach (PurchasePlan p in ((ZLERP.Model.JqGridData <PurchasePlan>)((JsonResult)r).Data).rows) { if (string.IsNullOrEmpty(p.GoodsID)) { continue; } g = this.service.GoodsInfo.Get(p.GoodsID); if (g != null) { p.GoodsNum = g.ContentNum; } } return(r); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Type"] == null || Session["Areaid"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } if (!IsPostBack) { IList <Area> list = new List <Area>(); SysFunc sf = new SysFunc(); if (Session["Type"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } else if (Session["Type"].ToString() == "0") { list = sf.GetAreaList(); } else { Area area = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (area.Type == true) { list = sf.GetAreaList(area.Cid); } else { list.Add(area); } } bind(list); if (Session["curAreaid"] != null) { this.DropDownList_area.SelectedValue = Session["curAreaid"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SysFunc sf = new SysFunc(); IList <Area> list = new List <Area>(); if (Session["Type"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } else if (Session["Type"].ToString() == "0")//my.Type == 0) { list = sf.GetAreaList(false); } else { if (Session["Areaid"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } Area area = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (area.Type == true) { list = sf.GetAreaList(area.Cid, false); } else { list.Add(area); } } bind(list); bindcate(sf.GetLanCate()); bindtype(sf.GetLanType()); bindmaintenance(sf.GetMaintenance()); bindproperty(sf.GetProperty()); } }