public object DeleteCommittee(CommitteeMasterUpdateParam PM)
        {
            try
            {
                Tbl_CommitteeMaster obj = db.Tbl_CommitteeMaster.Where(r => r.CommitteeID == PM.CommitteeID).FirstOrDefault();


                if (obj.Status == 1)
                {
                    obj.Status = 0;
                }
                else
                {
                    obj.Status = 1;
                }

                db.SaveChanges();

                return(new Result()
                {
                    IsSucess = true, ResultData = "Committe Deactivated Successfully."
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
        public object CommitteUpdate(CommitteeMasterUpdateParam b)
        {
            if (b.CommitteeTypeID == 0)
            {
                return(new Error()
                {
                    IsError = true, Message = "Required CommitteeType"
                });
            }
            var data = db.Tbl_CommitteeMaster.Where(r => r.CommitteeID == b.CommitteeID).FirstOrDefault();

            try
            {
                Tbl_CommitteeMaster obj = new Tbl_CommitteeMaster();
                data.CommitteeTypeID = b.CommitteeTypeID;
                data.ModifiedBy      = null;
                data.ModifiedDate    = System.DateTime.Today.Date;
                db.SaveChanges();
                return(new Result()
                {
                    IsSucess = true, ResultData = "Update Commitee"
                });
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Example #3
0
 public object DeleteCommittee([FromBody] CommitteeMasterUpdateParam PM)
 {
     try
     {
         CommitteeBusiness b = new CommitteeBusiness();
         var Result          = b.DeleteCommittee(PM);
         return(Result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
Example #4
0
        public object UpdateCommittee(CommitteeMasterUpdateParam b)
        {
            try
            {
                CommitteeBusiness type = new CommitteeBusiness();
                var Result             = type.CommitteUpdate(b);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
 public object GetSingleCommittee(CommitteeMasterUpdateParam b)
 {
     try
     {
         var Committee = db.ViewCommitteMasterLists.Where(r => r.CommitteeID == b.CommitteeID).FirstOrDefault();
         return(new Result()
         {
             IsSucess = true, ResultData = Committee
         });
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }