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)); } }
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>"; } }