示例#1
0
        private string ResendCode(string Number)
        {
            try
            {
                ECMS.WebPage.Settings settings = new ECMS.WebPage.Settings();
                StringGenarator       _Random  = new StringGenarator();
                _Random.Number      = true;
                _Random.TotalString = 5;
                var OTP = _Random.RandomStringNumber("OTP");
                OTP_Code = OTP.ToString();

                var    SettingMessage = settings.Get_StringValue_Settings(1);
                string Message        = string.Format("" + SettingMessage, OTP);
                if (_send.OtpSet(OTP, RegID) && _send.SendSMS(Number, Message))
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "countdown(5);", true);
                    return(string.Format(@"<div class='alert alert-success'>{0}</div>", "Please Check your mobile the code is send."));
                }
                else
                {
                    return(string.Format(@"<div class='alert alert-danger'>{0}</div>", "Error Code10: " + _send.Message));
                }
            }
            catch (Exception er)
            {
                return(string.Format(@"<div class='alert alert-danger'>{0}</div>", "Error Code11: " + _send.Message));
            }
        }
示例#2
0
 protected void btnTemplate_Click(object sender, EventArgs e)
 {
     if (txtTitle.Text != "" && txtDiscription.Text != "" && FileUpload1.HasFile)
     {
         string FileName  = FileUpload1.FileName.ToLower();
         string Extension = Path.GetExtension(FileName);
         if (Extension == ".jpg" || Extension == ".jpeg" || Extension == ".png")
         {
             double fileSize = FileUpload1.PostedFile.ContentLength;
             if (fileSize <= 2097152)
             {
                 if (de.AppsPermision(((CMSmaster)this.Master).RegID))
                 {
                     fileSize = fileSize / 1024;//bytes to kilobytes
                     var                   localPath = "image/" + ((CMSmaster)this.Master).RegID + "/";
                     var                   Path      = Server.MapPath("~/" + localPath);
                     StringGenarator       random    = new StringGenarator();
                     ECMS.WebPage.Settings settings  = new ECMS.WebPage.Settings();
                     random.Number      = true;
                     random.ApperCase   = true;
                     random.LowerCase   = true;
                     random.TotalString = settings.Get_InValue_Settings(10003);
                     string ImageName = random.RandomStringNumber("trmplateImage");
                     if (Directory.Exists(Path))
                     {
                         //-------- output
                         Output(localPath + ImageName + Extension, fileSize);
                     }
                     else
                     {
                         Directory.CreateDirectory(Path);
                         //---------- output
                         Output(localPath + ImageName + Extension, fileSize);
                     }
                 }
                 else
                 {
                     lblResult.Text = "<div class='alert alert-danger'>You are already insert Maximum Appication you can not add more applicaion. Add more Application<a href='#'> Click here </a> </div>";
                 }
             }
             else
             {
                 lblResult.Text = "<div class='alert alert-danger'>Upload Maximum 2MB image file.</div>";
             }
         }
         else
         {
             lblResult.Text = "<div class='alert alert-danger'>Upload your template image in *jpg *jpeg .png formate.</div>";
         }
     }
     else
     {
         lblResult.Text = "<div class='alert alert-danger'>Must be need title and discription to tenplate.</div>";
     }
 }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //ip.IPDetails();

            //con.DatabaseName = "sad";
            //Response.Write(chk.int32Check("select count(*) from DeveloperRegistation"));
            StringGenarator ran = new StringGenarator();

            ran.TotalString   = 10;
            ran.DatabaseEntry = false;
            ran.Hexadecimal   = true;

            Response.Write(ran.RandomStringNumber("test", 2, '-'));
        }
