Example #1
0
        public void DeleteBySubstituteId()
        {
            Miami.Substitute.Dal.Substitute substitute = new Miami.Substitute.Dal.Substitute();
            substitute.LoadByUserId(Micajah.Common.Security.UserContext.Current.UserId);

            DalSubstitute.Query.ClearAll();
            DalSubstitute.Where.SubstituteId.Operator = WhereParameter.Operand.Equal;
            DalSubstitute.Where.SubstituteId.Value    = substitute.SubstituteId;
            if (DalSubstitute.Query.Load())
            {
                DalSubstitute.DeleteAll();
                DalSubstitute.Save();
            }
        }
Example #2
0
 public DataRowView LoadByUserId(int userId)
 {
     if (DalSubstitute.LoadByUserId(userId))
     {
         LoadEntity();
         return(DalSubstitute.DefaultView[0]);
     }
     else
     {
         Reset();
         Insert(userId, String.Empty, String.Empty, String.Empty);
         LoadEntity();
         return(DalSubstitute.DefaultView[0]);
     }
 }
        public void DeleteBySubstituteId()
        {
            Miami.Substitute.Dal.Substitute substitute = new Miami.Substitute.Dal.Substitute();
            substitute.LoadByUserId(Micajah.Common.Security.UserContext.Current.UserId);

            DalSubstitute.Query.ClearAll();
            DalSubstitute.Where.SubstituteId.Operator = WhereParameter.Operand.Equal;
            DalSubstitute.Where.SubstituteId.Value = substitute.SubstituteId;
            if (DalSubstitute.Query.Load())
            {
                DalSubstitute.DeleteAll();
                DalSubstitute.Save();
            }
        }