예제 #1
0
 /// <summary>
 /// 获取左侧导航子菜单
 /// </summary>
 protected void GetLeftMenuChild(StringBuilder html, DataRow[] allList, DataTable dt)
 {
     try
     {
         if (allList.Length > 0)
         {
             html.AppendFormat("<div class=\"child\">");
             html.AppendFormat("<ul>");
             foreach (DataRow dr in allList)
             {
                 if (ComPage.CurrentAdmin.UserType == 1)
                 {
                     html.AppendFormat("<li class=\"ch\"><a href =\"{0}\">{1}</a></li>", dr["ExternalLinkAddress"], dr["FunctionName"]);
                 }
                 else
                 {
                     if (userFunction.Contains(dr["FunctionId"]))
                     {
                         html.AppendFormat("<li class=\"ch\"><a href =\"{0}\">{1}</a></li>", dr["ExternalLinkAddress"], dr["FunctionName"]);
                     }
                 }
             }
             html.AppendFormat("</ul>");
             html.AppendFormat("</div>");
         }
     }
     catch (Exception ex)
     {
         ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Redirect("/Product/NewSSKD/Index.aspx");
     if (!IsPostBack)
     {
         try
         {
             loginUserName = ComPage.CurrentUser.LoginName;
             #region 获取渠道API
             Company model = opCompanyBLL.GetModel(companyId);
             if (model != null)
             {
                 IsOpenPage = model.DockingMode;
                 apiUrl     = model.API;
             }
             #endregion
             #region 获取渠道推荐码
             //recommendationCode = Server.UrlEncode(CommonHelper.GetAppSettingsValue("RecommendationCode80", "08001"));
             if (model.IsRelyOnPrimaryKey != 1)
             {
                 if (!string.IsNullOrEmpty(model.RecommendationCode))
                 {
                     rc.Value = model.RecommendationCode;
                     litRecommendationCode.Text = string.Format("专属推荐码({0})", model.RecommendationCode);
                 }
             }
             #endregion
         }
         catch (Exception ex)
         {
             ExceptionLogBLL.WriteExceptionLogToDB("渠道认证异常," + ex.ToString());
         }
     }
 }
예제 #3
0
        /// <summary>
        /// 订单试算
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public TrialResp GetOrderTrial(TrialReq model)
        {
            try
            {
                string TransNo = UtilityHelper.CommonHelper.OrderNoOne();
                model.transNo = TransNo; //Guid.NewGuid().ToString("N");
                string methodName = "getOrderTrial";
                model.customkey = Customkey;
                string    strJson   = SerializerHelper.ToJson(model);
                string    sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string    url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string    retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
                TrialResp outModel  = new TrialResp();
                outModel = SerializerHelper.FromJsonTo <TrialResp>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "GetOrderTrial", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());

                return(null);
            }
        }
