• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Log4NetCustom.LogMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Log4NetCustom.LogMessage的典型用法代码示例。如果您正苦于以下问题:C# Log4NetCustom.LogMessage类的具体用法?C# Log4NetCustom.LogMessage怎么用?C# Log4NetCustom.LogMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Log4NetCustom.LogMessage类属于命名空间,在下文中一共展示了Log4NetCustom.LogMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetHistory

 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();
     }
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:25,代码来源:ProductHistoryController.cs


示例2: LoadCondition

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:33,代码来源:EdmSController.cs


示例3: GetCertificateCategory

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:33,代码来源:InspectionReportController.cs


示例4: QueryLogIn

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:28,代码来源:LogInLogeController.cs


示例5: GetConditionList

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:30,代码来源:EdmSController.cs


示例6: ConfirmSuperPwd

 /// <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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:31,代码来源:SuperController.cs


示例7: GetFileName

        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();
            }
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:31,代码来源:XmlManageController.cs


示例8: QueryProductItemMap

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:31,代码来源:ProductItemMapController.cs


示例9: GetVendorProductList

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:32,代码来源:VendorStockController.cs


示例10: ExpectTime

 /// <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);
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:32,代码来源:OpenController.cs


示例11: GetAuthorityGroup

 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("[]");
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:25,代码来源:FunctionGroupController.cs


示例12: GetCatagory

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:33,代码来源:PromotionsMaintainController.cs


示例13: UpdateConfig

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:33,代码来源:SiteConfigController.cs


示例14: GetFunction

        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);
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:25,代码来源:FunctionController.cs


示例15: GetTrialProdCateList

        /// <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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:63,代码来源:TrialProdCateController.cs


示例16: GetList

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:52,代码来源:ProductSearchController.cs


示例17: GetReportManagementList

        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;
        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:51,代码来源:ReportManagementController.cs


示例18: ScheduleParamerAll

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:50,代码来源:ScheduleParamerController.cs


示例19: EmsDepRelationList

 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;
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:48,代码来源:EmsDepRelationController.cs


示例20: QueryParticulars

 /// <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();
     }
 }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:21,代码来源:ProductParticularsController.cs



注:本文中的Log4NetCustom.LogMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LogAction类代码示例发布时间:2022-05-24
下一篇:
C# Log类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap