Exemplo n.º 1
0
        public static void PinyingSetting()
        {
            DateTime dtBegin = new DateTime();
            dtBegin = System.DateTime.Now;
            DataSet dsHotel = PinyingDA.GetHotelPinyingList();

            if (dsHotel.Tables.Count == 0 || dsHotel.Tables[0].Rows.Count == 0)
            {
                return;
            }

            CommonEntity _commonEntity = new CommonEntity();
            _commonEntity.LogMessages = new Common.Logger.LogMessage();

            IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
            IPAddress[] address = hostInfo.AddressList;
            string m_IP = address[0].ToString();

            _commonEntity.LogMessages.IpAddress = m_IP;
            _commonEntity.LogMessages.Computername = Dns.GetHostName();
            _commonEntity.LogMessages.Userid = "JOB System";
            _commonEntity.LogMessages.Username = "******";
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();

            string strResult = "";
            string strContent = "";
            string strTemp = "酒店目的地信息管理--酒店ID:{0} 全拼:{1} 短拼:{2}";
            string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("Pinying", "t_lm_b_pinying_hotel_save");
            Hashtable htList = new Hashtable();
            int iCount = 0;
            int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            List<CommandInfo> cmdList = new List<CommandInfo>();

            ChineseCode chineseCode = new ChineseCode();
            for (int i = 0; i <= dsHotel.Tables[0].Rows.Count - 1; i++)
            {
                if (String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["HOTELID"].ToString()))
                {
                    continue;
                }

                //dsHotel.Tables[0].Rows[i]["LPINYIN"] = HotelVp.Common.Utilities.PinyinHelper.GetPinyin(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());
                //dsHotel.Tables[0].Rows[i]["SPINYIN"] = HotelVp.Common.Utilities.PinyinHelper.GetShortPinyin(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());

                try
                {
                    dsHotel.Tables[0].Rows[i]["LPINYIN"] = String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()) ? "" : chineseCode.GetSpell(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());
                    dsHotel.Tables[0].Rows[i]["SPINYIN"] = String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()) ? "" : chineseCode.IndexCode(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()).ToLower();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                CommandInfo cminfo = new CommandInfo();
                cminfo.CommandText = strSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("LPINYIN",OracleType.VarChar),
                                    new OracleParameter("SPINYIN",OracleType.VarChar)
                                };

                lmParm[0].Value = dsHotel.Tables[0].Rows[i]["HOTELID"].ToString();
                lmParm[1].Value = dsHotel.Tables[0].Rows[i]["LPINYIN"].ToString();
                lmParm[2].Value = dsHotel.Tables[0].Rows[i]["SPINYIN"].ToString();
                cminfo.Parameters = lmParm;
                cmdList.Add(cminfo);
                iCount = iCount + 1;
                if (MaxLength == iCount)
                {
                    try
                    {
                        PinyingDA.SavePinyingCommonList(cmdList);
                        strResult = "成功";
                    }
                    catch
                    {
                        strResult = "失败";
                    }

                    foreach (CommandInfo tempinfo in cmdList)
                    {
                        OracleParameter[] tempParm = (OracleParameter[])tempinfo.Parameters;
                        strContent = string.Format(strTemp, tempParm[0].Value.ToString(), tempParm[1].Value.ToString(), tempParm[2].Value.ToString());

                        CommonDBEntity commonDBEntity = new CommonDBEntity();
                        commonDBEntity.Event_Type = "JOB-酒店拼音设置";
                        commonDBEntity.Event_Content = strContent;
                        commonDBEntity.Event_Result = strResult;
                        commonDBEntity.Event_ID = tempParm[0].Value.ToString();
                        commonDBEntity.UserID = "JOB System";
                        commonDBEntity.UserID = "JOB System";

                        _commonEntity.LogMessages.Event_id = tempParm[0].Value.ToString();
                        _commonEntity.CommonDBEntity.Add(commonDBEntity);
                        CommonBP.InsertEventHistory(_commonEntity);
                        _commonEntity.CommonDBEntity.Clear();
                        Console.WriteLine(strContent + "设置结果:" + strResult);
                    }

                    iCount = 0;
                    cmdList.Clear();
                }
            }

            if (iCount > 0)
            {
                try
                {
                    PinyingDA.SavePinyingCommonList(cmdList);
                    strResult = "成功";
                }
                catch
                {
                    strResult = "失败";
                }

                foreach (CommandInfo tempinfo in cmdList)
                {
                    OracleParameter[] tempParm = (OracleParameter[])tempinfo.Parameters;
                    strContent = string.Format(strTemp, tempParm[0].Value.ToString(), tempParm[1].Value.ToString(), tempParm[2].Value.ToString());

                    CommonDBEntity commDBEntity = new CommonDBEntity();
                    commDBEntity.Event_Type = "JOB-酒店拼音设置";
                    commDBEntity.Event_Content = strContent;
                    commDBEntity.Event_Result = strResult;
                    commDBEntity.Event_ID = tempParm[0].Value.ToString();

                    _commonEntity.LogMessages.Event_id = tempParm[0].Value.ToString();
                    _commonEntity.CommonDBEntity.Add(commDBEntity);
                    CommonBP.InsertEventHistory(_commonEntity);
                    _commonEntity.CommonDBEntity.Clear();
                    Console.WriteLine(strContent + "设置结果:" + strResult);
                }
            }

            DateTime dtEnd = new DateTime();
            dtEnd = System.DateTime.Now;

            Console.WriteLine(dtEnd - dtBegin);
        }
        private static int AutoSelect(AutoHotelPlanEntity autogotelplanEntity)
        {
            int iMaxLenth = String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"]) ? 200 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            DataSet dsResult = new DataSet();
            dsResult = AutoHotelPlanDA.AutoListSelect(autogotelplanEntity);
            int iCount = 0;
            string PlanID=string.Empty;
            string Status=string.Empty;
            string Action=string.Empty;
            string Result=string.Empty;
            string Username = string.Empty;
            //string strToDay = DateTime.Now.ToShortDateString();
            //int strToWeek = (int)DateTime.Now.DayOfWeek + 1;
            //string strDayTemp = string.Empty;
            string strWeekTemp = string.Empty;
            string strTypeNm = string.Empty;
            string strTypeTime = string.Empty;
            string ChkResult = string.Empty;

            ArrayList alHotelList = new ArrayList();
            Hashtable htErrList = new Hashtable();
            Hashtable htErr = new Hashtable();

            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                if (!"0".Equals(drRow["Type"].ToString().Trim()))
                {
                    ChkResult = CheckApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    if (!String.IsNullOrEmpty(ChkResult))
                    {
                        htErrList.Add(drRow["HPID"].ToString().Trim(), ChkResult);
                    }
                    else
                    {
                        alHotelList.Add(drRow);
                    }
                }
                else
                {
                    alHotelList.Add(drRow);
                }

                iCount = iCount + 1;
                if (iCount == iMaxLenth)
                {
                    htErr = ApplySalesRoomServiceList(alHotelList);
                    foreach (System.Collections.DictionaryEntry item in htErr)
                    {
                        if (!htErrList.ContainsKey(item.Key.ToString()))
                        {
                            htErrList.Add(item.Key.ToString(), item.Value.ToString());
                        }
                    }
                    iCount = 0;
                }
            }

            if (iCount > 0)
            {
                htErr = ApplySalesRoomServiceList(alHotelList);
                foreach (System.Collections.DictionaryEntry item in htErr)
                {
                    if (!htErrList.ContainsKey(item.Key.ToString()))
                    {
                        htErrList.Add(item.Key.ToString(), item.Value.ToString());
                    }
                }
            }

            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                if ("0".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "立即保存";
                    strTypeTime = drRow["Plan_DTime"].ToString().Trim();
                    PlanID = drRow["HPID"].ToString().Trim();
                    Status = "2";
                    Action = "1";
                    //Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Result = htErrList[drRow["HPID"].ToString().Trim()].ToString();
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), Action, Result, Username);
                    iCount = iCount + 1;
                }
                else if ("1".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "定时保存";
                    strTypeTime = drRow["Plan_DTime"].ToString().Trim();
                    PlanID = drRow["HPID"].ToString().Trim();
                    Status = "2";
                    Action = "1";
                    //Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Result = htErrList[drRow["HPID"].ToString().Trim()].ToString();
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), Action, Result, Username);
                    iCount = iCount + 1;
                }
                else if ("2".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "每日自动更新";
                    strTypeTime = drRow["PlanTime"].ToString().Trim();
                    //strDayTemp = drRow["EndDtime"].ToString().Trim();
                    strWeekTemp = drRow["Week_List"].ToString().Trim();

                    Status = (DateTime.Parse(drRow["JPDTime"].ToString().Trim()) == DateTime.Parse(drRow["PlanPlanEnd"].ToString().Trim() + " " + drRow["PlanTime"].ToString().Trim())) ? "2" : "1";
                    PlanID = drRow["HPID"].ToString().Trim();

                    //Console.WriteLine("Action:" + drRow["Action"].ToString().Trim());
                    //Console.WriteLine("HPID:" + drRow["HPID"].ToString().Trim());
                    //Console.WriteLine(htErrList[drRow["HPID"].ToString().Trim()].ToString());

                    Action = ChkNumerVal(drRow["Action"].ToString().Trim()).ToString();
                    //Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Result = htErrList[drRow["HPID"].ToString().Trim()].ToString();
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), "1", Result, Username);
                    iCount = iCount + 1;
                }

                CommonEntity _commonEntity = new CommonEntity();
                _commonEntity.LogMessages = autogotelplanEntity.LogMessages;
                _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
                CommonDBEntity commonDBEntity = new CommonDBEntity();

                commonDBEntity.Event_Type = "酒店销售计划-JOB";
                commonDBEntity.Event_ID = drRow["HPID"].ToString().Trim();
                string conTent = "销售计划 运行一次 - 计划ID:{0} 更新方式:{1} 定时执行时间:{2} 定时开始日期:{3} 定时结束日期:{4} 星期详情:{5} 修改时间:{6} 修改人:{7}";
                conTent = string.Format(conTent, drRow["HPID"].ToString().Trim(), strTypeNm, strTypeTime, drRow["StartDtime"].ToString().Trim(), drRow["EndDtime"].ToString().Trim(), strWeekTemp, drRow["Update_Time"].ToString().Trim(), drRow["Update_User"].ToString().Trim());
                commonDBEntity.Event_Content = conTent;
                commonDBEntity.Event_Result = Result;
                _commonEntity.CommonDBEntity.Add(commonDBEntity);
                CommonBP.InsertEventHistory(_commonEntity);
            }
            return dsResult.Tables[0].Rows.Count;
        }
        private static int AutoSelect(AutoMsgCancelOrdEntity autogotelplanEntity)
        {
            string strOrderType = ConfigurationManager.AppSettings["OrderType"].ToString();
            DataSet dsResult = new DataSet();
            dsResult = AutoMsgCancelOrdDA.AutoListSelect(autogotelplanEntity);
            string Result = string.Empty;
            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                if (!ChkOrderType(drRow["ORDERNO"].ToString().Trim(), strOrderType))
                {
                    continue;
                }

                Result = ApplySendMsgService(drRow);
                CommonEntity _commonEntity = new CommonEntity();
                _commonEntity.LogMessages = autogotelplanEntity.LogMessages;
                _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
                CommonDBEntity commonDBEntity = new CommonDBEntity();

                commonDBEntity.Event_Type = "订单提示短信JOB";
                commonDBEntity.Event_ID = drRow["USERID"].ToString().Trim();
                string conTent = "订单提示短信JOB - FOG订单ID:{0} 创建人:{1} 创建时间:{2} ";
                conTent = string.Format(conTent, drRow["ORDERNO"].ToString().Trim(), drRow["USERID"].ToString().Trim(), drRow["CREATETIME"].ToString().Trim());
                commonDBEntity.Event_Content = conTent;
                commonDBEntity.Event_Result = Result;
                _commonEntity.CommonDBEntity.Add(commonDBEntity);
                CommonBP.InsertEventHistory(_commonEntity);
            }
            return dsResult.Tables[0].Rows.Count;
        }
