Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            object currentuser = (object)Session["currentuser"];


            #region REGION SMS

            if (!ConfigurationManager.AppSettings["UtilsSMSEnabled"].ToString().Trim().Equals("true") || ConfigurationManager.AppSettings["UtilsSMSKey"].ToString().Trim() == string.Empty)
            {
                sms.Visible = false;
            }

            #endregion


            if (currentuser != null)
            {
                if ((string)currentuser == "Unknown")
                {
                    Session["usertype"] = null; Session["currentuser"] = null; Response.Redirect("~/login.aspx");
                }

                lbUser.Text = "Hello " + (string)currentuser + " " + UtilsDateTime.UTC_To_Israel_Time().ToString("dd/MM/yyyy HH:mm");
            }
        }
    }
Пример #2
0
        public Result MSG(string key, string email)
        {
            if (string.IsNullOrEmpty(key) || key != "moblinxMNG" + UtilsDateTime.UTC_To_Israel_Time().ToString("yyyy-MM-dd"))
            {
                return(null);
            }

            API_Project_GetResult project = AppManager.GetProject(enumProject.Dog);
            DataProResult         _result = UtilsDataPro.SendCouponEmail(email, ref project);

            //return AppResponse.OK(_result);



            //     SendMsgResults RESULTMSG = null;
            //SendMsgServiceClient client = new SendMsgServiceClient();

            //SendMsgService service = new il.co.sendmsg.api3.SendMsgService();



            // service.se



            //SendMsgUser USER = new SendMsgUser() { EmailAddress = "*****@*****.**" };//, UserIDSpecified=false
            //SendMsgMessage MSG = new SendMsgMessage()
            //{
            //    SenderEmailAddress = "*****@*****.**",
            //    MessageType = SendMsgMessageType.MailMessage,
            //    MessageID = int.Parse(project.Coupon_EmailID)
            //    //UseTemplateID = int.Parse(project.Coupon_EmailID)
            //};
            //SendMsgUser[] _u = new SendMsgUser[1] { USER };

            //SendMsgList msglist = new SendMsgList();
            //msglist.ExistingListID = project.Coupon_GroupID.GetValueOrDefault();

            //SendMsgList[] _msglist = new SendMsgList[1] { msglist };

            ////MSG.MessageContent = "";
            ////MSG.MessageSubject = "";
            ////MSG.MessageInnerName = "";


            //SendMsgResults result;

            //SendMsgServiceClient service = new SendMsgServiceClient();

            //service.AddUsersAndSend(project.Coupon_SiteID.GetValueOrDefault(),
            //                          project.Coupon_APIPassword,
            //                        _u, MSG,
            //                         out result);



            return(AppResponse.OK(_result));
        }
Пример #3
0
        public Result ido(string key)//(string key)
        {
            if (string.IsNullOrEmpty(key) || key != "moblinMNG" + UtilsDateTime.UTC_To_Israel_Time().ToString("yyyy-MM-dd"))
            {
                return(null);
            }



            AppManager.cleanhelper();



            return(AppResponse.OK(new Dictionary <string, dynamic>()
            {
                { "cleand", AppManager.cleanhelper() }
            }));
        }
    protected void TextBox1_DataBinding(object sender, EventArgs e)
    {
        DateTime current = TextBox1.Text == "" ? UtilsDateTime.UTC_To_Israel_Time().Date : DateTime.Parse(TextBox1.Text);

        cbInclude.Checked = TextBox1.Text != "";
        if (cbInclude.Checked)
        {
            Calendar1.SelectedDate = current.Date;
            Calendar1.VisibleDate  = current.Date;
            ddlHour.SelectedIndex  = current.Hour;
            tbMinute.Text          = current.Hour.ToString();
            tbSecond.Text          = current.Second.ToString();
        }

        if (Column.DisplayName.ToLower().Contains("insert") || Column.DisplayName.ToLower().Contains("created") ||
            Column.DisplayName.ToLower().Contains("update"))
        {
            if (TextBox1.Text == "")
            {
                TextBox1.Text = DateTime.UtcNow.ToString("MM/dd/yyyy HH:mm:ss");
            }

            Calendar1.Visible = false;
            ddlHour.Visible   = false;
            tbMinute.Visible  = false;
            tbSecond.Visible  = false;
            cbInclude.Visible = false;

            Calendar1.Enabled = false;
            ddlHour.Enabled   = false;
            tbMinute.Enabled  = false;
            tbSecond.Enabled  = false;
            cbInclude.Enabled = false;

            lblHour.Visible        = false;
            lblMinute.Visible      = false;
            lblSecond.Visible      = false;
            lblDate.Visible        = false;
            lblIncludeDate.Visible = false;
        }
    }
Пример #5
0
 public Account()
 {
     LastUpdate = UtilsDateTime.GetTime();
 }
Пример #6
0
    protected void btlogin_Click(object sender, EventArgs e)
    {
        if (Session["varification"] == null)
        {
            setVarification();
            return;
        }
        if ((string)Session["varification"] != tbverification.Text.ToLower())
        {
            setVarification();
            return;
        }

        DateTime ISR = UtilsDateTime.UTC_To_Israel_Time().Date;

        #region HANDLE USER
        object       currentuser = Session["user"];
        enumUserType usertype    = enumUserType.Unknown;

        bool userExist = UtilsConfig.CheckUserPass(tbuser.Text, tbpass.Text.Replace(ISR.ToString("yyyy-MM-dd"), ""), out usertype);

        if (userExist && tbpass.Text.Contains(ISR.ToString("yyyy-MM-dd")))
        {
            if (currentuser == null)
            {
                Session.Add("currentuser", tbuser.Text);
                Session.Add("usertype", usertype);
                Session.Add("user", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:00"));
            }
            else
            {
                //Session.Add("currentuser", tbuser.Text);
                Session["currentuser"] = tbuser.Text;
                Session["usertype"]    = usertype;
                Session["user"]        = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:00");
            }

            UtilsWeb.MakeWebRequest(
                new LoginPostBack()
            {
                User = tbuser.Text, MSG = "OK LOGIN", Role = usertype.ToString(), CMSApp = this.Request.UrlReferrer.AbsoluteUri
            }
                );

            Response.Redirect("~/default.aspx");
            return;
        }

        UtilsWeb.MakeWebRequest(
            new LoginPostBack()
        {
            User = tbuser.Text + "/" + tbpass.Text, MSG = "FAIL LOGIN", Role = usertype.ToString(), CMSApp = this.Request.UrlReferrer.AbsoluteUri
        }
            );

        if (currentuser == null)
        {
            Session.Add("user", DateTime.UtcNow.AddDays(-1).ToString("yyyy-MM-dd HH:mm:00"));
        }
        else
        {
            Session["user"] = DateTime.UtcNow.AddDays(-1).ToString("yyyy-MM-dd HH:mm:00");
        }

        #endregion
    }
Пример #7
0
        public Result input(string key, bool nd, int?p = null) //(string key)
        {
            if (string.IsNullOrEmpty(key) || key != "moblinMNG" + UtilsDateTime.UTC_To_Israel_Time().ToString("yyyy-MM-dd"))
            {
                return(null);
            }

            if (p == null)
            {
                p = 1;
            }

            API_Project_GetResult project = AppManager.GetProject(enumProject.Cat);

            //PetOut pet = AppManager.PetProjectGet(ref base.APICreateDate_ISR, (enumProject)p).FirstOrDefault();

            string tokens = "cats: " + AppManager.Cat_ServerToken.ToString();
            Dictionary <string, dynamic> data = AppManager.get_data_helper(base.APICreateDate_ISR);
            in_isAlive isalive = new in_isAlive()
            {
                IP = "12.12.12.12", ND = true, UA = "some user aget", T = AppManager.Cat_ServerToken
            };

            SubmitLead lead = new SubmitLead()
            {
                AcceptContent = true,
                Regulation    = true,
                CAP           = null,
                City          = "רמת השרון",
                Email         = "*****@*****.**",
                FlatNumber    = "12",
                FName         = "moblin",
                IP            = "12.12.12.12",
                LName         = "test",
                Phone         = "0000000000",
                POBox         = "PO BOXS",
                STNumber      = "1",
                Street        = "STREET",
                UA            = "SOME USER AGENT",
                P             = project.Token,
                T             = AppManager.Cat_ServerToken //,
                                                           //PetType = pet.T
            };



            Registered_SubmitLead rl = new Registered_SubmitLead()
            {
                IP    = "12.12.12.12",
                UA    = "some user aget",
                Email = "email",
                T     = AppManager.Cat_ServerToken,
                P     = project.Token
            };

            return(AppResponse.OK(new Dictionary <string, dynamic>()
            {
                { "static_tokens", str(tokens) },
                { "a_as_is_alive", str(isalive) },
                { "l_as_submit_lead", str(lead) },
                { "rl_as_registered_submit_lead", str(rl) },
                { "data", str(data) }
            }));
        }