Exemple #1
0
        bool IModifyRecord.UpdateRecord(Object ownerpobj)
        {
            Boolean flag = false;
            OwnerMaster owner = (OwnerMaster)ownerpobj;
            try
            {
                OwnerAsClient _owner = new OwnerAsClient();
                _owner.ID = Convert.ToInt64(owner.ID);

                if (owner.EndDate != null)
                {
                     _owner.Enddate = Common.DateGB(owner.EndDate);
                     _owner.ModifyBy = owner.ModifyBy;
                     _owner.ModifyDate = DateTime.Now;
                }
                if ((_owner.ID != null) && (_owner.Enddate != null))
                {
                    flag = DALOwnerAsClient.UpdateOwner(_owner);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return flag;
        }
Exemple #2
0
 public static Boolean UpdateOwner(OwnerAsClient owner)
 {
     using (TransactionScope scope = new TransactionScope())
        {
        Boolean bol = false;
        using (var context = new SycousCon())
        {
            try
            {
                var Update = context.OwnerAsClients.Where(c => c.ID == owner.ID);
                foreach (OwnerAsClient p in Update)
                {
                    if (owner.Enddate != null)
                    {
                        p.Enddate = owner.Enddate;
                        p.ModifyDate = owner.ModifyDate;
                         p.ModifyBy = owner.ModifyBy;
                     }
                }//
                context.SaveChanges();
                context.AcceptAllChanges();
                scope.Complete();
                context.Dispose();
                bol = true;
            }
            catch (Exception ex)
            {
                context.Dispose();
                throw;
            }
        }// using
        return bol;
        } //trans
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the OwnerAsClients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOwnerAsClients(OwnerAsClient ownerAsClient)
 {
     base.AddObject("OwnerAsClients", ownerAsClient);
 }
Exemple #4
0
 public static new OwnerAsClient EditOwner(Int64 OwnerID)
 {
     OwnerAsClient owner = new OwnerAsClient();
        using (var context = new SycousCon())
        {
        try
        {
            owner = context.OwnerAsClients.SingleOrDefault(s => s.ID == OwnerID);
        }
        catch (Exception ex)
        {
            context.Dispose();
            throw;
        }
        }
        return owner;
 }
 /// <summary>
 /// Create a new OwnerAsClient object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="isDeleted">Initial value of the IsDeleted property.</param>
 public static OwnerAsClient CreateOwnerAsClient(global::System.Int64 id, global::System.Int32 isDeleted)
 {
     OwnerAsClient ownerAsClient = new OwnerAsClient();
     ownerAsClient.ID = id;
     ownerAsClient.IsDeleted = isDeleted;
     return ownerAsClient;
 }