Exemplo n.º 1
0
        public object UpdateComp(ParamComplaintDetails PR)
        {
            GRContext db = new GRContext();

            try
            {
                tbl_complaintdetails objuser = db.tbl_complaintdetails.Where(r => r.CompID == PR.CompID).FirstOrDefault();
                objuser.GrievanceAction = PR.GrievanceAction;
                objuser.status          = PR.status;
                db.SaveChanges();


                return(new Result()
                {
                    IsSucess = true, ResultData = "User Saved Successfully."
                });
            }
            catch (Exception ex)
            {
                return(new Error()
                {
                    IsError = true, Message = ex.Message
                });
            }
        }
Exemplo n.º 2
0
 public object SetStatus(SetStatusParameters obj)
 {
     try
     {
         tbl_complaintdetails cobj = db.tbl_complaintdetails.First(r => r.CompID == obj.CompId && r.Display == 1);
         if (cobj != null)
         {
             cobj.CompID          = obj.CompId;
             cobj.GrievanceAction = obj.GrievanceAction;
             cobj.status          = obj.Status;
             cobj.modified_date   = DateTime.Now;
             db.SaveChanges();
             return(new Result()
             {
                 IsSucess = true, ResultData = "Status Updates Successfully.."
             });
         }
         else
         {
             return(new Error()
             {
                 IsError = true, Message = " Record Not Found"
             });
         }
     }
     catch (Exception ex)
     {
         return(new Error()
         {
             IsError = true, Message = " Error"
         });
     }
 }
Exemplo n.º 3
0
        public object SaveGrievance(ParamSaveGriveance obj)
        {
            if (obj.UserId == null)
            {
                return(new Result {
                    IsSucess = false, ResultData = "Invalid User."
                });
            }

            int grievancetypeid = Convert.ToInt32(obj.GriveanceType);

            var           grievancetypelist = objcontext.tbl_grievance_list.Where(r => r.grivance_id == grievancetypeid).First();
            tbl_postgriev objpost           = new tbl_postgriev();

            if (obj.Code == null)
            {
                return(new Result {
                    IsSucess = false, ResultData = "Invalid User."
                });
            }
            else
            {
                objpost.code         = obj.Code;
                objpost.email        = obj.Email;
                objpost.grivtype     = grievancetypelist.grivance_name;
                objpost.subject      = obj.Subject;
                objpost.post         = obj.PostDetails;
                objpost.userid       = obj.UserId;
                objpost.status       = "Pending";
                objpost.Display      = 1;
                objpost.created_date = DateTime.Now;
                objcontext.tbl_postgriev.Add(objpost);
                //objcontext.SaveChanges();


                tbl_complaintdetails comp = new tbl_complaintdetails();
                comp.GrievanceType   = grievancetypelist.grivance_name;
                comp.Date            = DateTime.Now.Date;
                comp.Subject         = objpost.subject;
                comp.Post            = objpost.post;
                comp.status          = objpost.status;
                comp.GrievanceAction = "Pending";
                comp.GrievMemID      = grievancetypeid;
                comp.StackHolderType = obj.Type;
                comp.StackholderID   = Convert.ToString(objpost.code);
                comp.UserId          = obj.UserId;
                comp.Display         = 1;
                comp.created_date    = DateTime.Now;

                objcontext.tbl_complaintdetails.Add(comp);
                objcontext.SaveChanges();


                return(new Result {
                    IsSucess = true, ResultData = "Griveance Posted Sucessfully."
                });
            }
        }