当前位置: 首页>>代码示例>>C#>>正文


C# Log4NetCustom.LogMessage类代码示例

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


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


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