DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR
SET @Cursor = CURSOR FAST_FORWARD FOR
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']'
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME
OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql
WHILE (@@FETCH_STATUS = 0)
BEGIN
Exec SP_EXECUTESQL @Sql
FETCH NEXT FROM @Cursor INTO @Sql
END
CLOSE @Cursor DEALLOCATE @Cursor
GO
EXEC sp_MSForEachTable 'DROP TABLE ?'
GO
DECLARE @procedureName varchar(500)
DECLARE cur CURSOR
FOR SELECT [name] FROM sys.objects WHERE type = 'p'
OPEN cur
FETCH NEXT FROM cur INTO @procedureName
WHILE @@fetch_status = 0
BEGIN
EXEC('DROP PROCEDURE ' + @procedureName)
FETCH NEXT FROM cur INTO @procedureName
END
CLOSE cur
DEALLOCATE cur
#region Enail
var MailDetails = (from objemail in objDb.tblEmailSettings where objemail.EmailSettingsID == EmailSettingsID && objemail.IsActive == true select objemail).Single();
if (userDetail != null)
{
if (MailDetails.EmailSettingsID > 0)
{
Utility formail = new Utility();
string Tomail = userDetail.Email;
//string FromMail = System.Configuration.ConfigurationManager.AppSettings["MailUid"].ToString();
string FromMail = "kesri.software@gmail.com";
string Subject = MailDetails.EmailSubject;
string Body = MailDetails.EmailBody;
//[First Name]<br /> [Middle Name]<br /> [Last Name]<br /> [Email]<br /> [Password]<br /> [ApplicationId]<br /> [Coupon Code]<br /> [Message]<br /> [Site Address]<br />
Body = Body.Replace("[First Name]", userDetail.First_Name);
Body = Body.Replace("[Middle Name]", "");
Body = Body.Replace("[Last Name]", userDetail.Last_Name);
Body = Body.Replace("[Email]", userDetail.Email);
string pas = ClsDataEncryption.Decrypt(userDetail.Password.Trim(), "passKey");
Body = Body.Replace("[Password]", pas);
Body = Body + " http://www.globicle.com";
Body = HttpUtility.HtmlDecode(Body);
bool u = formail.SendMail(Tomail, FromMail, Subject, Body);
if (u == true)
{
return Json(new ClsJsonResult { Result = true });
}
else
{
return Json(new ClsJsonResult { Result = false });
}
}
}
#endregion
No comments:
Post a Comment