示例#4
0
 private bool _Private_DesignUpload(DesignDetails Design)
 {
     if (AppsPermision(Design.RegID))
     {
         StringGenarator _Random = new StringGenarator();
         _Random.Number      = true;
         _Random.ApperCase   = true;
         _Random.TotalString = __Settings.Get_InValue_Settings(10002);//hou much number
         var            tid        = _Random.RandomStringNumber("tid");
         DateTimeZone   __datetime = new DateTimeZone(Design.Offset);
         SqlParameter[] Parameter  = new SqlParameter[] {
             new SqlParameter("@RegID", Design.RegID),
             new SqlParameter("@Title", Design.Title),
             new SqlParameter("@Discription", Design.Discription),
             new SqlParameter("@App_Category_Id", Design.CategoryID),
             new SqlParameter("@CategoryName", Design.CategoryName),
             new SqlParameter("@Tag", Design.Tag),
             new SqlParameter("@Price", Design.Price),
             new SqlParameter("@DatabaseOwn", "true"),
             new SqlParameter("@DB_ID", __Settings.Get_InValue_Settings(3)),
             new SqlParameter("@YoutubeVideoEnable", Design.YoutubeEnable.ToString().ToLower()),
             new SqlParameter("@YoutubeVideoLink", Design.YoutubeLink),
             new SqlParameter("@OpenDate", __datetime.DateTimes()),
             new SqlParameter("@PublishDate", ""),
             new SqlParameter("@SEO", Design.SEO.ToString().ToLower()),
             new SqlParameter("@VersionUpgrade", Design.Version.ToString().ToLower()),
             new SqlParameter("@SpeedOptimization", Design.SpeedOptimization.ToString().ToLower()),
             new SqlParameter("@Testing", Design.Testing.ToString().ToLower()),
             new SqlParameter("@Support", Design.Support.ToString().ToLower()),
             new SqlParameter("@Published", "false"),
             new SqlParameter("@EditAccess", "true"),
             new SqlParameter("@tid", tid),
             new SqlParameter("@imgaePath", Design.imgaePath),
             new SqlParameter("@imageSize", Design.imageSize),
             new SqlParameter("@PublicMode", Design.PublicMode.ToString().ToLower())
         };
         bool returnValue = __Check.ExcutionNonQuery(@"insert into System_Template (RegID,Title,Discription,App_Category_Id,CategoryName,Tag,Price,DatabaseOwn,DB_ID,YoutubeVideoEnable,YoutubeVideoLink,OpenDate,PublishDate,SEO,VersionUpgrade,SpeedOptimization,Testing,Support,Published,EditAccess,tid,imgaePath,imageSize,PublicMode) 
     values(@RegID,@Title,@Discription,@App_Category_Id,@CategoryName,@Tag,@Price,@DatabaseOwn,@DB_ID,@YoutubeVideoEnable,@YoutubeVideoLink,@OpenDate,@PublishDate,@SEO,@VersionUpgrade,@SpeedOptimization,@Testing,@Support,@Published,@EditAccess,@tid,@imgaePath,@imageSize,@PublicMode)", Parameter);
         Template_ID  = __Check.stringCheck("select Template_Id from System_Template where tid='" + tid + "'");
         ErrorMessege = __Check.Messege;
         return(returnValue);
     }
     else
     {
         ErrorMessege = "Your are create your maximam application now you can't create. please buy creadit!";
         return(false);
     }
 }
示例#5
0
        private bool _Reg()
        {
            AntiInjection ant = new AntiInjection();

            ant.Email    = true;
            ant.Password = true;
            ant.Url      = true;
            //------------------------------------------
            // anti injection for security purpass
            // it will secure the boolien methord
            //------------------------------------------
            if (ant.StringData(FirstName) &&
                ant.StringData(SureName) &&
                ant.StringData(Email) &&
                ant.StringData(UserName) &&
                ant.StringData(Password) &&
                ant.StringData(Mobile))
            {
                Security_ = true;

                /*---------------------------------
                 *   security is done now the insert and encript process
                 * ----------------------------------*/
                if (UserName_Avaiable(UserName) && Mobile_Avaiable(Mobile) && Email_Avaiable(Email))
                {
                    try
                    {
                        int  Max_App      = 2;/// Comming from main db settings
                        bool EmailVerify  = false;
                        bool MobileVerify = false;
                        //----------------------------------------------
                        Bind();
                        //-----------------------------------------------
                        //-----------------------------------------------
                        StringGenarator __ran = new StringGenarator();
                        __ran.TotalString = 10;/// setting update
                        //-------------------------------------------
                        __ran.Hexadecimal = true;
                        string Encrypt_Key = __ran.RandomStringNumber("DeveloperRegistation", 2, '-');
                        __ran.TotalString   = 5;
                        __ran.Number        = true;
                        __ran.Hexadecimal   = false;
                        __ran.DatabaseEntry = false;
                        string OTP = __ran.RandomStringNumber("OPT");
                        this.OTP            = OTP;
                        __ran.TotalString   = 20;
                        __ran.Number        = true;
                        __ran.ApperCase     = true;
                        __ran.DatabaseEntry = false;
                        string EmailCode = __ran.RandomStringNumber("EmailCode");
                        this.EmailCode = EmailCode;
                        //------------------------------------------------
                        //------------------------------------------------
                        Check    __Chk       = new Check();
                        IPFinder _IPLocation = new IPFinder();
                        //_IPLocation.IPDetails();
                        var          Offset = __Chk.stringCheck("select Offset from TimeZone where Time_Zone='" + _IPLocation.TimeZone + "' ");
                        DateTimeZone __Dt   = new DateTimeZone(Offset);
                        this.Offset = Offset;
                        Settings __Settings = new Settings();
                        var      MaxStorage = __Settings.Get_InValue_Settings(2);//Max Storage in Settings
                        this.MaxStorage = MaxStorage;
                        bool f1 = __Chk.ExcutionNonQuery(string.Format(@"insert into DeveloperRegistation (FastName,LastName,UserName,Email,Mobile,Country,Country_ID,Max_Apps,EmailVerify,MobileVerify,Profileimage,imagebyte,Active,EmailShow,NumberShow,JoinDate,AccountAbility,MaxStorage)
                        values('{0}','{1}','{2}','{3}','{4}','{5}',{6},{7},'{8}','{9}','{10}',{11},'{12}','{13}','{14}','{15}','{16}',{17})",
                                                                       FirstName, SureName, UserName, Email, Mobile, Country, __Chk.stringCheck("select Country_ID from Country where Country_Name='" + Country + "'"), Max_App, EmailCode, OTP, "image/Profile/noimage.jpg", 24576, "Online", "true", "true", __Dt.DateTimes(), "true", MaxStorage));
                        string _Registation_id = __Chk.stringCheck("select Reg_ID from DeveloperRegistation where UserName='******'");

                        //randomly add the encrypt key it unique
                        Encrypt __Enc = new Encrypt();
                        __Enc.EncryptCode = Encrypt_Key;
                        Key = Encrypt_Key;
                        // set the encript key to add database
                        string _UserName = __Enc.HashCode(UserName);
                        string _Password = __Enc.HashCode(Password);
                        bool   f2        = __Chk.ExcutionNonQuery(string.Format(@"insert into Login (Reg_ID,UserName,Password,Encrypt_Code) values({0},'{1}','{2}','{3}')", _Registation_id, _UserName, _Password, Encrypt_Key));
                        Messege_      = string.Format(@"<div class='alert alert-icon-success' role='alert'>
                                <i data-feather='alert-circle'></i>
                                   {0}
                             </div> ", "Registation Complete.");
                        _EmailVerify  = EmailVerify;
                        _MobileVerify = MobileVerify;

                        RegID   = __Chk.stringCheck("select Reg_ID from DeveloperRegistation where UserName='******' ");
                        LoginID = __Chk.stringCheck("select Login_ID from Login where UserName='******' ");
                        if (f1 && f2)
                        {
                            return(true);
                        }
                        else
                        {
                            Messege_ = string.Format(@"<div class='alert alert-icon-danger' role='alert'>
                                <i data-feather='alert-circle'></i>
                                   {0}
                             </div> ", __Chk.Messege);
                            return(false);
                        }
                    }
                    catch (Exception er)
                    {
                        Messege_ = string.Format(@"<div class='alert alert-icon-danger' role='alert'>
                                <i data-feather='alert-circle'></i>
                                   {0}
                             </div> ", er.Message);
                        return(false);
                    }
                }
                else
                {
                    Messege_ = @"<div class='alert alert-icon-danger' role='alert'>
                                <i data-feather='alert-circle'></i>
                                   (Verify your Email, UserName, Moble)
                                   If All are not Avaiable. Try again!
                             </div> ";
                    return(false);
                }
            }
            else
            {
                Messege_ = @"<div class='alert alert-icon-danger' role='alert'>
                                <i data-feather='alert-circle'></i>
                                   Security Threat.
                             </div> ";
                return(false);
            }
        }