public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); List <KeyValuePair <AreaStatus?, string> > statusList = EnumConverter.GetKeyValuePairs <AreaStatus>(); statusList.Insert(0, new KeyValuePair <AreaStatus?, string>(null, ResCommonEnum.Enum_Select)); lisStatus.ItemsSource = statusList; List <KeyValuePair <AreaIsLocal?, string> > isLocalList = EnumConverter.GetKeyValuePairs <AreaIsLocal>(); isLocalList.Insert(0, new KeyValuePair <AreaIsLocal?, string>(null, ResCommonEnum.Enum_Select)); lisIsLocal.ItemsSource = isLocalList; _areaInfoViewModel = new AreaInfoVM(); Area_Feild.DataContext = _areaInfoViewModel; _areaFace = new AreaFacade(this); if (this.Request.QueryString.ContainsKey("operation")) { _op = this.Request.QueryString["operation"]; } if (this.Request.QueryString.ContainsKey("sysno")) { _sysNo = int.Parse(this.Request.QueryString["sysno"]); _areaFace.Load(_sysNo, (s, args) => { _areaInfoViewModel = args.Result; Area_Feild.DataContext = _areaInfoViewModel; }); } InitControl(_sysNo); }
public Stream GetArea() { string json = Core.Services.RestPublisher.Serialize(AreaFacade.LoadArea()); WebOperationContext.Current.OutgoingResponse.ContentType = "application/json; charset=utf-8"; MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json)); return(ms); }
public Stream GetSlcAreabyRayon(Core.Model.mdlRayon param) { string json = Core.Services.RestPublisher.Serialize(AreaFacade.LoadAreabyRayon(param.UserID, param.RayonID)); WebOperationContext.Current.OutgoingResponse.ContentType = "application/json; charset=utf-8"; MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json)); return(ms); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); List <KeyValuePair <AreaStatus?, string> > statusList = EnumConverter.GetKeyValuePairs <AreaStatus>(); statusList.Insert(0, new KeyValuePair <AreaStatus?, string>(null, ResCommonEnum.Enum_All)); lisStatus.ItemsSource = statusList; lisStatus.SelectedIndex = 0; GridQueryFilter.DataContext = _filterVM; _facade = new AreaFacade(this); }
public ActionResult Create() { try { var model = new AreaViewModel(); model.SubAreaSearchFilter = new SubAreaSearchFilter { PageNo = 1, PageSize = 15, SortField = "SubAreaName", SortOrder = "ASC" }; model.SelectSearchFilter = new SelectSubAreaSearchFilter { PageNo = 1, PageSize = 15, SortField = "SubAreaName", SortOrder = "ASC" }; using (var facade = new AreaFacade()) { model.AreaCode = facade.GetNextAreaCode().ToString(); } ViewBag.PageSize = model.SubAreaSearchFilter.PageSize; ViewBag.Message = string.Empty; ViewBag.CreateUsername = UserInfo.FullName; ViewBag.UpdateUsername = UserInfo.FullName; ViewBag.CreateDate = DateTime.Now; ViewBag.UpdateDate = DateTime.Now; return(View(model)); } catch (Exception ex) { Logger.Error("Exception occur:\n", ex); Logger.Info(_logMsg.Clear().SetPrefixMsg("List SubArea").Add("Error Message", ex.Message).ToFailLogString()); return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString()))); } }
public void TestAddArea_正确添加区域() { string id = "c2ecf0ef-dc5b-4308-9f38-037453d53919"; #region 验证前置条件 MSSql2005Query query = new MSSql2005Query(); string sqlQuery = query.GenerateSelectViewSql(typeof(AreaInfo)); sqlQuery += string.Format("WHERE [Id] = N'{0}'", id); using (DbOperator dbOperator = new DbOperator(connString)) { DataTable dt = dbOperator.GetTable(sqlQuery); Assert.AreEqual(0, dt.Rows.Count); } #endregion AreaFacade facade = new AreaFacade(); string idNew = facade.AddArea(id, "401331", AreaType.Province, "重庆市", "", "401331"); #region 验证后置条件 Assert.AreEqual("c2ecf0ef-dc5b-4308-9f38-037453d53919", idNew, true); using (DbOperator dbOperator = new DbOperator(connString)) { DataTable dt = dbOperator.GetTable(sqlQuery); Assert.AreEqual(1, dt.Rows.Count); Assert.AreEqual("c2ecf0ef-dc5b-4308-9f38-037453d53919", dt.Rows[0]["Id"].ToString(), true); Assert.AreEqual("401331", dt.Rows[0]["AreaId"].ToString(), true); Assert.AreEqual("2", dt.Rows[0]["AreaType"].ToString(), true); Assert.AreEqual("重庆市", dt.Rows[0]["AreaName"].ToString(), true); Assert.AreEqual("", dt.Rows[0]["ParentId"].ToString(), true); Assert.AreEqual("401331", dt.Rows[0]["Zip"].ToString(), true); } #endregion }
public Core.Model.mdlResultSvc UploadArea(Core.Model.mdlArea AreaPrm) { return(AreaFacade.UploadArea(AreaPrm)); }
public Core.Model.mdlResultSvc DeleteArea(Core.Model.mdlArea param) { return(AreaFacade.DeleteArea(param.AreaID)); }
public AreaController(DBContext context) { this.context = context; this.areaFacade = new AreaFacade(context); }