|
When you say YES to others,
Make sure you are not saying No to yourself
|
|
|
|
|
If a Single Teacher can't Teach us all the Subject then...
How could you expect a Single Student to Learn all Subject??
|
|
|
|
|
If you are not willing to learn.
No one can HELP you.
If you are determined to learn,
No one can STOP you.
|
|
|
|
|
FAITH sees the invisible,
believes the unbelievable, and
receives the impossible
|
|
|
|
|
Be STRONG when you are WEAK.
Be BRAVE when you are SCARED.
Be HUMBLE when you are VICTORIOUS.
|
|
|
|
|
Decreases Stress
Gives Good Sleep
Natural Pain Killer
Improves Breathing
Helps You Lose Weight
Makes You Look Young
Reduces Heart Desease
There's No Reason Not to LAUGH!
|
|
|
|
|
Laughing is the best medicine . Unless you are laughing for no reason ...then you need medicine.
|
|
|
|
|
I have created sample loading screen which is displayed on center of the screen.
following are the CSS:
<style type="text/css">
.dialog-background{
background: none repeat scroll 0 0 rgba(255, 0, 25, 0.5);
height: 100%;
left: 0;
margin: 0;
padding: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 100;
}
.dialog-loading-wrapper {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 0 none;
height: 100px;
left: 50%;
margin-left: -50px;
margin-top: -50px;
position: fixed;
top: 50%;
width: 100px;
z-index: 9999999;
}
.dialog-loading-icon {
background-color: #FFFFFF !important;
border-radius: 13px;
display: block;
height: 100px;
line-height: 100px;
margin: 0;
padding: 1px;
text-align: center;
width: 100px;
}
</style>
following are the HTML:
<div class="dialog-background">
<div class="dialog-loading-wrapper">
Loading....
</div>
</div>
Please let me know if you are facing issue with that
|
|
|
|
|
|
- Know more than others.
- Work more than others.
- Expect less than others.
sunaSaRa Imdadhusen
+91 99095 44184
modified 21-Nov-11 7:58am.
|
|
|
|
|
sir i want checkbox in grid view in Asp .net for web.
i also want to make add,update ,delete form there in grid view .
|
|
|
|
|
Hi, this is a wrong place to write your questions... You could go to "Ask Question" section..
---------
Cheers,
Kiran (http://kirandangar.wordpress.com/)
|
|
|
|
|
Not Thereee it should be Three.... Imdad bhai
|
|
|
|
|
Thanks for correcting my typo
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
http://www.asp.net/mvc/overview/older-versions/getting-started-with-ef-5-using-mvc-4/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application[^]
IRepository.cs
---------------
public interface IRepository<T> where T : class
{
List<T> GetAll(Expression<Func<T, bool>> filter);
T GetByID(int id);
T Insert(T model);
void Delete(int id);
void Update(T entityToUpdate);
}
Repository.cs
---------------
public class Repository<T> : IRepository<T> where T : class
{
TestDBEntities entities;
DbSet<T> dbSet;
public Repository(TestDBEntities _entities)
{
entities = _entities;
dbSet = entities.Set<T>();
}
public List<T> GetAll(Expression<Func<T, bool>> filter = null)
{
if (filter == null)
return dbSet.ToList<T>();
else
return dbSet.Where(filter).ToList<T>();
}
public virtual T GetByID(int id)
{
return dbSet.Find(id);
}
public virtual T Insert(T model)
{
return dbSet.Add(model);
}
public virtual void Delete(int id)
{
T modelToDelete = dbSet.Find(id);
if (entities.Entry(modelToDelete).State == EntityState.Detached)
{
dbSet.Attach(modelToDelete);
}
dbSet.Remove(modelToDelete);
}
public virtual void Update(T entityToUpdate)
{
dbSet.Attach(entityToUpdate);
entities.Entry(entityToUpdate).State = EntityState.Modified;
}
}
UnitOfWork.cs
---------------
public class UnitOfWork : IDisposable
{
private bool disposed = false;
private TestDBEntities entities = new TestDBEntities();
private Repository<Book> bookRepository;
public Repository<Book> BookRepository
{
get
{
if (this.bookRepository == null)
this.bookRepository = new Repository<Book>(entities);
return bookRepository;
}
}
public void Save()
{
entities.SaveChanges();
}
protected virtual void Dispose(bool disposing){
if(!this.disposed)
{
if(disposing)
entities.Dispose();
}
disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
BooksController.cs
---------------
public class BooksController : Controller
{
UnitOfWork unitofwork = new UnitOfWork();
public ActionResult Index()
{
List<Book> books = GetAllBook();
return View(books);
}
public List<Book> GetAllBook()
{
return unitofwork.BookRepository.GetAll();
}
[HttpPost]
public ActionResult AddBook(Book model)
{
CallStatus cs = new CallStatus() { Status = "Success", Message = "Book added" };
try
{
unitofwork.BookRepository.Insert(model);
unitofwork.Save();
}
catch (Exception ex)
{
cs.Status = "Error";
cs.Message = ex.Message;
}
return Json(cs, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public ActionResult DeleteBook(int BookID)
{
CallStatus cs = new CallStatus() { Status = "Success", Message = "Book deleted" };
try
{
unitofwork.BookRepository.Delete(BookID);
unitofwork.Save();
}
catch (Exception ex)
{
cs.Status = "Error";
cs.Message = ex.Message;
}
return Json(cs, JsonRequestBehavior.AllowGet);
}
protected override void Dispose(bool disposing)
{
unitofwork.Dispose();
base.Dispose(disposing);
}
}
public class CallStatus
{
public string Status { get; set; }
public string Message { get; set; }
}
Index.cshtml
---------------
@using MvcSampleArchitecture.Models
@model IEnumerable<Book>
<table>
<thead>
<tr>
<td>Book Name</td>
<td>Auther</td>
<td>ISBN</td>
<td>Action</td>
</tr>
@foreach (var book in Model)
{
<tr>
<td>@book.BookName</td>
<td>@book.AutherName</td>
<td>@book.ISBN</td>
<td><a class="btnDelete" data-id="@book.ID">Delete</a></td>
</tr>
}
</thead>
</table>
@using (Html.BeginForm("AddBook", "Books", FormMethod.Post, new { name = "frmBook", id = "frmBook" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary()
<fieldset>
<legend>Change Password Form</legend>
<ol>
<li>
<input type="text" id="BookName" name="BookName" data-val-required="The Book Name field is required." data-val="true" />
</li>
<li>
<input type="text" id="AutherName" name="AutherName" data-val-required="The Auther Name field is required." data-val="true" />
</li>
<li>
<input type="text" id="ISBN" name="ISBN" data-val-required="The ISBN field is required." data-val="true" />
</li>
</ol>
<input type="button" id="btnAddBook" value="Add New Book" />
</fieldset>
}
<script>
$(document).ready(function () {
$("#btnAddBook").click(function (e) {
var form = $('#frmBook');
form.validate();
if (form.valid()) {
ajax("POST", "@Url.Action("AddBook", "Books")", form.serialize(), function (data) {
alert("Book Added!");
});
}
return false;
});
$('.btnDelete').on('click', function () {
var id = $(this).data('id');
deleteBook(id);
})
function deleteBook(bookid) {
ajax("POST", "@Url.Action("DeleteBook", "Books")", { "BookID": bookid }, function (data) {
alert("Book Deleted!");
});
}
function ajax(type, url, data, successCallback, errorCallback) {
$.ajax({
type: type,
url: url,
dataType: "json",
data: data,
success: function (data) {
if (data.Status.toUpperCase() == "SUCCESS") {
if (successCallback != undefined && successCallback != null)
successCallback.call(this, data);
}
else
alert("Error");
},
error: function (err) {
alert(err);
}
});
}
});
</script>
modified 23-Apr-15 1:53am.
|
|
|
|
|
|
|
Thanks,
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Thanks Sunasara, It helped me at right time.
|
|
|
|
|
Thanks.
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Memorable moment are celebrated together,
Here is a wishing that the coming year is a glorious one
that rewards all your future endeavors with success.
H a p p y N e w Y e a r
from
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
hey!!! your comments on the Developing a USB Storage Device Protection Tool with C# by ozcan ilikahn, could you plz tell me if that really works, im using it on a account with out admin powers and it says it requires .NET framework.....could you plz help me with the specifications of the app reqirements and let me if teh app rlly works or not..... i am a final year comp sc engg student, this is needed as a part of my project.
also if you can suggest any free softwares that helps in keepin a log of data being copied to usb drive......plz plzz help
|
|
|
|
|
Hi,
I am happy with your comments.
USB Storage Device is really great tool for to lock and unlock with or without password protection is need to run with only Microsoft .Net Framework 2.0 prerequisite.
You can download Microsoft .Net Framework from here.[^]
Please do let me know, if you require any help in future.
Please make our relation as long
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
Thnx a ton for your help....but if could help me any which way through websites or technique that u knw ... here is my problem....
this is a text from wiki flash drive security page
Additional software on company computers may help track and minimize risk by recording the interactions between any USB drive and the computer and storing them in a centralized database.
what i need is a free software to this....plzzzzz help.
|
|
|
|
|
Same to you too.
|
|
|
|