예제 #4
0
        public void DeleteCompany(HttpContext context)
        {
            string result = string.Empty;

            try
            {
                var CompanyId = DNTRequest.GetString("CompanyId");
                if (string.IsNullOrEmpty(CompanyId))
                {
                    result = DNTRequest.GetResultJson(false, "请先选择一条数据", null);
                    return;
                }
                else
                {
                    CompanyBLL companybll   = new CompanyBLL();
                    Company    modelMachine = new Company();
                    bool       res          = companybll.Delete(Convert.ToInt32(CompanyId), ComPage.CurrentUser.UserID);
                    if (res)
                    {
                        result = DNTRequest.GetResultJson(true, "删除渠道成功", null);
                    }
                    else
                    {
                        result = DNTRequest.GetResultJson(false, "删除渠道失败,请稍后再试", null);
                    }
                }
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "删除渠道异常,请稍后再试", null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            context.Response.Write(result);
        }
예제 #5
0
        /// <summary>
        /// 获取结算申请信息
        /// </summary>
        static public Object GetSettlementModel()
        {
            string result = string.Empty;

            try
            {
                int orderRebateSettlementApplyId = DNTRequest.GetInt("OrderRebateSettlementApplyId", 0);
                if (orderRebateSettlementApplyId == 0)
                {
                    result = DNTRequest.GetResultJson(false, "获取结算申请信息失败,请稍后再试", null);
                }
                OrderRebateSettlementApplyBLL op    = new OrderRebateSettlementApplyBLL();
                OrderRebateSettlementApply    model = new OrderRebateSettlementApply();
                if (orderRebateSettlementApplyId != 0)
                {
                    model = op.GetModel(orderRebateSettlementApplyId);
                }
                result = DNTRequest.GetResultJson(true, "success", model);
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "获取结算申请信息异常,请稍后再试", null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #6
0
        public JobInfoResp GetJobInfo(JobInfoReq model)
        {
            try
            {
                string methodName = "getProductJob";
                model.customkey = Customkey;
                string strJson   = SerializerHelper.ToJson(model);
                string sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);

                string retrunStr22 = PostHttp(url, strJson, "application/json;charset=utf-8");
                // string retrunStr = UtilityHelper.HttpService.Post(url, strJson);
                JobInfoResp outModel = new JobInfoResp();
                outModel = SerializerHelper.FromJsonTo <JobInfoResp>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "GetJobInfo", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
                Log.WriteLog(" " + ex);
                return(null);
            }
        }
예제 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LoanTermStringBuilder();
     strLoanUseStringBuilder();
     if (!IsPostBack)
     {
         try
         {
             CompanyBLL opCompanyBLL = new CompanyBLL();
             Company    model        = opCompanyBLL.GetModel(companyId);
             if (model != null)
             {
                 if (model.IsRelyOnPrimaryKey != 1)
                 {
                     if (!string.IsNullOrEmpty(model.RecommendationCode))
                     {
                         recommendationCode = model.RecommendationCode;
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             ExceptionLogBLL.WriteExceptionLogToDB(Title + "," + ex.ToString());
         }
     }
 }
예제 #8
0
 /// <summary>
 /// 产品出行目的地
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ProductCXDestinationResp ProductDestinations(ProductDestinationReq model)
 {
     try
     {
         string methodName = "productDestinations";
         model.customkey = Customkey;
         string strJson   = SerializerHelper.ToJson(model);
         string sign      = UtilityHelper.Utils.MD5(VI + strJson);
         string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
         string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
         ProductCXDestinationResp outModel = new ProductCXDestinationResp();
         outModel = SerializerHelper.FromJsonTo <ProductCXDestinationResp>(retrunStr);
         if (outModel.respstat != "0000")
         {
             ReceivedLog(model.transNo, "ProductDestinations", outModel.respmsg);
         }
         return(outModel);
     }
     catch (Exception ex)
     {
         ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
         Log.WriteLog(" " + ex);
         return(null);
     }
 }
예제 #9
0
        /// <summary>
        /// 投保单列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public OrderSummaryOutputModel OrderSummary(OrderSummaryInputModel model)
        {
            try
            {
                string methodName = "orderSummary";
                model.customkey = Customkey;
                string strJson   = SerializerHelper.ToJson(model);
                string sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
                OrderSummaryOutputModel outModel = new OrderSummaryOutputModel();
                outModel = SerializerHelper.FromJsonTo <OrderSummaryOutputModel>(retrunStr);
                //if (outModel.respstat != "0000")
                //{
                //    ReceivedLog(model.transNo, "OrderSummary", outModel.respmsg);
                //}
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());

                return(null);
            }
        }
예제 #10
0
        /// <summary>
        /// 获取支付链接
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public GetPayUrlResp GetPayUrl(GetPayUrlReq model)
        {
            try
            {
                string methodName = "getPayUrl";
                model.customkey = Customkey;
                //  model.pageNoticeUrl = LinkFun.getPageNoticeUrl();
                model.pageNoticeUrl = UtilityHelper.Utils.UrlEncode(LinkFun.getPageNoticeUrl());
                string        strJson   = SerializerHelper.ToJson(model);
                string        sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string        url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string        retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
                GetPayUrlResp outModel  = new GetPayUrlResp();
                outModel = SerializerHelper.FromJsonTo <GetPayUrlResp>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "GetPayUrl", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());

                return(null);
            }
        }
예제 #11
0
        /// <summary>
        /// 获取功能列表为ZTree
        /// </summary>
        static public void GetDepartmentInfoChild(List <Hashtable> list, DataRow[] allList, DataTable dt)
        {
            try
            {
                if (allList.Length > 0)
                {
                    foreach (DataRow dr in allList)
                    {
                        bool      isParent = false;
                        DataRow[] allChild = dt.Select(string.Format("ParentID={0}", dr["DepartmentID"]), "DepartmentID ASC");
                        if (allChild != null && allChild.Length > 0)
                        {
                            isParent = true;
                        }
                        string    className = ComPage.SafeToString(dr["DepartmentName"]);
                        Hashtable child     = new Hashtable();
                        child.Add("id", dr["DepartmentID"]);
                        child.Add("name", className);
                        child.Add("pId", dr["ParentID"]);
                        child.Add("open", true);

                        if (isParent)
                        {
                            GetDepartmentInfoChild(list, allChild, dt);
                        }
                        list.Add(child);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
        }
예제 #12
0
        /// <summary>
        /// 获取左侧导航子菜单
        /// </summary>
        static public void GetLeftMenuChild(List <Hashtable> list, DataRow[] allList, DataTable dt)
        {
            try
            {
                if (allList.Length > 0)
                {
                    foreach (DataRow dr in allList)
                    {
                        bool      isParent = false;
                        DataRow[] allChild = dt.Select(string.Format("ClassId=0 and parentId={0}", dr["FunctionId"]), "OrderId ASC");
                        if (allChild != null && allChild.Length > 0)
                        {
                            isParent = true;
                        }
                        string    className = ComPage.SafeToString(dr["FunctionName"]);
                        Hashtable child     = new Hashtable();
                        child.Add("id", dr["FunctionId"]);
                        child.Add("name", className);
                        child.Add("pId", dr["ParentId"]);
                        child.Add("url", dr["ExternalLinkAddress"]);
                        child.Add("code", dr["FunctionCode"]);

                        if (isParent)
                        {
                            GetLeftMenuChild(list, allChild, dt);
                        }
                        list.Add(child);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
        }
예제 #13
0
파일: ILog.cs 프로젝트: hofmannzhu/bwjs
        /// <summary>
        /// 接口调用日志
        /// </summary>
        /// <param name="apiUrl">请求地址</param>
        /// <param name="requestDate">请求日期时间</param>
        /// <param name="requestData">请求json</param>
        /// <param name="responseData">响应json</param>
        /// <param name="companyId">渠道编号</param>
        /// <param name="businessType">业务类型1网贷2保险3信用卡</param>
        /// <param name="relationId">关联编号</param>
        /// <returns>添加结果</returns>
        static public int ApiInvokingLogAdd(int relationId, string apiUrl, DateTime requestDate, string requestData, string responseData, int companyId = 1, int businessType = 1)
        {
            int result = -1;

            try
            {
                StackTrace st        = new StackTrace(true);
                MethodBase mb        = st.GetFrame(1).GetMethod();
                string     clsString = mb.DeclaringType.FullName;
                string     mName     = mb.Name;

                ApiInvokingLogBLL opApiInvokingLog    = new ApiInvokingLogBLL();
                ApiInvokingLog    modelApiInvokingLog = new ApiInvokingLog();
                modelApiInvokingLog.CompanyId    = companyId;
                modelApiInvokingLog.BusinessType = businessType;
                modelApiInvokingLog.RelationId   = relationId;
                modelApiInvokingLog.ClassName    = clsString;
                modelApiInvokingLog.MethodName   = mName;
                modelApiInvokingLog.ApiUrl       = apiUrl;
                modelApiInvokingLog.RequestDate  = requestDate;
                modelApiInvokingLog.RequestData  = requestData;
                modelApiInvokingLog.ResponseDate = DateTime.Now;
                modelApiInvokingLog.ResponseData = responseData;
                modelApiInvokingLog.IsDeleted    = 0;
                modelApiInvokingLog.CreateDate   = DateTime.Now;
                result = opApiInvokingLog.Add(modelApiInvokingLog);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #14
0
        /// <summary>
        /// 获取角色列表为ZTree
        /// </summary>
        static public Object GetDepartmentInfoListForZTree()
        {
            #region 开始
            string result = string.Empty;
            try
            {
                int channelId           = DNTRequest.GetInt("channelId", 7);
                int ParentId            = DNTRequest.GetInt("ParentId", 0);
                DepartmentInfoBLL op    = new DepartmentInfoBLL();
                DepartmentInfo    model = new DepartmentInfo();
                DataSet           ds    = op.GetList(" RecordIsDelete=0 ");
                DataTable         dt    = null;
                if (ds != null && ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                }

                List <Hashtable> list = new List <Hashtable>();
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow[] allList = dt.Select(string.Format("ParentId={0}", ParentId), "DepartmentID ASC");
                    if (allList.Length > 0)
                    {
                        foreach (DataRow dr in allList)
                        {
                            bool      isParent = false;
                            DataRow[] allChild = dt.Select(string.Format("ParentId={0}", dr["DepartmentID"]), "DepartmentID ASC");
                            if (allChild != null && allChild.Length > 0)
                            {
                                isParent = true;
                            }
                            #region inner001
                            string    className = ComPage.SafeToString(dr["DepartmentName"]);
                            Hashtable ht        = new Hashtable();

                            ht.Add("id", dr["DepartmentID"]);
                            ht.Add("name", className);
                            ht.Add("pId", dr["ParentId"]);
                            ht.Add("open", true);

                            if (isParent)
                            {
                                GetDepartmentInfoChild(list, allChild, dt);
                            }
                            list.Add(ht);
                            #endregion
                        }
                    }
                }
                result = DNTRequest.GetResultJson(true, "success", list);
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, ex.Message, null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);

            #endregion end 开始
        }
예제 #15
0
        /// <summary>
        /// 获取心跳检查间隔
        /// </summary>
        static public Object GetHeartbeatInterval()
        {
            string result = string.Empty;

            try
            {
                double heartbeatInterval = 1000;
                int    hours             = 1;
                int    minutes           = 1;
                int    seconds           = 60;

                SysSettingsBLL     opSysSettingsBLL = new SysSettingsBLL();
                SysSettings        modelSysSettings = new SysSettings();
                List <SysSettings> list             = opSysSettingsBLL.GetModelList("IsDeleted=0 and Status=0");
                if (list.Count > 0)
                {
                    modelSysSettings = list[0];
                }
                if (modelSysSettings != null)
                {
                    hours   = modelSysSettings.TimerHours;
                    minutes = modelSysSettings.TimerMinutes;
                    seconds = modelSysSettings.TimerSeconds;
                }
                heartbeatInterval = hours * minutes * seconds * 1000;
                result            = DNTRequest.GetResultJson(true, "获取心跳检查间隔成功", heartbeatInterval);
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "获取心跳检查间隔异常", ex.Message);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #16
0
        /// <summary>
        /// 退保
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public OrderCancleOutputModel OrderCancle(OrderCancleInputModel model)
        {
            try
            {
                string methodName = "orderCancle";
                model.customkey = "bowangjishi";
                // UtilityHelper.CommonHelper.OrderNoOne();
                //model.transNo = Guid.NewGuid().ToString("N");
                string strJson   = SerializerHelper.ToJson(model);
                string sign      = UtilityHelper.Utils.MD5("c8d994c2e6f824eb9fc54e49c0d771c1" + strJson);
                string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
                OrderCancleOutputModel outModel = new OrderCancleOutputModel();
                outModel = SerializerHelper.FromJsonTo <OrderCancleOutputModel>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "OrderCancle", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());

                return(null);
            }
        }
예제 #17
0
        ///// <summary>
        ///// 页面通知地址
        ///// </summary>
        //const string pageNoticeUrl = "";

        #region orderApply承保
        /// <summary>
        /// 承保
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public OrderApplyOutputModel OrderApply(OrderApplyInputModel model)
        {
            try
            {
                string methodName = "orderApply";
                model.customkey = Customkey;
                string strJson   = SerializerHelper.ToJson(model);
                string sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);
                #region 发送魔方日志
                //MofangSendLog mofangSendLog = new MofangSendLog();
                //mofangSendLog.MothodName = "OrderApply";
                //mofangSendLog.FKID = ApplyId;
                //mofangSendLog.TransNo = orderModel.transNo;
                //mofangSendLog.IsSend = true;
                //mofangSendLogMessage =
                #endregion
                OrderApplyOutputModel outModel = new OrderApplyOutputModel();
                outModel = SerializerHelper.FromJsonTo <OrderApplyOutputModel>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "OrderApply", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());

                return(null);
            }
        }
예제 #18
0
파일: ILog.cs 프로젝트: hofmannzhu/bwjs
        /// <summary>
        /// 操作日志
        /// </summary>
        /// <param name="logContent">日志内容</param>
        /// <param name="companyId">渠道编号</param>
        /// <param name="businessType">业务类型1网贷2保险3信用卡</param>
        /// <param name="relationId">关联编号</param>
        /// <returns>操作日志添加结果</returns>
        static public int OperationLogAdd(int relationId, string logContent, int companyId = 1, int businessType = 1)
        {
            int result = -1;

            try
            {
                int    userId         = -1;
                string realName       = string.Empty;
                int    departmentId   = -1;
                string departmentName = string.Empty;

                LoginUserCookie currentUser = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                if (currentUser != null)
                {
                    UsersBLL op    = new UsersBLL();
                    Users    model = new Users();
                    model        = op.GetModel(currentUser.LoginUserID);
                    userId       = currentUser.LoginUserID;
                    departmentId = model.DepartmentID;
                    if (model != null)
                    {
                        realName = model.UserName;

                        DepartmentInfoBLL opDepartment        = new DepartmentInfoBLL();
                        DepartmentInfo    modelDepartmentInfo = new DepartmentInfo();
                        modelDepartmentInfo = opDepartment.GetModel(departmentId);
                        if (modelDepartmentInfo != null)
                        {
                            departmentName = modelDepartmentInfo.DepartmentName;
                        }
                    }
                }

                StackTrace st        = new StackTrace(true);
                MethodBase mb        = st.GetFrame(1).GetMethod();
                string     clsString = mb.DeclaringType.FullName;
                string     mName     = mb.Name;

                OperationLogBLL opOperationLog    = new OperationLogBLL();
                OperationLog    modelOperationLog = new OperationLog();

                modelOperationLog.BusinessType   = businessType;
                modelOperationLog.RelationId     = relationId;
                modelOperationLog.LogContent     = logContent;
                modelOperationLog.Ip             = System.Web.HttpContext.Current.Request.UserHostAddress;
                modelOperationLog.UserId         = userId;
                modelOperationLog.RealName       = realName;
                modelOperationLog.CreateDate     = DateTime.Now;
                modelOperationLog.DepartmentId   = departmentId;
                modelOperationLog.DepartmentName = departmentName;
                modelOperationLog.CreateDate     = DateTime.Now;
                result = opOperationLog.Add(modelOperationLog);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #19
0
        static public Object CheckRUsersMachine()
        {
            string result = string.Empty;

            try
            {
                string UserId = DNTRequest.GetString("UserId");
                #region 获取列表
                string where = string.Empty;
                where        = "RecordIsDelete=0 and UserID= " + UserId;
                R_UsersMachineBLL bll        = new R_UsersMachineBLL();
                DataTable         dt         = bll.GetList(where).Tables[0];
                string            MachineIds = string.Empty;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MachineIds = MachineIds + "," + dt.Rows[i]["MachineID"];
                }
                MachineIds = MachineIds.TrimStart(',').TrimEnd(',');
                MachineBLL MBLL = new MachineBLL();

                string sqlMach = string.Empty;
                sqlMach = "MachineID in (" + MachineIds + ")";
                DataTable dt2 = MBLL.GetList(sqlMach).Tables[0];
                DataTable dt3 = dt2.DefaultView.ToTable(false, new string[] { "MachineID", "SN", "Address", "Platform", "Longitude", "Latitude" });
                for (int j = 0; j < dt3.Rows.Count; j++)
                {
                    if (dt3.Rows[j]["Platform"].ToString() == "1")
                    {
                        dt3.Rows[j]["Platform"] = "平板";
                    }
                    else if (dt3.Rows[j]["Platform"].ToString() == "2")
                    {
                        dt3.Rows[j]["Platform"] = "机器";
                    }
                    else
                    {
                        dt3.Rows[j]["Platform"] = "暂无";
                    }
                }
                //object obj = new
                //{
                //    result = true,
                //    code = "",
                //    msg = "",
                //    data = ((dt2 == null) ? (new DataTable()) : (dt2))
                //};
                result = Newtonsoft.Json.JsonConvert.SerializeObject(dt3);

                #endregion
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #20
0
 /// <summary>
 /// 获取左侧导航菜单
 /// </summary>
 protected void GetLeftMenu()
 {
     try
     {
         int         parentId      = DNTRequest.GetInt("parentId", 0);
         FunctionBLL opFunctionBLL = new FunctionBLL();
         Function    modelFunction = new Function();
         DataSet     ds            = opFunctionBLL.GetList("IsDeleted=0");
         DataTable   dt            = null;
         if (ds != null && ds.Tables.Count > 0)
         {
             dt = ds.Tables[0];
         }
         StringBuilder    html = new StringBuilder();
         List <Hashtable> list = new List <Hashtable>();
         if (dt != null && dt.Rows.Count > 0)
         {
             DataRow[] allList = dt.Select(string.Format("ClassId=0 and ParentId={0}", parentId), "OrderId ASC");
             if (allList.Length > 0)
             {
                 foreach (DataRow dr in allList)
                 {
                     bool      isParent = false;
                     DataRow[] allChild = dt.Select(string.Format("ClassId=0 and ParentId={0}", dr["FunctionId"]), "OrderId ASC");
                     if (allChild != null && allChild.Length > 0)
                     {
                         isParent = true;
                     }
                     if (ComPage.CurrentAdmin.UserType == 1)
                     {
                         html.AppendFormat("<li class=\"par\">{0}</li>", dr["FunctionName"]);
                     }
                     else
                     {
                         if (userFunction.Contains(dr["FunctionId"]))
                         {
                             html.AppendFormat("<li class=\"par\">{0}</li>", dr["FunctionName"]);
                         }
                     }
                     if (isParent)
                     {
                         GetLeftMenuChild(html, allChild, dt);
                     }
                 }
             }
         }
         if (string.IsNullOrEmpty(html.ToString()))
         {
             html.Append("<li>暂无权限</li>");
         }
         litLeftMenu.Text = html.ToString();
     }
     catch (Exception ex)
     {
         ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
     }
 }
예제 #21
0
        public void AddExceptionLog()
        {
            //ExceptionLog model = new ExceptionLog();
            //model.ClassName = "ExceptionLogBLLUnit";
            //model.MethodName = "AddExceptionLog";
            //model.ErrorDesc = "test ErrorDesc";

            ExceptionLogBLL.WriteExceptionLogToDB("test ErrorDesc");
        }
예제 #22
0
        /// <summary>
        /// 获取左侧导航菜单
        /// </summary>
        static public Object GetLeftMenu()
        {
            #region 开始
            string result = string.Empty;
            try
            {
                int         parentId      = DNTRequest.GetInt("parentId", 0);
                FunctionBLL opFunctionBLL = new FunctionBLL();
                Function    modelFunction = new Function();
                DataSet     ds            = opFunctionBLL.GetList("IsDeleted=0");
                DataTable   dt            = null;
                if (ds != null && ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                }
                List <Hashtable> list = new List <Hashtable>();
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow[] allList = dt.Select(string.Format("ClassId=0 and ParentId={0}", parentId), "OrderId ASC");
                    if (allList.Length > 0)
                    {
                        foreach (DataRow dr in allList)
                        {
                            bool      isParent = false;
                            DataRow[] allChild = dt.Select(string.Format("ClassId=0 and ParentId={0}", dr["FunctionId"]), "OrderId ASC");
                            if (allChild != null && allChild.Length > 0)
                            {
                                isParent = true;
                            }
                            string    className = ComPage.SafeToString(dr["FunctionName"]);
                            Hashtable ht        = new Hashtable();

                            ht.Add("id", dr["FunctionId"]);
                            ht.Add("name", className);
                            ht.Add("pId", dr["ParentId"]);
                            ht.Add("url", dr["ExternalLinkAddress"]);
                            ht.Add("code", dr["FunctionCode"]);

                            if (isParent)
                            {
                                GetLeftMenuChild(list, allChild, dt);
                            }
                            list.Add(ht);
                        }
                    }
                }
                result = DNTRequest.GetResultJson(true, "success", list);
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, ex.Message, null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);

            #endregion end 开始
        }
예제 #23
0
        public static int SaveFile(string fileName, byte[] fileData, string TPath, bool isNewName = true)
        {
            int ResourceID = 0;

            try
            {
                //var basePath = CommonHelper.GetConfigValue("ResourceBasePath");
                //if (string.IsNullOrEmpty(basePath))
                //    throw new NullReferenceException("ResourceBasePath 不能为空!");

                //文件后缀
                var fileSuffix = fileName.Substring(fileName.LastIndexOf('.') + 1);

                var newFileName = string.Format("{0}.{1}", Guid.NewGuid().ToString(), fileSuffix);
                //区分是否使用原有名称
                if (!isNewName)
                {
                    newFileName = fileName;
                }
                //var filePath = System.IO.Path.Combine(basePath, newFileName);
                string fPath    = "/Resources/";
                string filePath = fPath + TPath;



                // 保存资源
                ResourceBLL bll      = new ResourceBLL();
                var         resource = new BWJS.Model.Resource()
                {
                    ResourceName       = fileName,
                    FileName           = fileName,
                    FilePath           = filePath,
                    VirtualPath        = "/" + System.IO.Path.Combine(newFileName).Replace("\\", "/"),
                    FileSuffix         = fileSuffix,
                    CreatUserID        = 1,
                    RecordUpdateUserID = 1,
                    RecordIsDelete     = false
                };
                ResourceID = bll.Add(resource);
                //if (b)
                //{
                //    ResourceID = resource.ResourceID;
                //}
                return(ResourceID);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }

            return(ResourceID);
        }
예제 #24
0
        /// <summary>
        /// 设备心跳检查
        /// </summary>
        static public Object HeartbeatCheck()
        {
            string result = string.Empty;

            try
            {
                #region 启动定时器
                //double interval = 1000;
                //int hours = 1;
                //int minutes = 1;
                //int seconds = 60;

                //SysSettingsBLL opSysSettingsBLL = new SysSettingsBLL();
                //SysSettings modelSysSettings = new SysSettings();
                //List<SysSettings> list = opSysSettingsBLL.GetModelList("IsDeleted=0 and Status=0");
                //if (list.Count > 0)
                //{
                //    modelSysSettings = list[0];
                //}
                //if (modelSysSettings != null)
                //{
                //    hours = modelSysSettings.TimerHours;
                //    minutes = modelSysSettings.TimerMinutes;
                //    seconds = modelSysSettings.TimerSeconds;
                //}
                //interval = hours * minutes * seconds * 1000;
                //int enabled = DNTRequest.GetInt("enabled", 1);
                //bool timerEnabled = ((enabled == 1) ? (true) : (false));
                //System.Timers.Timer timer = new System.Timers.Timer();
                //timer.Enabled = timerEnabled;
                //timer.Interval = interval;
                //timer.Start();
                //timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer1_Elapsed);
                //if (!timerEnabled)
                //{
                //    timer.Enabled = false;
                //}

                #endregion

                UpdateMachineSettings();

                result = DNTRequest.GetResultJson(true, "心跳检测启动成功", null);
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "心跳检测启动异常", ex.Message);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
예제 #25
0
        /// <summary>
        /// 查询广告位最该序号
        /// </summary>
        /// <returns></returns>
        public int GetMaxSort()
        {
            int MaxSort = 1;

            try
            {
                MaxSort = dal.GetMaxSort();
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(MaxSort);
        }
예제 #26
0
        /*
         *  北京创世华信科技有限公司
         *  地址: 北京市朝阳区东三环南路联合国际大厦甲段12层
         *  网址:www.ipyy.com
         *  售后服务:010-57135000
         *  接口说明:客户接口部分提供http 和 WebService(目前只支持提交短信) 方式的接口,客户可以根据需求选择相应接口,接口编码方式默认采用UTF-8
         *  短信平台客户端地址:http://c.ipyy.net(近期将会升级,如果访问不通请使用https://c.ipyy.net)
         *  发送规则:
         *  同一个号码,发送内容带有(验证码),3分钟之内只能3条,
         *  超过3条,系统会默认为(恶意注册)
         *  同一个号码,系统默认一天之内只能发送10条信息,超过
         *  10条会超限失败(特殊号码、或特殊客户需要找客服处理)
         *  注:短信计费条数跟短信的字数有关,一般的短信70个字计费一条。超过70个字就划分为长短信,67个字计费一条,例如;71字的短信就是长短信计费2条,134个字也是计费2条(67*2)。135个字计费3条,依次类推。
         *  SendI18NSms
         *  国际短信发送
         *  SendMms
         *  发送彩信接口
         *  SendSms
         *  发送短信接口
         *
         *  userName	    发送用户帐号	用户帐号,由系统管理员
         *  password	    发送帐号密码
         *  sms	            短信参数对象	SmsObject结构,详见下面说明
         *  Msisdns	        全部被叫号码	发信发送的目的号码.多个号码之间用半角逗号隔开
         *  SMSContent	    发送内容	    短信的内容,内容需要UTF-8编码,提交内容格式:内容+【签名】。签名是公司的名字或者公司项目名称。示例:您的验证码:1439【腾飞】。【】是签名的标识符。请按照正规的格式提交内容测试,请用正规内容下发,最好不要当成是测试,就当是正式使用在给自己的客户发信息,签名字数3-8个字
         *  PlanSendTime	定时发送时间	为空表示立即发送,定时发送格式2010-10-24T 09:08:10
         *  ExtNumber	    扩展子号	    请先询问配置的通道是否支持扩展子号,如果不支持,请填空。子号只能为数字,且最多5位数。
         *
         *  返回值
         *  StatusCode	    发送的状态代码	OK表示成功,其它为失败,参见最后的错误代码表。
         *  Description	    发送说明	    发送结果状态操作说明
         *  MsgId	        任务ID	        提交短信的任务批次
         *  Amount	        当前余额	    当前账户的余额
         *  SuccessCounts	成功的号码数量	成功的号码数量
         *  BillingCount	消费的条数	    消费的条数值
         *  Errors	        错误描述	    本次发送中,相关的错误描述
         */


        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="msisdns">发信发送的目的号码.多个号码之间用半角逗号隔开</param>
        /// <param name="smsContent">短信的内容,内容需要UTF-8编码,提交内容格式:内容+【签名】。签名是公司的名字或者公司项目名称。示例:您的验证码:1439【腾飞】。【】是签名的标识符。请按照正规的格式提交内容测试,请用正规内容下发,最好不要当成是测试,就当是正式使用在给自己的客户发信息,签名字数3-8个字 </param>
        /// <param name="planSendTime">定时发送时间	为空表示立即发送,定时发送格式2010-10-24T 09:08:10</param>
        /// <param name="extNumber">扩展子号 请先询问配置的通道是否支持扩展子号,如果不支持,请填空。子号只能为数字,且最多5位数</param>
        /// <returns>发送结果</returns>
        static public string DoSend(string msisdns, int?smsTemplateId, string smsContent, DateTime?planSendTime, string extNumber)
        {
            string result = string.Empty;

            try
            {
                DateTime CreateDate = DateTime.Now;
                string   userName   = CommonHelper.GetAppSettingsValue("smsUserName", "AA01177");
                string   password   = CommonHelper.GetAppSettingsValue("smsPass", "AA0117706");
                string   apiPass    = CommonHelper.GetAppSettingsValue("apiPass", "AA0117755");

                SmsObject smsObj = new SmsObject();
                smsObj.Msisdns      = msisdns;
                smsObj.SMSContent   = smsContent;
                smsObj.PlanSendTime = planSendTime;
                smsObj.ExtNumber    = extNumber;

                WebServiceSoapClient op  = new WebServiceSoapClient();
                SendResult           rlt = op.SendSms(userName, apiPass, smsObj);

                result = FormatResult(rlt);

                SmsSendLogBLL opSmsSendLogBLL = new SmsSendLogBLL();
                SmsSendLog    modelSmsSendLog = new SmsSendLog();
                modelSmsSendLog.SmsTemplateId = smsTemplateId;
                modelSmsSendLog.SendType      = ((planSendTime == null) ? (1) : (2));
                modelSmsSendLog.SmsContent    = smsContent;
                modelSmsSendLog.Mobile        = msisdns;
                if (rlt.StatusCode == ResultCode.OK)
                {
                    modelSmsSendLog.Status = 1;
                }
                else
                {
                    modelSmsSendLog.Status = 0;
                }
                modelSmsSendLog.IsDeleted  = 0;
                modelSmsSendLog.CreateDate = CreateDate;
                modelSmsSendLog.SendDate   = DateTime.Now;
                modelSmsSendLog.SendResult = result;
                int res = opSmsSendLogBLL.Add(modelSmsSendLog);
            }
            catch (Exception ex)
            {
                result = ex.Message;
                ExceptionLogBLL.WriteExceptionLogToDB("发送短信接口:" + ex.ToString());
            }
            return(result);
        }
예제 #27
0
        public int VerificationIsFunName(string FunctionName, int FunctionId)
        {
            FunctionDAL dal         = new FunctionDAL();
            int         FunctionId2 = 0;

            try
            {
                FunctionId2 = dal.VerificationIsFunName(FunctionName, FunctionId);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }

            return(FunctionId2);
        }
예제 #28
0
        public List <Function> GetFuctionDepartmentExtentList2(string where)
        {
            FunctionDAL     dal  = new FunctionDAL();
            List <Function> list = new List <Function>();

            try
            {
                list = dal.GetFuctionDepartmentExtentList2(where);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }

            return(list);
        }
예제 #29
0
파일: UsersBLL.cs 프로젝트: hofmannzhu/bwjs
        public int VerificationIsUserName(string LoginName)
        {
            UsersDAL dal    = new UsersDAL();
            int      UserID = 0;

            try
            {
                UserID = dal.VerificationIsUserName(LoginName);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }

            return(UserID);
        }
예제 #30
0
        public int VerificationIsName(string Name, int AdPositionID)
        {
            AdPositionDAL dal           = new AdPositionDAL();
            int           AdPositionID2 = 0;

            try
            {
                AdPositionID2 = dal.VerificationIsName(Name, AdPositionID);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }

            return(AdPositionID2);
        }