Exemplo n.º 1
0
 public static bool CheckUpdate(PushEntity PushEntity)
 {
     PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
     DataCommand cmd = DataCommandManager.GetDataCommand("CheckUpdatePushPlanManager");
     cmd.SetParameterValue("@TaskID", dbParm.ID);
     DataSet dsResult = cmd.ExecuteDataSet();
     if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public static PushEntity ExportPushActionHistoryList(PushEntity PushEntity)
 {
     PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
     DataCommand cmd = DataCommandManager.GetDataCommand("ExportPushActionHistoryList");
     cmd.SetParameterValue("@TaskID", dbParm.ID);
     if (String.IsNullOrEmpty(dbParm.TelPhone))
     {
         cmd.SetParameterValue("@TelPhone", DBNull.Value);
     }
     else
     {
         cmd.SetParameterValue("@TelPhone", dbParm.TelPhone);
     }
     PushEntity.QueryResult = cmd.ExecuteDataSet();
     return PushEntity;
 }
Exemplo n.º 3
0
        public static PushEntity Insert(PushEntity PushEntity)
        {
            PushEntity.LogMessages.MsgType = MessageType.INFO;
            PushEntity.LogMessages.Content = _nameSpaceClass + "Insert";
            LoggerHelper.LogWriter(PushEntity.LogMessages);

            try
            {
                return PushDA.Insert(PushEntity);
            }
            catch (Exception ex)
            {
                PushEntity.LogMessages.MsgType = MessageType.ERROR;
                PushEntity.LogMessages.Content = _nameSpaceClass + "Insert  Error: " + ex.Message;
                LoggerHelper.LogWriter(PushEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 4
0
        public static PushEntity ExportPushInfoActionHistoryList(PushEntity PushEntity)
        {
            PushEntity.LogMessages.MsgType = MessageType.INFO;
            PushEntity.LogMessages.Content = _nameSpaceClass + "ExportPushInfoActionHistoryList";
            LoggerHelper.LogWriter(PushEntity.LogMessages);

            try
            {
                return PushDA.ExportPushInfoActionHistoryList(PushEntity);
            }
            catch (Exception ex)
            {
                PushEntity.LogMessages.MsgType = MessageType.ERROR;
                PushEntity.LogMessages.Content = _nameSpaceClass + "ExportPushInfoActionHistoryList  Error: " + ex.Message;
                LoggerHelper.LogWriter(PushEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 5
0
        public static bool CheckInsert(PushEntity PushEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("TITLE",OracleType.VarChar)
                                };
            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            parm[0].Value = dbParm.Title;
            DataSet dsResult = HotelVp.Common.DBUtility.DbManager.Query("Push", "t_lm_promotion_check_insert", false, parm);

            if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
Exemplo n.º 6
0
        public static PushEntity SendPush(PushEntity pushEntity)
        {
            string DataString = "";
            PushDBEntity dbParm = (pushEntity.PushDBEntity.Count > 0) ? pushEntity.PushDBEntity[0] : new PushDBEntity();

            DataSet dsUserInfo = PushDA.GetUserInfo(dbParm.TelPhone);
            if (dsUserInfo.Tables.Count == 0 || dsUserInfo.Tables[0].Rows.Count == 0)
            {
                pushEntity.Result = 0;
                pushEntity.ErrorMSG = "发送失败!";
                return pushEntity;
            }

            string strRegChanel = dsUserInfo.Tables[0].Rows[0]["CLIENT_CODE"].ToString().Trim();//(!String.IsNullOrEmpty(dsUserInfo.Tables[0].Rows[0]["regchanel_code"].ToString().Trim()) && ConfigurationManager.AppSettings["MyQueueReg"].ToString().Contains(dsUserInfo.Tables[0].Rows[0]["regchanel_code"].ToString())) ? "HOTELVPPRO" : "HOTELVP";
             DataString = "{\"pushDynamicList\":[{\"userId\":\"" + dsUserInfo.Tables[0].Rows[0]["id"].ToString() + "\",\"objLinkId\":\"" + dbParm.ID + "\",\"deviceToken\":\"" + dsUserInfo.Tables[0].Rows[0]["devicetoken"].ToString() + "\",\"useCode\":\"" + dsUserInfo.Tables[0].Rows[0]["platform_code"].ToString() + "\",\"useCodeVersion\":\"" + dsUserInfo.Tables[0].Rows[0]["version"].ToString() + "\",\"clientCode\":\"" + strRegChanel + "\"}],\"title\":\"" + dbParm.Title + "\",\"content\":\"" + dbParm.Content + "\",\"objType\":" + dbParm.Type + ",\"objUrl\":\"\",\"pic\":\"\",\"isPopup\":\"\",\"taskId\":\"" + dbParm.ID + "\",\"endTime\":\"\"}";
            QueueHelper.SendMessage(DataString);
            pushEntity.Result = 1;
            pushEntity.ErrorMSG = "发送成功!";
            return pushEntity;
        }
Exemplo n.º 7
0
        public static PushEntity UpdateSendPushStatus(PushEntity PushEntity)
        {
            if (PushEntity.PushDBEntity.Count == 0)
            {
                PushEntity.Result = 0;
                return PushEntity;
            }

            if (PushEntity.LogMessages == null)
            {
                PushEntity.Result = 0;
                return PushEntity;
            }

            if (!CheckUpdate(PushEntity))
            {
                PushEntity.Result = 2;
                return PushEntity;
            }

            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateSendPushStatus");
            cmd.SetParameterValue("@TaskID", dbParm.ID);
            cmd.SetParameterValue("@Status", dbParm.Status);
            cmd.SetParameterValue("@UpdateUser", PushEntity.LogMessages.Username);
            cmd.ExecuteNonQuery();
            PushEntity.Result = 1;
            return PushEntity;
        }
Exemplo n.º 8
0
        public static PushEntity Update(PushEntity PushEntity)
        {
            if (PushEntity.PushDBEntity.Count == 0)
            {
                PushEntity.Result = 0;
                return PushEntity;
            }

            if (PushEntity.LogMessages == null)
            {
                PushEntity.Result = 0;
                return PushEntity;
            }

            if (!CheckUpdate(PushEntity))
            {
                PushEntity.Result = 2;
                return PushEntity;
            }

            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdatePushPlanManager");
            cmd.SetParameterValue("@TaskID", dbParm.ID);
            cmd.SetParameterValue("@PushTYpe", dbParm.Type);
            cmd.SetParameterValue("@PushTitle", dbParm.Title);
            cmd.SetParameterValue("@PushContent", dbParm.Content);
            cmd.SetParameterValue("@PushProtoType", dbParm.PushProtoType);

            if ("0".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", "");
            }
            else if ("1".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", dbParm.UserGroupList);
            }
            else if ("2".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", dbParm.FilePath);
            }
            cmd.SetParameterValue("@All_Count", dbParm.AllCount);
            cmd.SetParameterValue("@UpdateUser", PushEntity.LogMessages.Username);
            cmd.ExecuteNonQuery();

            PushEntity.Result = 1;
            return PushEntity;
        }
    //点击确定按钮
    protected void btnOk_Click(object sender, EventArgs e)
    {
        if (this.HidFlowBtn.Value == "1")
        {
            #region
            try
            {
                if (!chkCashStatus(ViewState["ID"].ToString()))
                {
                    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('该提现申请状态已经更新,请刷新页面!');", true);
                    return;
                }

                if (StringUtility.Text_Length(txtRemark.Text.Trim()) > 180)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('处理备注最多60个中文字,请修改!');", true);
                    return;
                }

                List<string> list = new List<string>();
                //<asp:ListItem Value="0">已提交</asp:ListItem>
                //<asp:ListItem Value="1">已审核</asp:ListItem>
                //<asp:ListItem Value="2">已成功</asp:ListItem>
                //<asp:ListItem Value="3">已失败</asp:ListItem>
                //<asp:ListItem Value="4">已操作</asp:ListItem>

                //string process_status = this.ddlProcessStatus.SelectedValue;

                string process_status = this.hidProcessStatus.Value;   //点击按钮当前处理的状态
                string pickcashamount = this.lbl_pick_cash_amount_bank.Text;//提现金额

                string remark = this.txtRemark.Text;
                string userRemark = this.txtUserRemark.Text;
                string User_ID = this.lbl_User_ID_bank.Text;
                string isPush = (chkPush.Checked) ? "1" : "0";

                CommonFunction comFun = new CommonFunction();
                int id = comFun.getMaxIDfromSeq("T_LM_CASH_HIS_SEQ");//t_lm_cash_tocash_appl_detl_seq
                string cashWayCode = this.hidCashWayCode_bank.Value;

                string strNow = string.Format("{0:yyyy-MM-dd HH:mm:ss}", System.DateTime.Now);
                //修改主表信息,保留最新一次的备注信息
                //string sqlUpdate = "update T_LM_CASH_TOCASH_APPL set PROCESS_STATUS='" + process_status + "',PROCESS_REMARK='" + remark + "',PROCESS_TIME =to_timestamp('" + strNow + "','yyyy-mm-dd hh24:mi:ss.ff') ,PROCESS_USERID='" + UserSession.Current.UserAccount + "'  where id =" + ViewState["ID"].ToString();
                //list.Add(sqlUpdate);

                ////插入一条新信息到详情表中
                //string sqlInsert = "insert into T_LM_CASH_TOCASH_APPL_DETAIL(ID,REF_APPLICATION_ID,USER_ID,HANDLE_STATUS,HANDLE_REMARK,PAY_MODE,HANDLE_TIME,HANDLER) values  ";
                //sqlInsert += "(" + id + ",'" + ViewState["ID"].ToString() + "','" + User_ID + "'," + process_status + ",'" + remark + "','" + cashWayCode + "',to_timestamp('" + strNow + "','yyyy-mm-dd hh24:mi:ss.ff'),'" + UserSession.Current.UserAccount + "' )";
                //list.Add(sqlInsert);

                string sqlUpdate = "update T_LM_CASH set STATUS='" + process_status + "',REMARK='" + userRemark + "',PROCESS_REMARK='" + remark + "',UPDATE_TIME =to_timestamp('" + strNow + "','yyyy-mm-dd hh24:mi:ss.ff') ,PROCESS_USERID='" + UserSession.Current.UserAccount + "',IS_PUSH='" + isPush + "'  where (STATUS <> 2 AND STATUS <> 3) AND SN =" + ViewState["ID"].ToString();
                list.Add(sqlUpdate);

                //插入一条新信息到详情表中
                if ("4".Equals(process_status))
                {
                    string sqlInserthis = "insert into t_lm_cash_his (id, sn, user_id, status, remark, process_userid, create_time, type, is_push) values  ";
                    sqlInserthis += "(" + id + ",'" + ViewState["ID"].ToString() + "','" + User_ID + "'," + "1" + ",'" + remark + "','" + UserSession.Current.UserAccount + "',to_timestamp('" + strNow + "','yyyy-mm-dd hh24:mi:ss.ff')," + hidCashType.Value + ",'" + isPush + "')";
                    list.Add(sqlInserthis);
                    id = comFun.getMaxIDfromSeq("T_LM_CASH_HIS_SEQ");//t_lm_cash_tocash_appl_detl_seq
                }

                string sqlInsert = "insert into t_lm_cash_his (id, sn, user_id, status, remark, process_userid, create_time, type, is_push) values  ";
                sqlInsert += "(" + id + ",'" + ViewState["ID"].ToString() + "','" + User_ID + "'," + process_status + ",'" + remark + "','" + UserSession.Current.UserAccount + "',to_timestamp('" + strNow + "','yyyy-mm-dd hh24:mi:ss.ff')," + hidCashType.Value + ",'" + isPush + "')";
                list.Add(sqlInsert);

                //点击“已审核”
                if (process_status == "3")
                {
                    string sqlCashUser = "******" + pickcashamount + " where USER_ID='" + User_ID + "'";
                    list.Add(sqlCashUser);
                }
                DbHelperOra.ExecuteSqlTran(list);
                this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('保存成功!');", true);
                BindLToCash();
                setLabelValue(ViewState["ID"].ToString());

                if ("1".Equals(isPush))
                {
                    PushEntity pushEntity = new PushEntity();
                    pushEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
                    pushEntity.LogMessages.Userid = UserSession.Current.UserAccount;
                    pushEntity.LogMessages.Username = UserSession.Current.UserDspName;
                    pushEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

                    pushEntity.PushDBEntity = new List<PushDBEntity>();
                    PushDBEntity pushDBEntity = new PushDBEntity();
                    pushDBEntity.ID = ViewState["ID"].ToString();
                    pushDBEntity.Content = userRemark;
                    pushDBEntity.Type = "6";
                    pushDBEntity.TelPhone = User_ID;
                    pushEntity.PushDBEntity.Add(pushDBEntity);
                    PushInfoSA.SendPush(pushEntity);
                }
            }
            catch
            {
                this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('保存失败!');", true);
            }
            #endregion
        }
        else
        {
            try
            {
                if (GetCashBackStatus(ViewState["ID"].ToString()) == "0")
                {

                    if (!string.IsNullOrEmpty(this.HidPort.Value))
                    {
                        if (HidPort.Value == "3")
                        {
                            MobilePort_Click(null, null);//手机
                        }
                        else
                        {
                            AlipayPort_Click(null, null);//支付宝
                        }
                    }
                }
                else
                {
                    if (GetCashBackStatus(ViewState["ID"].ToString()) == "2")
                    {
                        ScriptManager.RegisterStartupScript(Page, typeof(Page), "fail", "alert('已失败!');", true);
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }

        ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "alertClose", "BtnCompleteStyle();", true);
        BindLToCash();
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        //getFileData();
        //BindReviewLmListGrid();
        //this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnLoadStyle();", true);

        //System.Diagnostics.Process process = new System.Diagnostics.Process();
        //try
        //{
        //    process.StartInfo.FileName = @"D:\TFS\HotelVPBackend\CMS\01SRC\JobConsole\HotelVp.JobConsole.DailyOrderSum_Top\HotelVp.JobConsole.DailyOrderSumTop\bin\Debug\HotelVp.JobConsole.DailyOrderSumTop.exe";//文件名必须加后缀。
        //    process.StartInfo.Arguments = "1";
        //    process.Start();
        //}
        //catch (Exception exU)
        //{
        //    //exU.Message
        //}
        //finally
        //{
        //    if (!process.HasExited)
        //    {
        //        process.Close();
        //        process.Dispose();
        //    }
        //}
        //lblRemainSecond.Text = "5";

        _pushEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _pushEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _pushEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _pushEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _pushEntity.PushDBEntity = new List<PushDBEntity>();
        PushDBEntity pushEntity = new PushDBEntity();
        pushEntity.ID = hidTaskID.Value.Trim();
        pushEntity.Status = "1";
        _pushEntity.PushDBEntity.Add(pushEntity);
        _pushEntity = PushBP.SendPushInfoMsg(_pushEntity);
        int iResult = _pushEntity.Result;

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

        commonDBEntity.Event_Type = "发送Push信息-发送";
        commonDBEntity.Event_ID = txtPushTitle.Text.Trim();
        string conTent = GetLocalResourceObject("EventSendMessage").ToString();

        string strParams = string.Empty;
        if ("1".Equals(hidPushType.Value))
        {
            strParams = hidUserGroupList.Value.Trim();
        }
        else if ("2".Equals(hidPushType.Value))
        {
            strParams = _strPushProtoType.Trim();
        }
        conTent = string.Format(conTent, hidTaskID.Value, txtPushTitle.Text.Trim(), txtPushContent.Text.Trim(), hidPushType.Value.Trim(), strParams, hidPushActype.Value.Trim());
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            //hidTaskID.Value = _pushEntity.PushDBEntity[0].ID;
            commonDBEntity.Event_Result = GetLocalResourceObject("SendSuccess").ToString();
            //messageContent.InnerHtml = GetLocalResourceObject("SendSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            //BindReviewLmListGrid();
            //this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvHidChangeEvent();", true);
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error9").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error9").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);

            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvHidChangeEvent();", true);
            return;
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error10").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error10").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);

            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvHidChangeEvent();", true);
            return;
        }

        hidMsg.Value = String.Format(GetLocalResourceObject("PushMsg").ToString(), lbPushAllNum.Text); //"Push发送中...0/100";
        hidRemainSecond.Value = (ConfigurationManager.AppSettings["PushRemainSecond"] != null) ? ConfigurationManager.AppSettings["PushRemainSecond"].ToString() : "20";
        this.Page.RegisterStartupScript("remaintimebtn0", "<script>DvHidChangeEvent();setInterval('RemainTimeBtn()',1000);</script>"); //执行定时执行
    }
Exemplo n.º 11
0
        public static PushEntity PushInsert(PushEntity PushEntity)
        {
            if (PushEntity.PushDBEntity.Count == 0)
            {
                PushEntity.Result = 0;
                return PushEntity;
            }

            //if (!CheckInsert(PushEntity))
            //{
            //    PushEntity.Result = 2;
            //    return PushEntity;
            //}

            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertPushInfoPlanManager");
            cmd.SetParameterValue("@PushTYpe", dbParm.Type);
            cmd.SetParameterValue("@PushAcTYpe", dbParm.PushType);
            cmd.SetParameterValue("@PushTitle", dbParm.Title);
            cmd.SetParameterValue("@PushContent", dbParm.Content);
            cmd.SetParameterValue("@PushProtoType", dbParm.PushProtoType);
            cmd.SetParameterValue("@WapUrl", dbParm.WapUrl);
            if ("0".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", "");
            }
            else if ("1".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", dbParm.UserGroupList);
            }
            else if ("2".Equals(dbParm.Type))
            {
                cmd.SetParameterValue("@PushUsers", dbParm.FilePath);
            }

            cmd.SetParameterValue("@Status", "0");
            cmd.SetParameterValue("@All_Count", dbParm.AllCount);
            cmd.SetParameterValue("@CreateUser", PushEntity.LogMessages.Username);

            cmd.SetParameterValue("@TicketPackage", dbParm.TicketPackage);
            cmd.SetParameterValue("@TicketAmount", dbParm.TicketAmount);

            cmd.ExecuteNonQuery();
            PushEntity.PushDBEntity[0].ID = cmd.GetParameterValue("@TaskID").ToString();
            PushEntity.Result = 1;
            return PushEntity;
        }
Exemplo n.º 12
0
 public static PushEntity PushInfoHistorySelect(PushEntity PushEntity)
 {
     DataCommand cmd = DataCommandManager.GetDataCommand("PushInfoHistorySelect");
     PushEntity.QueryResult = cmd.ExecuteDataSet();
     return PushEntity;
 }
Exemplo n.º 13
0
        public static PushEntity PushInfoHistoryListSelect(PushEntity PushEntity)
        {
            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("PushInfoHistoryListSelect");
            if (String.IsNullOrEmpty(dbParm.Title))
            {
                cmd.SetParameterValue("@Title", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@Title", "%" + dbParm.Title + "%");
            }

            if (String.IsNullOrEmpty(dbParm.Content))
            {
                cmd.SetParameterValue("@Content", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@Content", "%" + dbParm.Content + "%");
            }

            if (String.IsNullOrEmpty(dbParm.StartDTime))
            {
                cmd.SetParameterValue("@StartDT", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@StartDT", dbParm.StartDTime);
            }

            if (String.IsNullOrEmpty(dbParm.EndDTime))
            {
                cmd.SetParameterValue("@EndDT", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@EndDT", dbParm.EndDTime);
            }
            PushEntity.QueryResult = cmd.ExecuteDataSet();
            return PushEntity;
        }
Exemplo n.º 14
0
 public static PushEntity GetUserGroupList(PushEntity PushEntity)
 {
     PushEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("Push", "t_lm_usergroup_list", false);
     return PushEntity;
 }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        _pushEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _pushEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _pushEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _pushEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _pushEntity.PushDBEntity = new List<PushDBEntity>();
        PushDBEntity pushEntity = new PushDBEntity();
        pushEntity.ID = hidTaskID.Value.Trim();
        pushEntity.Status = "1";
        _pushEntity.PushDBEntity.Add(pushEntity);
        _pushEntity = PushBP.SendPushMsg(_pushEntity);
        int iResult = _pushEntity.Result;

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

        commonDBEntity.Event_Type = "发送Push信息-发送";
        commonDBEntity.Event_ID = txtPushTitle.Text.Trim();
        string conTent = GetLocalResourceObject("EventSendMessage").ToString();

        conTent = string.Format(conTent, hidTaskID.Value, txtPushTitle.Text.Trim(), txtPushContent.Text.Trim(), hidPushType.Value.Trim());
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("SendSuccess").ToString();
            //messageContent.InnerHtml = GetLocalResourceObject("SendSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error9").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error9").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            return;
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error10").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error10").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            return;
        }

        hidMsg.Value = String.Format(GetLocalResourceObject("PushMsg").ToString(), hidPushAllNum.Value); //"Push发送中...0/100";
        hidRemainSecond.Value = (ConfigurationManager.AppSettings["PushRemainSecond"] != null) ? ConfigurationManager.AppSettings["PushRemainSecond"].ToString() : "20";
        this.Page.RegisterStartupScript("remaintimebtn0", "<script>setInterval('RemainTimeBtn()',1000);</script>"); //执行定时执行
    }
Exemplo n.º 16
0
        public static PushEntity SelectInfoActionDateTime(PushEntity PushEntity)
        {
            PushEntity.LogMessages.MsgType = MessageType.INFO;
            PushEntity.LogMessages.Content = _nameSpaceClass + "SelectInfoActionDateTime";
            LoggerHelper.LogWriter(PushEntity.LogMessages);

            try
            {
                return PushDA.SelectInfoActionDateTime(PushEntity);
            }
            catch (Exception ex)
            {
                PushEntity.LogMessages.MsgType = MessageType.ERROR;
                PushEntity.LogMessages.Content = _nameSpaceClass + "SelectInfoActionDateTime  Error: " + ex.Message;
                LoggerHelper.LogWriter(PushEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 17
0
        public static PushEntity SelectPushInfoActionHistoryList(PushEntity PushEntity)
        {
            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
            DataCommand cmd = DataCommandManager.GetDataCommand("SelectPushInfoActionHistoryList");
            cmd.SetParameterValue("@TaskID", dbParm.ID);
            if (String.IsNullOrEmpty(dbParm.TelPhone))
            {
                cmd.SetParameterValue("@UserID", DBNull.Value);
            }
            else
            {
                cmd.SetParameterValue("@UserID", dbParm.TelPhone);
            }
            cmd.SetParameterValue("@PageCurrent", PushEntity.PageCurrent - 1);
            cmd.SetParameterValue("@PageSize", PushEntity.PageSize);

            DataSet dsResult = cmd.ExecuteDataSet();
            PushEntity.TotalCount = (int)cmd.GetParameterValue("@TotalCount");
            PushEntity.QueryResult = dsResult;
            return PushEntity;
        }
Exemplo n.º 18
0
        public static PushEntity SendPushMsg(PushEntity PushEntity)
        {
            PushEntity.LogMessages.MsgType = MessageType.INFO;
            PushEntity.LogMessages.Content = _nameSpaceClass + "SendPushMsg";
            LoggerHelper.LogWriter(PushEntity.LogMessages);

            try
            {
                PushEntity.Result = 1;
                PushEntity.PushDBEntity[0].Status = "1";
                PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
                PushEntity = PushDA.UpdateSendPushStatus(PushEntity);
                if (2 == PushEntity.Result)
                {
                    return PushEntity;
                }

                System.Diagnostics.Process process = new System.Diagnostics.Process();
                try
                {
                    process.StartInfo.FileName = ConfigurationManager.AppSettings["PushMsgJob"].ToString();//文件名必须加后缀。
                    process.StartInfo.Arguments = dbParm.ID;
                    process.Start();
                }
                catch (Exception exU)
                {
                    PushEntity.Result = 3;
                    PushEntity.PushDBEntity[0].Status = "0";
                    PushEntity = PushDA.UpdateSendPushStatus(PushEntity);
                }
                finally
                {
                    if (!process.HasExited)
                    {
                        process.Close();
                        process.Dispose();
                    }
                }
                return PushEntity;
            }
            catch (Exception ex)
            {
                PushEntity.LogMessages.MsgType = MessageType.ERROR;
                PushEntity.LogMessages.Content = _nameSpaceClass + "SendPushMsg  Error: " + ex.Message;
                LoggerHelper.LogWriter(PushEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 19
0
 public static PushEntity SelectPushInfoAllUsersCount(PushEntity PushEntity)
 {
     PushEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("Push", "t_lm_push_info_all_user_count", false);
     return PushEntity;
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        messageContent.InnerHtml = "";

        if (String.IsNullOrEmpty(txtPushTitle.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString(); //"Push任务标题不能为空,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }

        if (String.IsNullOrEmpty(txtPushContent.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString(); //"Push信息正文不能为空,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }

        if (StringUtility.Text_Length(txtPushContent.Text.Trim()) > 135)
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error6").ToString(); //"Push信息正文限制输入50个中文字符,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }

        if ("1".Equals(hidPushActype.Value.Trim()) && (StringUtility.Text_Length(txtPushContent.Text.Trim()) + StringUtility.Text_Length(txtPushTitle.Text.Trim())) > 135)
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error11").ToString(); //"Push信息正文限制输入50个中文字符,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }
        else if ("2".Equals(hidPushActype.Value.Trim()) && (StringUtility.Text_Length(txtPushContent.Text.Trim()) + StringUtility.Text_Length(txtPushTitle.Text.Trim()) + StringUtility.Text_Length(txtWapUrl.Text.Trim())) > 135)
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error11").ToString(); //"Push信息正文限制输入50个中文字符,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }
        else if ("8".Equals(hidPushActype.Value.Trim()) && (StringUtility.Text_Length(txtPushContent.Text.Trim()) + StringUtility.Text_Length(txtPushTitle.Text.Trim()) + StringUtility.Text_Length(txtPackageCode.Text.Trim())) > 135)
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error11").ToString(); //"Push信息正文限制输入50个中文字符,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }

        if ("2".Equals(hidPushActype.Value.Trim()) && String.IsNullOrEmpty(txtWapUrl.Text.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error12").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }

        if ("1".Equals(hidPushType.Value.Trim()) && String.IsNullOrEmpty(hidUserGroupList.Value.Trim()))
        {
            messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString(); //"指定用户组不能为空,请确认!";
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
            return;
        }
        else if ("2".Equals(hidPushType.Value.Trim()))
        {
            string strResult = getFileData();
            if (!String.IsNullOrEmpty(strResult))
            {
                messageContent.InnerHtml = strResult;
                this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
                return;
            }
        }

        if ("8".Equals(hidPushActype.Value.Trim()))
        {
            if (String.IsNullOrEmpty(txtPackageCode.Text.Trim()))
            {
                messageContent.InnerHtml = GetLocalResourceObject("Error13").ToString(); ;
                this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
                return;
            }
        }

        lbPushTitle.Text = txtPushTitle.Text;
        txtRePushContent.Text = txtPushContent.Text;

        _pushEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _pushEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _pushEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _pushEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _pushEntity.PushDBEntity = new List<PushDBEntity>();
        PushDBEntity pushEntity = new PushDBEntity();
        pushEntity.ID = hidTaskID.Value.Trim();
        pushEntity.PushType = hidPushActype.Value.Trim();
        pushEntity.WapUrl = ("2".Equals(hidPushActype.Value)) ? txtWapUrl.Text.Trim() : "";
        pushEntity.Title = txtPushTitle.Text.Trim();
        pushEntity.Content = txtPushContent.Text.Trim();
        pushEntity.Type = hidPushType.Value.Trim();
        pushEntity.UserGroupList = hidUserGroupList.Value.Trim();
        _strPushProtoType = ("2".Equals(hidPushType.Value)) ? _strPushProtoType : hidUserGroupList.Value.Trim();
        pushEntity.PushProtoType = _strPushProtoType;
        pushEntity.FilePath = _strFilePath.Trim();
        pushEntity.AllCount = GetPushAllCount();
        lbPushAllNum.Text = pushEntity.AllCount;

        pushEntity.TicketPackage = ("8".Equals(hidPushActype.Value)) ? txtPackageCode.Text.Trim() : "";
        pushEntity.TicketAmount = ("8".Equals(hidPushActype.Value)) ? hidTicketAmount.Value.Trim() : "";

        _pushEntity.PushDBEntity.Add(pushEntity);

        if (String.IsNullOrEmpty(hidTaskID.Value.Trim()))
        {
            _pushEntity = PushBP.PushInsert(_pushEntity);
        }
        else
        {
            _pushEntity = PushBP.PushUpdate(_pushEntity);
        }

        int iResult = _pushEntity.Result;

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

        commonDBEntity.Event_Type = "发送Push信息-保存";
        commonDBEntity.Event_ID = txtPushTitle.Text.Trim();
        string conTent = GetLocalResourceObject("EventInsertMessage").ToString();

        string strParams = string.Empty;
        if ("1".Equals(hidPushType.Value))
        {
            strParams = hidUserGroupList.Value.Trim();
        }
        else if ("2".Equals(hidPushType.Value))
        {
            strParams = _strPushProtoType.Trim();
        }
        conTent = string.Format(conTent, txtPushTitle.Text.Trim(), txtPushContent.Text.Trim(), hidPushType.Value.Trim(), strParams, hidPushActype.Value.Trim());
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            hidTaskID.Value = _pushEntity.PushDBEntity[0].ID;
            commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);
            BindReviewLmListGrid();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DoSaveEvent();", true);
        }
        else if (iResult == 2)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error8").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error8").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);

            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DoSaveEvent();", true);
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("Error7").ToString();
            messageContent.InnerHtml = GetLocalResourceObject("Error7").ToString();
            _commonEntity.CommonDBEntity.Add(commonDBEntity);
            CommonBP.InsertEventHistory(_commonEntity);

            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "DvShChangeEvent();", true);
        }

        //UpdatePanel1.Update();
        //UpdatePanel4.Update();
    }
Exemplo n.º 21
0
 public static PushEntity SelectPushSuccCount(PushEntity PushEntity)
 {
     PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();
     DataCommand cmd = DataCommandManager.GetDataCommand("SelectPushSuccCount");
     cmd.SetParameterValue("@TaskID", dbParm.ID);
     PushEntity.QueryResult = cmd.ExecuteDataSet();
     return PushEntity;
 }
    private string GetPushAllCount()
    {
        PushEntity pushEntityMaster = new PushEntity();
        pushEntityMaster.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        pushEntityMaster.LogMessages.Userid = UserSession.Current.UserAccount;
        pushEntityMaster.LogMessages.Username = UserSession.Current.UserDspName;
        pushEntityMaster.LogMessages.IpAddress = UserSession.Current.UserIP;

        pushEntityMaster.PushDBEntity = new List<PushDBEntity>();
        PushDBEntity pushEntity = new PushDBEntity();
        pushEntity.Type = hidPushType.Value.Trim();
        pushEntity.UserGroupList = hidUserGroupList.Value.Trim();
        pushEntityMaster.PushDBEntity.Add(pushEntity);

        if ("0".Equals(hidPushType.Value))
        {
            pushEntityMaster = PushBP.SelectPushInfoAllUsersCount(pushEntityMaster);
            if (pushEntityMaster.QueryResult.Tables.Count > 0 && pushEntityMaster.QueryResult.Tables[0].Rows.Count > 0)
            {
                return pushEntityMaster.QueryResult.Tables[0].Rows[0][0].ToString();
            }
            else
            {
                return "0";
            }
        }
        else if ("1".Equals(hidPushType.Value))
        {
            pushEntityMaster = PushBP.SelectPushInfoUserGroupCount(pushEntityMaster);
            if (pushEntityMaster.QueryResult.Tables.Count > 0 && pushEntityMaster.QueryResult.Tables[0].Rows.Count > 0)
            {
                return pushEntityMaster.QueryResult.Tables[0].Rows[0][0].ToString();
            }
            else
            {
                return "0";
            }
        }
        else
        {
            return _iAllCount.ToString();
        }
    }
Exemplo n.º 23
0
        public static PushEntity SelectPushUserGroupCount(PushEntity PushEntity)
        {
            OracleParameter[] parm ={
                                    new OracleParameter("UserGroups",OracleType.VarChar)
                                };
            PushDBEntity dbParm = (PushEntity.PushDBEntity.Count > 0) ? PushEntity.PushDBEntity[0] : new PushDBEntity();

            string strUserGroupList = string.Empty;
            string[] userGroupList = dbParm.UserGroupList.Split(',');

            foreach (string strTemp in userGroupList)
            {
                if(String.IsNullOrEmpty(strTemp.Trim()))
                {
                    continue;
                }
                strUserGroupList = strUserGroupList + strTemp.Trim().Substring(1, strTemp.IndexOf(']') - 1) + ",";
            }
            parm[0].Value = strUserGroupList;
            PushEntity.QueryResult = HotelVp.Common.DBUtility.DbManager.Query("Push", "t_lm_push_user_group_count", false, parm);
            return PushEntity;
        }