Example #1
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>";
     }
 }
Example #2
0
 public bool Insert_Development(Apps_Development Design)
 {
     if (design.AppsPermision(Design.RegID))
     {
         StringGenarator _Random = new StringGenarator();
         _Random.Number      = true;
         _Random.ApperCase   = true;
         _Random.TotalString = __Settings.Get_InValue_Settings(10002);//hou much number
         var            aid        = _Random.RandomStringNumber("aid");
         DateTimeZone   __datetime = new DateTimeZone(Design.Offset);
         SqlParameter[] Parameter  = new SqlParameter[] {
             new SqlParameter("@aid", aid),
             new SqlParameter("@RegID", Design.RegID),
             new SqlParameter("@Template_Id", Design.Template_Id),
             new SqlParameter("@Title", Design.Title),
             new SqlParameter("@Discription", Design.Discription),
             new SqlParameter("@App_Category_Id", Design.App_Category_Id),
             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.YoutubeVideoEnable.ToString().ToLower()),
             new SqlParameter("@YoutubeVideoLink", Design.YoutubeVideoLink),
             new SqlParameter("@OpenDate", __datetime.DateTimes()),
             new SqlParameter("@PublishDate", ""),
             new SqlParameter("@EncryptionEnable", ""),
             new SqlParameter("@EncryptionKey", ""),
             new SqlParameter("@Antiinjection", ""),
             new SqlParameter("@SEO", Design.SEO.ToString().ToLower()),
             new SqlParameter("@VersionUpgrade", Design.VersionUpgrade.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("@version", ""),
             new SqlParameter("@versionDetails", ""),
             new SqlParameter("@imgaePath", Design.imgaePath),
             new SqlParameter("@imageSize", Design.imageSize),
             new SqlParameter("@PublicMode", Design.PublicMode.ToString().ToLower())
         };
         bool returnValue = __Check.ExcutionNonQuery(@"insert into System_Apps (aid ,RegID,Template_Id,Title,Discription,App_Category_Id,CategoryName,Tag,Price,DatabaseOwn,DB_ID,YoutubeVideoEnable,YoutubeVideoLink,OpenDate,PublishDate,EncryptionEnable,EncryptionKey,Antiinjection,SEO,VersionUpgrade,SpeedOptimization,Testing,Support,Published,EditAccess,version,versionDetails,imgaePath,imageSize,PublicMode) 
     values(@aid ,@RegID,@Template_Id,@Title,@Discription,@App_Category_Id,@CategoryName,@Tag,@Price,@DatabaseOwn,@DB_ID,@YoutubeVideoEnable,@YoutubeVideoLink,@OpenDate,@PublishDate,@EncryptionEnable,@EncryptionKey,@Antiinjection,@SEO,@VersionUpgrade,@SpeedOptimization,@Testing,@Support,@Published,@EditAccess,@version,@versionDetails,@imgaePath,@imageSize,@PublicMode)", Parameter);
         App_ID       = __Check.stringCheck("select App_Id from System_Apps where aid='" + aid + "'");
         ErrorMessege = __Check.Messege;
         return(returnValue);
     }
     else
     {
         ErrorMessege = "Your are create your maximam application now you can't create. please buy creadit!";
         return(false);
     }
 }