Exemplo n.º 4
0
        public static void PusMsgHelping(DataSet dsPusMsgList)
        {
            int iMaxRows = int.Parse(ConfigurationManager.AppSettings["MaxRows"].ToString());
            bool bSleep = (dsPusMsgList.Tables[0].Rows.Count > iMaxRows) ? true : false;
            //Variables you may need to edit:
            //---------------------------------

            //True if you are using sandbox certificate, or false if using production
            bool sandbox = ("0".Equals(ConfigurationManager.AppSettings["Sandbox"].ToString())) ? true : false;

            //Put your device token in here
            //  string testDeviceToken = "bc9eb0ca6fedb7967ab7563a36fc197b90df3c99aae38db335cb152b7377fdb9";

            //Put your PKCS12 .p12 or .pfx filename here.
            // Assumes it is in the same directory as your app
            string p12File = GetAppValue("p12File");// "aps_production_identity.p12";

            //This is the password that you protected your p12File
            //  If you did not use a password, set it as null or an empty string
            string p12FilePassword = GetAppValue("p12FilePassword");//"123456";

            //Number of notifications to send
            //int count = 1000;

            //Number of milliseconds to wait in between sending notifications in the loop
            // This is just to demonstrate that the APNS connection stays alive between messages

            //string numberFileName = GetAppValue("tokenFile");

            string content = "";// GetAppValue("content");

            //bool isTest = GetAppValue("isTest") == "true" ? true : false;

            //Actual Code starts below:
            //--------------------------------

            string p12Filename = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, p12File);

            //string numFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, numberFileName);

            //string[] numberList = ReadFile(numFile).Contains(',') ? ReadFile(numFile).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) : new string[] { };

            //NotificationService service = new NotificationService(sandbox, p12Filename, p12FilePassword, 1, bSleep);
            NotificationService service = new NotificationService(sandbox, p12Filename, p12FilePassword, 1);

            service.SendRetries = 1; //5 retries before generating notificationfailed event
            service.ReconnectDelay = 5000; //5 seconds

            service.Error += new NotificationService.OnError(service_Error);
            service.NotificationTooLong += new NotificationService.OnNotificationTooLong(service_NotificationTooLong);

            service.BadDeviceToken += new NotificationService.OnBadDeviceToken(service_BadDeviceToken);
            service.NotificationFailed += new NotificationService.OnNotificationFailed(service_NotificationFailed);
            service.NotificationSuccess += new NotificationService.OnNotificationSuccess(service_NotificationSuccess);
            service.Connecting += new NotificationService.OnConnecting(service_Connecting);
            service.Connected += new NotificationService.OnConnected(service_Connected);
            service.Disconnected += new NotificationService.OnDisconnected(service_Disconnected);

            //The notifications will be sent like this:
            //		Testing: 1...
            //		Testing: 2...
            //		Testing: 3...
            // etc...
            //for (int i = 0; i < numberList.Length; i++)
            int sleepBetweenNotifications = (bSleep) ? Convert.ToInt32(GetAppValue("sleepBetweenNotificationsshot")) : Convert.ToInt32(GetAppValue("sleepBetweenNotifications")); //100;

            string strResult = string.Empty;

            CommonEntity commonEntity = new CommonEntity();
            commonEntity.LogMessages = new Common.Logger.LogMessage();
            commonEntity.LogMessages.Userid = "JOB System";
            commonEntity.LogMessages.Username = "******";

            commonEntity.CommonDBEntity = new List<CommonDBEntity>();

            for (int i = 0; i < dsPusMsgList.Tables[0].Rows.Count ; i++)
            {
                try
                {
                    //if (!PushTicketMsgDA.CheckPushPlanActionHistory(taskID, dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim()))
                    //{
                    //    continue;
                    //}
                    CommonDBEntity dbParm = new CommonDBEntity();
                    dbParm.Event_Type = "Que Ticket Push发送";

                    if ("0".Equals(dsPusMsgList.Tables[0].Rows[i]["TYPE"].ToString().Trim()))
                    {
                        content = String.Format(GetAppValue("oneContent"), dsPusMsgList.Tables[0].Rows[i]["amount"].ToString().Trim());
                    }
                    else
                    {
                        content = String.Format(GetAppValue("twoContent"), dsPusMsgList.Tables[0].Rows[i]["amount"].ToString().Trim());
                    }
                    dbParm.Event_Content = "Que Push发送Telphone: " + dsPusMsgList.Tables[0].Rows[i]["TELPHONE"].ToString().Trim() + "Que Push发送Devicetoken: " + dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim() + "Que Push发送内容: " + content;
                    //Create a new notification to send
                    Notification alertNotification = new Notification(dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim());

                    alertNotification.Payload.Alert.Body = string.Format(content);
                    alertNotification.Payload.Sound = "default";
                    alertNotification.Payload.Badge = 1;

                    //Queue the notification to be sent
                    if (service.QueueNotification(alertNotification, bSleep))
                    {
                        strResult = "发送成功";
                        Console.WriteLine("Notification Queued!");
                        writeFile(logFile1, content + "Notification Queued!" + dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim());
                    }
                    else
                    {
                        strResult = "发送失败";
                        Console.WriteLine("Notification Failed to be Queued!");
                        writeFile(logFile1, content + "Notification Failed to be Queued!" + dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim());
                    }

                    dbParm.Event_ID = dsPusMsgList.Tables[0].Rows[i]["TELPHONE"].ToString().Trim();
                    dbParm.Event_Result = strResult;
                    commonEntity.CommonDBEntity.Add(dbParm);
                    //PushTicketMsgDA.InsertPushPlanActionHistory(taskID, dsPusMsgList.Tables[0].Rows[i]["TELPHONE"].ToString().Trim(), dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim(), strResult);

                    //Sleep in between each message
                    //if (i < numberList.Length)
                    //{
                    Console.WriteLine("Sleeping " + sleepBetweenNotifications + " milliseconds before next Notification...");
                    System.Threading.Thread.Sleep(sleepBetweenNotifications);
                    //}
                }
                catch (Exception ex)
                {
                    //  Log King
                    CommonDA.InsertEventHistoryError(dsPusMsgList.Tables[0].Rows[i]["TELPHONE"].ToString().Trim(), "Que Push发送Telphone: " + dsPusMsgList.Tables[0].Rows[i]["TELPHONE"].ToString().Trim() + "Que Push发送Devicetoken: " + dsPusMsgList.Tables[0].Rows[i]["DEVICETOKEN"].ToString().Trim() + "Que Push发送异常: " + ex.Message);
                    Console.WriteLine(ex.Message);
                    continue;
                }
            }

            Console.WriteLine("Cleaning Up...");
            writeFile(logFile, "Cleaning Up...");
            //First, close the service.
            //This ensures any queued notifications get sent befor the connections are closed
            service.Close();

            //Clean up
            service.Dispose();

            Console.WriteLine("Done!");
            writeFile(logFile, "Done");
            //Console.WriteLine("Press enter to exit...");
            //writeFile(logFile, "Press enter to exit...");
            //Console.ReadLine();

            CommonDA.InsertEventHistory(commonEntity);
        }
        private static int AutoSelect(AutoHotelPlanEntity autogotelplanEntity)
        {
            DataSet dsResult = new DataSet();
            dsResult = AutoHotelPlanDA.AutoListSelect(autogotelplanEntity);
            int iCount = 0;
            string PlanID=string.Empty;
            string Status=string.Empty;
            string Action=string.Empty;
            string Result=string.Empty;
            string Username = string.Empty;
            //string strToDay = DateTime.Now.ToShortDateString();
            //int strToWeek = (int)DateTime.Now.DayOfWeek + 1;
            //string strDayTemp = string.Empty;
            string strWeekTemp = string.Empty;
            string strTypeNm = string.Empty;
            string strTypeTime = string.Empty;
            foreach (DataRow drRow in dsResult.Tables[0].Rows)
            {
                if ("0".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "立即保存";
                    strTypeTime = drRow["Plan_DTime"].ToString().Trim();
                    PlanID = drRow["HPID"].ToString().Trim();
                    Status = "2";
                    Action = "1";
                    Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), Action, Result, Username);
                    iCount = iCount + 1;
                }
                else if ("1".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "定时保存";
                    strTypeTime = drRow["Plan_DTime"].ToString().Trim();
                    PlanID = drRow["HPID"].ToString().Trim();
                    Status = "2";
                    Action = "1";
                    Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), Action, Result, Username);
                    iCount = iCount + 1;
                }
                else if ("2".Equals(drRow["Type"].ToString().Trim()))
                {
                    strTypeNm = "每日自动更新";
                    strTypeTime = drRow["PlanTime"].ToString().Trim();
                    //strDayTemp = drRow["EndDtime"].ToString().Trim();
                    strWeekTemp = drRow["Week_List"].ToString().Trim();

                    Status = (DateTime.Parse(drRow["JPDTime"].ToString().Trim()) == DateTime.Parse(drRow["PlanPlanEnd"].ToString().Trim() + " " + drRow["PlanTime"].ToString().Trim())) ? "2" : "1";
                    PlanID = drRow["HPID"].ToString().Trim();
                    Action = ChkNumerVal(drRow["Action"].ToString().Trim()).ToString();
                    Result = ApplySalesRoomService(drRow, drRow["Type"].ToString().Trim());
                    Username = drRow["Create_User"].ToString().Trim();
                    AutoHotelPlanDA.UpdateSalesPlanEventStatus(PlanID, Status, Action, Result, Username);
                    AutoHotelPlanDA.UpdateSalesPlanEventJobStatus(drRow["JID"].ToString().Trim(), "1", Result, Username);
                    iCount = iCount + 1;
                }

                CommonEntity _commonEntity = new CommonEntity();
                _commonEntity.LogMessages = autogotelplanEntity.LogMessages;
                _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
                CommonDBEntity commonDBEntity = new CommonDBEntity();

                commonDBEntity.Event_Type = "酒店销售计划-JOB";
                commonDBEntity.Event_ID = drRow["HPID"].ToString().Trim();
                string conTent = "销售计划 运行一次 - 计划ID:{0} 更新方式:{1} 定时执行时间:{2} 定时开始日期:{3} 定时结束日期:{4} 星期详情:{5} 修改时间:{6} 修改人:{7}";
                conTent = string.Format(conTent, drRow["HPID"].ToString().Trim(), strTypeNm, strTypeTime, drRow["StartDtime"].ToString().Trim(), drRow["EndDtime"].ToString().Trim(), strWeekTemp, drRow["Update_Time"].ToString().Trim(), drRow["Update_User"].ToString().Trim());
                commonDBEntity.Event_Content = conTent;
                commonDBEntity.Event_Result = Result;
                _commonEntity.CommonDBEntity.Add(commonDBEntity);
                CommonBP.InsertEventHistory(_commonEntity);
            }
            return iCount;
        }