public ActionResult GetHistory(TableHistory th) { List<TableHistoryCustom> list = new List<TableHistoryCustom>(); IsoDateTimeConverter iso = new IsoDateTimeConverter() { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }; try { int total = 0; var Start = int.Parse(Request.Form["start"] ?? "0"); if (Request["limit"] != null) { var Limit = Convert.ToInt32(Request["limit"]); } _tableHistoryMgr = new TableHistoryMgr(connectionString); list = _tableHistoryMgr.GetHistoryByCondition(th, out total); return Content("{succes:true,totalCount:" + total + ",item:" + JsonConvert.SerializeObject(list, Formatting.None, iso) + "}"); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return new EmptyResult(); } }
public HttpResponseBase LoadCondition() { string json = string.Empty; List<EdmListConditoinSubQuery> store = new List<EdmListConditoinSubQuery>(); EdmListConditoinSubQuery query = new EdmListConditoinSubQuery(); _edmlistsubMgr = new EdmListConditoinSubMgr(sqlConnectionString); try { if (!string.IsNullOrEmpty(Request.Params["conditionName"])) { query.elcm_name = Request.Params["conditionName"]; } store = _edmlistsubMgr.LoadCondition(query); if (store != null) { IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd"; json = "{success:true" + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}"; } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase GetCertificateCategory() { string json = string.Empty; int totalCount = 0; List<CertificateCategoryQuery> stores = new List<CertificateCategoryQuery>(); CertificateCategoryQuery query = new CertificateCategoryQuery(); try { if (!string.IsNullOrEmpty(Request.Params["searchcontent"])) { query.searchcon = Request.Params["searchcontent"].ToString().Trim(); } _inspectionReport = new InspectionReportMgr(mySqlConnectionString); stores = _inspectionReport.GetCertificateCategoryList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Newtonsoft.Json.Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase QueryLogIn() { string jsonStr = string.Empty; LogInLogeQuery logInLogeQuery = new LogInLogeQuery(); try { logInLogeQuery.Start = Convert.ToInt32(Request.Form["start"] ?? "0"); logInLogeQuery.Limit = Convert.ToInt32(Request.Form["limit"] ?? "20"); logInLogeMgr = new LogInLogeMgr(connectionString); int totalCount; List<LogInLogeQuery> querys = logInLogeMgr.QueryList(logInLogeQuery,out totalCount); jsonStr = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(querys) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); jsonStr = "[]"; } this.Response.Clear(); this.Response.Write(jsonStr); this.Response.End(); return this.Response; }
public HttpResponseBase GetConditionList() { string json = string.Empty; List<EdmListConditionMain> store = new List<EdmListConditionMain>(); EdmListConditionMain item = new EdmListConditionMain(); _edmlistmainMgr = new EdmListConditionMainMgr(sqlConnectionString); try { store = _edmlistmainMgr.GetConditionList(); item.elcm_id = 0; item.elcm_name = "無"; //store.Add(item); store.Insert(0, item); // store.Insert(0, json = "{success:true" + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
/// <summary> /// 驗證用戶輸入的密碼,返回Json /// </summary> /// <returns>Super密碼驗證</returns> public HttpResponseBase ConfirmSuperPwd() { string json = string.Empty; try { if (Request.Params["superPwd"] == DateTime.Now.ToString("yyyyMMdd")) { json = "{success:true}"; } else { json = "{success:false}"; } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return Response; }
public ActionResult GetFileName() { try { ///獲得要搜索的文件名 string xmlName = Request["fileName"]; ///獲取查找路徑 string path = Server.MapPath(parentPath); ///獲得xml文件名 List<XmlModelCustom> list = _xmlInfo.GetXmlName(path); ///如果存在搜索條件 if (xmlName!=null && xmlName!="") { /// 查詢符合條件的集合 List<XmlModelCustom> resultList = list.FindAll(m => m.fileName.Contains(xmlName)); return Json(new { item = resultList }); } return Json(new { item = list}); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return new EmptyResult(); } }
public HttpResponseBase QueryProductItemMap() { try { ProductItemMapQuery query = new ProductItemMapQuery(); if (!string.IsNullOrEmpty(Request.Form["condition"])) { query.condition = (ProductItemMapQuery.conditionNo)Int32.Parse(Request.Form["condition"]); } query.content = Request.Form["value"]; query.Start = Convert.ToInt32(Request.Form["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Form["limit"] ?? "20"); _ProductItemMapMgr = new BLL.gigade.Mgr.ProductItemMapMgr(connectionString); int totalCount = 0; List<ProductItemMapCustom> productmaps = _ProductItemMapMgr.QueryProductItemMap(query, out totalCount); jsonStr = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(productmaps) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); jsonStr = "{success:true,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(jsonStr); this.Response.End(); return this.Response; }
public HttpResponseBase GetVendorProductList() { string json = string.Empty; DataTable _dt = new DataTable(); ProductQuery query = new ProductQuery(); int totalCount = 0; try { query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25"); query.Vendor_Id = Convert.ToUInt32(Request.Params["vendor_id"]); query.searchcontent = Request.Params["searchcontent"].Replace(',',',').Replace('|',','); query.this_product_state = Convert.ToInt32(Request.Params["product_state"]);//產品狀態 _IProductMgr = new ProductMgr(mySqlConnectionString); _dt = _IProductMgr.GetVendorProductList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(_dt, Formatting.Indented, timeConverter) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json.ToString()); this.Response.End(); return this.Response; }
/// <summary> /// 獲得最近出貨時間 /// </summary> /// <param name="v">關聯表的主鍵</param> /// <param name="relationType">關聯表的表名稱</param> /// <returns>error:MinValue success:CriterionTime</returns> public ActionResult ExpectTime(string t, int v = 0) { DateTime dtNow = DateTime.Now;///當前時間 int isSuccess = 1;//1:success 0: fail string Msg = ""; DateTime date = DateTime.MinValue; try { _srMgr = new ScheduleRelationMgr(connectionString); date = _srMgr.GetRecentlyTime(v, t); if (date == DateTime.MinValue) { isSuccess = 0; Msg = "該商品沒有預計出貨時間或出貨時間超出合理範圍"; } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); isSuccess = 0; Msg = "ExpectTime Exception!"; } DateTime functionEnd = DateTime.Now; TimeSpan ts = functionEnd - dtNow; double second = ts.TotalMilliseconds; return Json(new { data = date.ToString("yyyy/MM/dd"), success = isSuccess, errMsg = Msg,des ="最近出貨時間", execTime = dtNow.ToString("yyyy/MM/dd"), elapsed = second }, JsonRequestBehavior.AllowGet); }
public JsonResult GetAuthorityGroup() { try { BLL.gigade.Model.Vendor vendorModel = new BLL.gigade.Model.Vendor(); vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"]; _vendor = new VendorMgr(connectionString); string callId = _vendor.GetSingle(vendorModel).vendor_email; AuthorityQuery query = new AuthorityQuery { Type = 1, CallId = callId }; functionGroupMgr = new FunctionVGroupMgr(connectionString); List<Function> functions = functionGroupMgr.CallerAuthorityQuery(query); var result = from f in functions group f by f.FunctionGroup into fgroup select new { Id = fgroup.Min(m => m.RowId), Text = fgroup.Key }; return Json(result); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } return Json("[]"); }
public HttpResponseBase GetCatagory(string id = "true") { List<ProductCategory> categoryList = new List<ProductCategory>(); List<ProductCategoryCustom> cateList = new List<ProductCategoryCustom>(); List<ProductCategorySet> resultList = new List<ProductCategorySet>(); _procateMgr = new ProductCategoryMgr(connectionString); ParameterMgr parameterMgr = new ParameterMgr(connectionString); string resultStr = ""; try { uint rootId = 0; categoryList = _procateMgr.QueryAll(new ProductCategory { }); List<Parametersrc> fatherIdResult = parameterMgr.QueryUsed(new Parametersrc { ParameterType = "event_type", Used = 1, ParameterCode = "CXXM" }); rootId = Convert.ToUInt32(fatherIdResult[0].ParameterProperty); cateList = getCate(categoryList, rootId); GetCategoryList(categoryList, ref cateList, resultList); resultStr = JsonConvert.SerializeObject(cateList); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } this.Response.Clear(); this.Response.Write(resultStr); this.Response.End(); return this.Response; }
public HttpResponseBase UpdateConfig() { string json = string.Empty; try { if (!string.IsNullOrEmpty(Request.Form["Name"])) { SiteConfig newConfig = new SiteConfig { Name = Request.Form["Name"], Value = Request.Form["Value"] ?? "" }; string path = Server.MapPath(xmlPath); if (System.IO.File.Exists(path)) { siteConfigMgr = new SiteConfigMgr(path); if (siteConfigMgr.UpdateNode(newConfig)) { json = "{success:true}"; } } } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public JsonResult GetFunction() { List<Function> functions = new List<Function>(); try { int typeId = 1; Int32.TryParse(Request.Form["Type"] ?? "-1", out typeId); Function function = new Function { FunctionType = typeId }; if (!string.IsNullOrEmpty(Request.Form["TopValue"])) { function.TopValue = Convert.ToInt32(Request.Form["TopValue"]); } functionMgr = new FunctionMgr(connectionString); functions = functionMgr.Query(function); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } return Json(functions); }
/// <summary> /// 獲取商品數據 /// </summary> /// <returns></returns> public HttpResponseBase GetTrialProdCateList() { List<TrialProdCateQuery> store = new List<TrialProdCateQuery>(); string json = string.Empty; try { TrialProdCateQuery query = new TrialProdCateQuery(); #region 獲取query對象數據 query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); if (!string.IsNullOrEmpty(Request.Form["limit"])) { query.Limit = Convert.ToInt32(Request.Params["limit"]); } #endregion _trialProdMgr = new TrialProdCateMgr(mySqlConnectionString); _prodMgr = new ProductMgr(mySqlConnectionString); prodCateMgr = new ProductCategoryMgr(mySqlConnectionString);//實例化對象mgr _giftMgr = new PromotionsAmountGiftMgr(mySqlConnectionString); _trialMgr = new PromotionsAmountTrialMgr(mySqlConnectionString); int totalCount = 0; store = _trialProdMgr.Query(query, out totalCount); foreach (var item in store) { item.product_name = _prodMgr.QueryClassify(Convert.ToUInt32(item.product_id)).Product_Name; item.category_name = prodCateMgr.QueryAll(new ProductCategory { category_id = item.category_id }).FirstOrDefault().category_name; if (item.event_id.StartsWith("T1") || item.event_id.StartsWith("T2")) { int id = Convert.ToInt16(item.event_id.Substring(2).ToString()); item.event_name = _trialMgr.GetModel(id).name; } if (item.event_id.StartsWith("G3")) { int id = Convert.ToInt16(item.event_id.Substring(2).ToString()); item.event_name = _giftMgr.GetModel(id).name; } } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase GetList() { int totalCount = 0; List<ProductSearchQuery> stores = new List<ProductSearchQuery>(); string json = string.Empty; try { searchMgr = new ProductSearchMgr(SqlConnectionString, "sphinxHost", "sphinxPort"); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } try { ProductSearchQuery query = new ProductSearchQuery(); query.Start = Convert.ToInt32(Request.Params["Start"] ?? "0"); if (!string.IsNullOrEmpty(Request.Params["Limit"])) { query.Limit = Convert.ToInt32(Request.Params["Limit"]); } if (!string.IsNullOrEmpty(Request.Params["flag"])) { query.flag = Request.Params["flag"]; } if (!string.IsNullOrEmpty(Request.Params["searchKey"])) { query.searchKey = Request.Params["searchKey"]; } stores = searchMgr.GetProductSearchList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase GetReportManagementList() { string json = string.Empty; DataTable _dt = new DataTable(); DeliverMasterQuery dmQuery = new DeliverMasterQuery(); dmQuery.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量 dmQuery.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25");//用於分頁的變量 try { if (!string.IsNullOrEmpty(Request.Params["order_id"])) { dmQuery.sorder_id = Request.Params["order_id"]; } if (!string.IsNullOrEmpty(Request.Params["deliver_id"])) { dmQuery.sdeliver_id = Request.Params["deliver_id"]; } if (!string.IsNullOrEmpty(Request.Params["logistics_type"])) { dmQuery.logisticsType = Convert.ToInt32(Request.Params["logistics_type"]); } if (!string.IsNullOrEmpty(Request.Params["delivery_status"])) { dmQuery.ideliver_status = Convert.ToInt32(Request.Params["delivery_status"]); } dmQuery.deliver_store = Convert.ToInt32(Request.Params["shipment_id"]); dmQuery.i_order_status = Convert.ToInt32(Request.Params["order_status_id"]); dmQuery.payment = Convert.ToInt32(Request.Params["payment_id"]); dmQuery.order_time_begin = Convert.ToDateTime(Convert.ToDateTime(Request.Params["dateStart"]).ToString("yyyy-MM-dd HH:mm:ss"));//建立時間 dmQuery.order_time_end = Convert.ToDateTime(Convert.ToDateTime(Request.Params["dateEnd"]).ToString("yyyy-MM-dd HH:mm:ss")); int totalCount = 0; _dt = _delverMgr.GetReportManagementList(dmQuery, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,'msg':'user',totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(_dt, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase ScheduleParamerAll() { string json = string.Empty; ScheduleParamer sp = new ScheduleParamer(); try { //if (!string.IsNullOrEmpty(Request.Params["schedule_code"]))//判斷id是不是存在.也就是說是否選擇了運送方式.當id不為0時表示選擇了運送方式. //{ // sp.schedule_code = Request.Params["schedule_code"]; //} sp.schedule_code = Request.Params["code"]; _schmerMgr = new ScheduleParamerMgr(mySqlConnectionString); DataTable _dt = _schmerMgr.GetScheduleParamerList(sp.schedule_code); //根據行para_value和行para_name拼接成一個json int lenght = _dt.Rows.Count; json = "{"; for (int i = 1; i <= _dt.Rows.Count; i++) { json = json + "\"" + _dt.Rows[i - 1]["para_name"] + "\":\"" + _dt.Rows[i - 1]["para_value"] + "\""; if (lenght == i) { continue; } else { json = json + ","; } } if (lenght > 0) { json = json + "}"; } else { json = "{\"msg\":\"無數據信息\"}"; } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase EmsDepRelationList() { List<EmsDepRelation> store = new List<EmsDepRelation>(); EmsDepRelation query = new EmsDepRelation(); int totalCount = 0; string json = string.Empty; emsDepRelation = new EmsDepRelationMgr(mySqlConnectionString); query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25"); try { if (!string.IsNullOrEmpty(Request.Params["dep_code"])) { query.relation_dep = Convert.ToInt32(Request.Params["dep_code"]); } if (!string.IsNullOrEmpty(Request.Params["relation_type"])) { query.re_type = Convert.ToInt32(Request.Params["relation_type"]); } if (!string.IsNullOrEmpty(Request.Params["datatype"])) { query.datatype = Convert.ToInt32(Request.Params["datatype"]); } if (!string.IsNullOrEmpty(Request.Params["date"])) { query.date = Convert.ToDateTime(Request.Params["date"]); } query.create_user = (Session["caller"] as Caller).user_id; query.update_user = (Session["caller"] as Caller).user_id; query.predate = DateTime.Now.AddDays(-1); store=emsDepRelation.EmsDepRelationList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
/// <summary> /// 查詢商品細項詳情 /// </summary> /// <returns></returns> public ActionResult QueryParticulars(int condition, string ids) { int[] id = (from i in ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) select int.Parse(i)).ToArray(); try { _productExtMgr = new ProductExtMgr(connectionString); return Json(_productExtMgr.Query((ProductExtCustom.Condition)condition, id)); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return new EmptyResult(); } }
public ActionResult GetTableName() { string json = string.Empty; try { _tableHistoryMgr = new TableHistoryMgr(connectionString); return Json(_tableHistoryMgr.QueryTableName().Select(m => new { m.table_name })); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return new EmptyResult(); } }
public HttpResponseBase GetUserLevelLogList() { string json = string.Empty; int totalCount = 0; UserLevelLogQuery query = new UserLevelLogQuery(); List<UserLevelLogQuery> store = new List<UserLevelLogQuery>(); try { query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25"); if (!string.IsNullOrEmpty(Request.Params["searchStatus"])) { query.searchStatus = Convert.ToInt32(Request.Params["searchStatus"]); } if (!string.IsNullOrEmpty(Request.Params["key"])) { query.key = Request.Params["key"]; } if (!string.IsNullOrEmpty(Request.Params["leveltype"])) { query.leveltype = Convert.ToInt32(Request.Params["leveltype"]); } if (!string.IsNullOrEmpty(Request.Params["levelid"])) { query.leveltypeid = Request.Params["levelid"]; } _userLevelLog = new UserLevelLogMgr(mySqlConnectionString); store = _userLevelLog.GetUserLevelLogList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:true,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase GetAnnounceList() { string json = string.Empty; List<AnnounceQuery> store = new List<AnnounceQuery>(); AnnounceQuery query = new AnnounceQuery(); try { query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25"); _announcemgr = new AnnounceMgr(mySqlConnectionString); int totalCount = 0; if (!string.IsNullOrEmpty(Request.Params["typeCon"])) { query.type = uint.Parse(Request.Params["typeCon"]); } if (!string.IsNullOrEmpty(Request.Params["statusCon"])) { query.con_status = int.Parse(Request.Params["statusCon"]); } if (!string.IsNullOrEmpty(Request.Params["searchCon"])) { query.key = Request.Params["searchCon"]; } store = _announcemgr.GetAnnounceList(query, out totalCount); foreach (var item in store) { item.content = Server.HtmlDecode(Server.HtmlDecode(item.content)); } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public string QueryBig() { IZipImplMgr zMgr = new ZipMgr(connectionString); string json = string.Empty; try { json = zMgr.QueryBig(Request.Form["topValue"] ?? ""); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "[]"; } return json; }
/// <summary> /// 初進頁面 /// </summary> /// <returns></returns> public ActionResult CurriculuManage() { List<Schedule> list = new List<Schedule>(); try { IScheduleImplMgr _FstMgr = new ScheduleMgr(connectionString); //list = _FstMgr.Query(); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } return View(); }
/// <summary> /// 購物金活動列表 /// </summary> /// <returns></returns> public HttpResponseBase List() { List<PromotionsAccumulateBonusQuery> stores = new List<PromotionsAccumulateBonusQuery>(); string json = string.Empty; try { PromotionsAccumulateBonusQuery query = new PromotionsAccumulateBonusQuery(); query.Start = Convert.ToInt32(Request["Start"] ?? "0"); if (!string.IsNullOrEmpty(Request["Limit"])) { query.Limit = Convert.ToInt32(Request["Limit"]); } if (!string.IsNullOrEmpty(Request.Params["ddlSel"])) { query.expired = Convert.ToInt32(Request.Params["ddlSel"]); } else { query.expired = 1; } int totalCount = 0; stores = _promAccBnus.Query(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; //listUser是准备转换的对象 json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:true,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase QueryErrorLog() { string jsonStr = "{success:false}"; string startDate = Request.Form["startDate"] ?? ""; string endDate = Request.Form["endDate"] ?? ""; //添加 級別 的查詢條件 add by zhuoqin0830w 2015/02/04 string level = Request.Form["level"] ?? ""; if (startDate.Equals("1970-01-01 08:00:00")) { startDate = ""; } if (endDate.Equals("1970-01-01 08:00:00")) { endDate = ""; } int startPage = Convert.ToInt32(Request.Form["start"] ?? "0"); int endPage = Convert.ToInt32(Request.Form["limit"] ?? "20"); int totalCount = 0; try { IErrorLogImplMgr _errorMgr = new ErrorLogMgr(connectionString); List<ErrorLog> errorList = new List<ErrorLog>(); //添加 級別 的查詢條件 edit by zhuoqin0830w 2015/02/05 errorList = _errorMgr.QueryErrorLog(startDate, endDate, startPage, endPage, out totalCount, level); jsonStr = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(errorList) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } this.Response.Clear(); this.Response.Write(jsonStr); this.Response.End(); return this.Response; }
public JsonResult GetGroup() { try { functionMgr = new FunctionMgr(connectionString); List<Function> functions = functionMgr.Query(new Function { FunctionType = 1 }); var groups = from f in functions group f by f.FunctionGroup into c select new { FunctionGroup = c.Key }; return Json(groups); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return Json("[]"); } }
public HttpResponseBase GetProCage1() { string resultStr = "{success:false}"; try { _paraMgr = new ParameterMgr(connectionString); resultStr = "{success:true,data:" + JsonConvert.SerializeObject(_paraMgr.QueryUsed(new Parametersrc { ParameterType = "product_cate" }).Where(p => p.TopValue == "0").ToList()) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } this.Response.Clear(); this.Response.Write(resultStr); this.Response.End(); return this.Response; }
/// <summary> /// 保存數據 /// </summary> /// <param name="fst"></param> /// <returns></returns> public ActionResult TierSetSave(Schedule fst) { try { _fstMgr = new ScheduleMgr(connectionString); fst.create_user = (Session["caller"] as Caller).user_id; fst.create_date = DateTime.Now; bool result = _fstMgr.Save(fst); return Json(new { success = result }); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); } return View(); }