public void delegateAuthority(String empName, DateTime fDate, DateTime tDate) { Delegate_User delUsr = new Delegate_User(); delUsr.Emp_ID = getEmpId(empName); delUsr.FromDate = fDate; delUsr.ToDate = tDate; delegateUser.createDelegateUser(delUsr); }
//>>>>>>>>>>>>>>>>>>>> public Delegate_User getDelegateUser(Delegate_User usr) { var relUsr = from u in ContextDB.Delegate_User where (u.Del_ID == usr.Del_ID || usr.Del_ID == null) && (u.Emp_ID == usr.Emp_ID || usr.Emp_ID == null) && (u.FromDate == usr.FromDate || usr.FromDate == null) && (u.ToDate == usr.ToDate || usr.ToDate == null) select u; return relUsr.First(); }
//<<D>> public bool deleteDelUser(Delegate_User delUsr) { try { ContextDB.Delegate_User.DeleteObject(delUsr); ContextDB.SaveChanges(); return true; } catch (Exception e) { return false; } }
//<<U>> public bool updateDelUser(Delegate_User updUsr) { try { Delegate_User usr = getDelegateUser(updUsr); usr.FromDate = updUsr.FromDate; usr.ToDate = updUsr.ToDate; ContextDB.SaveChanges(); return true; } catch (Exception e) { return false; } }
//<<C>> public void createDelegateUser(Delegate_User delUsr) { ContextDB.Delegate_User.AddObject(delUsr); ContextDB.SaveChanges(); }
/// <summary> /// Create a new Delegate_User object. /// </summary> /// <param name="del_ID">Initial value of the Del_ID property.</param> public static Delegate_User CreateDelegate_User(global::System.Int32 del_ID) { Delegate_User delegate_User = new Delegate_User(); delegate_User.Del_ID = del_ID; return delegate_User; }
/// <summary> /// Deprecated Method for adding a new object to the Delegate_User EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDelegate_User(Delegate_User delegate_User) { base.AddObject("Delegate_User", delegate_User); }