Esempio n. 1
0
        /// <summary>
        /// 供应商发送短信验证码
        /// </summary>
        /// <param name="PhoneNum">手机号</param>
        /// <returns></returns>
        /// <remarks>added by jimmy,2015-9-28</remarks>
        public PhoneMsg SendMerchatPhoneCode(string PhoneNum)
        {
            string   phoneCode = CodeHelper.GetRandomNumber(6);
            PhoneMsg phonMsg   = new PhoneMsg();

            if (System.Web.HttpContext.Current.Session["SupCodeMsg"] != null)
            {
                PhoneCodeMsg codeMsg = (PhoneCodeMsg)System.Web.HttpContext.Current.Session["SupCodeMsg"];
                DateTime     oldTime = Convert.ToDateTime(codeMsg.GetPhoneMsgDateTime);
                double       Seconds = (DateTime.Now - oldTime).TotalSeconds;
                if (Seconds < 60)
                {
                    phonMsg.IsMessage = false;
                    phonMsg.PhoneCode = phoneCode;
                    // phonMsg.Msg = CultureHelper.GetLangString("LOGIN_SEND_TIMERANGE");//两次发送短信时间间隔不得小于60秒
                    phonMsg.PhoneCode = "次发送短信时间间隔不得小于60秒";
                    return(phonMsg);
                }
            }
            ResultHelper result = new ResultHelper();

            //是否假发送短信,为true值时,表示伪假短信,反之,表示真发送短信
            if (Settings.IsMessageEM)
            {
                result.Code = 1;
                phoneCode   = "666666";
            }
            else
            {
                result = SMSCommon.QTSubmitSMS((int)ESendType.AnyContent, PhoneNum, phoneCode, string.Format("尊敬的惠卡用户:您好!您正在进行账号操作,验证码是{0},如有疑问请致电026355484", phoneCode), (int)EBusinessType.RetrievePwd);
            }
            if (result.Code == 1)
            {
                phonMsg.IsMessage = true;
                // phonMsg.Msg = CultureHelper.GetLangString("LOGIN_SEND_SUCCESS");//发送成功
                phonMsg.Msg = "发送成功";
            }
            else
            {
                phonMsg.IsMessage = false;
                // phonMsg.Msg = CultureHelper.GetLangString("LOGIN_SEND_FAILURE");//发送失败
                phonMsg.Msg = "发送失败";
            }
            phonMsg.PhoneCode = phoneCode;
            PhoneCodeMsg codeSession = new PhoneCodeMsg();

            codeSession.GetPhoneMsgDateTime = DateTime.Now;
            codeSession.PhoneNum            = PhoneNum;
            codeSession.PhoneCode           = phoneCode;
            System.Web.HttpContext.Current.Session["SupCodeMsg"] = codeSession;
            return(phonMsg);
        }
Esempio n. 2
0
        protected void grdShiftStaff_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string script = "";

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GridViewRow gr = e.Row;
                DataRowView dr = (DataRowView)gr.DataItem;
                if (dr != null)
                {
                    if (dr[2].ToString() == "0")
                    {
                        ddlShift.Enabled = true;
                        //ddlShift0.Enabled = true;
                        txtDeployDate.Enabled = true;
                        //txtDeployDate1.Enabled = true;
                    }
                    else
                    {
                        // ddlShift.Enabled = false;
                        // txtDeployDate.Enabled = false;
                    }
                    string         MDate = dr[0].ToString();
                    GridView       gv    = ((GridView)gr.Cells[1].FindControl("grdSchedule"));
                    SqlParameter[] para  = new SqlParameter[4];
                    para[0] = new SqlParameter("@LocationID", ddlSite.SelectedValue);
                    para[1] = new SqlParameter("@WeekID", ddlWeek.SelectedValue);
                    para[2] = new SqlParameter("@MonthID", hdnMonthID.Value);
                    para[3] = new SqlParameter("@MDate", MDate);
                    DataTable dt  = dal.executeprocedure("usp_GetWeeklySchedule", para, false);
                    DataTable dt1 = SMSCommon.ConvertRowsToColumns(dt, "Shift", "StaffName");
                    gv.AutoGenerateColumns = false;
                    for (int i = 0; i <= gv.Columns.Count; i++)
                    {
                        try
                        {
                            gv.Columns.RemoveAt(0);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    try
                    {
                        gv.Columns.RemoveAt(0);
                    }
                    catch (Exception ex)
                    { }

                    foreach (DataColumn dc in dt1.Columns)
                    {
                        TemplateField makeliveCol = new TemplateField();
                        makeliveCol.ItemTemplate      = new CreateItemTemplateLinkBtn(System.Guid.NewGuid().ToString().Split('-')[System.Guid.NewGuid().ToString().Split('-').Length - 1], dc.ColumnName, "Select", "return confirm('Are you sure you want to publish this version?')");
                        makeliveCol.HeaderText        = dc.ColumnName;
                        makeliveCol.HeaderStyle.Width = Unit.Pixel(180);
                        makeliveCol.ItemStyle.Height  = Unit.Pixel(30);
                        gv.Columns.Add(makeliveCol);
                    }
                    gv.DataSource = dt1;
                    gv.DataBind();
                    foreach (GridViewRow gvr in gv.Rows)
                    {
                        foreach (TableCell tc in gvr.Cells)
                        {
                            try
                            {
                                LinkButton lnk = ((LinkButton)tc.Controls[0]);
                                script += "AttachContextMenu('" + lnk.ClientID + "','" + lnk.ToolTip + "','" + ddlSite.SelectedValue.ToString() + "','" + lnk.CommandArgument + "');";
                            }
                            catch (Exception ex)
                            { }
                        }
                    }
                }
                Session["script"] += script;
            }
        }