コード例 #1
0
        public int AddUserAPI(SystemUser Model)
        {
            try
            {
                using (PublicBL publicBL = new PublicBL())
                {
                    SystemUser User = new SystemUser();
                    User.FirstName   = Model.FirstName;
                    User.LastName    = Model.LastName;
                    User.UserName    = Model.UserName;
                    User.Email       = Model.Email;
                    User.Password    = Model.Password;
                    User.UserTypeID  = 1;
                    User.PhoneNumber = Model.PhoneNumber;
                    User.CountryID   = Model.CountryID;
                    User.DateOfBirth = Model.DateOfBirth;
                    User.GenderID    = Model.GenderID;

                    return(publicBL.AddUser(User));
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
コード例 #2
0
 public bool CheckIfEmailExsists(string Email)
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             return(publicBL.CheckIfEamilExsist(Email));
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #3
0
 public bool CheckIfUserNameExsists(string UserName)
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             return(publicBL.CheckIfUserNameExsist(UserName));
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #4
0
 public List <ComplaintStatu> GetComplaintStatusAPI()
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             var ComplaintStatus = publicBL.GetComplaintStatus();
             return(ComplaintStatus);
         }
     }
     catch (Exception ex)
     {
         // LoggedError(ex.Message);
         return(null);
     }
 }
コード例 #5
0
 public List <Department> GetDepartmentsAPI()
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             var Departments = publicBL.GetDepartments();
             return(Departments);
         }
     }
     catch (Exception ex)
     {
         // LoggedError(ex.Message);
         return(null);
     }
 }
コード例 #6
0
 public List <DataAcessLayer.ContactMethod> GetMethodsAPI()
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             var ContactMethods = publicBL.GetContactMethods();
             return(ContactMethods);
         }
     }
     catch (Exception ex)
     {
         // LoggedError(ex.Message);
         return(null);
     }
 }
コード例 #7
0
 public List <Country> GetCountriesAPI()
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             var countires = publicBL.GetCountries();
             return(countires);
         }
     }
     catch (Exception ex)
     {
         // LoggedError(ex.Message);
         return(null);
     }
 }
コード例 #8
0
        // GET Countries LookUp

        public ActionResult GetCountriesAPI()
        {
            try
            {
                using (PublicBL publicBL = new PublicBL())
                {
                    var countries = publicBL.GetCountries();
                    return(Json(countries));
                }
            }
            catch (Exception ex)
            {
                LoggedError(ex.Message);
                return(null);
            }
        }
コード例 #9
0
 public int AddComplaintDepartmentAPI(int Depatment, int ComplaintID)
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             ComplaintsDepartment complaintdeparment = new ComplaintsDepartment();
             complaintdeparment.ComplaintID   = ComplaintID;
             complaintdeparment.DepartmentsID = Depatment;
             return(publicBL.AddComplaintDepartment(complaintdeparment));
         }
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
コード例 #10
0
 public bool EditComplaintStatus(ComplaintDetail Model)
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             Complaint complaint = new Complaint
             {
                 ComplaintStatusID = Model.ComplaintStatusID,
                 ComplaintID       = Model.ComplaintsID
             };
             return(publicBL.EditComplaintStatus(complaint));
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #11
0
        public ComplaintDetail GetMyComplaintsDetailsAPI(int complainID)
        {
            try
            {
                using (PublicBL publicBL = new PublicBL())
                {
                    ComplaintDetail Grid = publicBL.GetMyComplaintsDetails(complainID);
                    if (Grid != null)
                    {
                        Grid.Refund = Grid.RefundBit ? "Yes" : "No";
                    }

                    return(Grid);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #12
0
 public LogginUser Login(string Username, string Password)
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             SystemUser User = new SystemUser();
             User.UserName = Username;
             User.Password = Password;
             var result = publicBL.Loggin(User);
             return(new LogginUser {
                 FullName = result.FullName, Password = result.Password, UserName = result.UserName, UserID = result.UserID, UserTypeID = result.UserTypeID
             });
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #13
0
 public List <ComplaintsGrids> GeAllComplaintsAPI()
 {
     try
     {
         using (PublicBL publicBL = new PublicBL())
         {
             List <ComplaintsGrids> Grid = publicBL.GetAllComplaints();
             if (Grid != null && Grid.Count > 0)
             {
                 foreach (var item in Grid)
                 {
                     item.Refund = item.RefundBit ? "Yes" : "No";
                 }
             }
             return(Grid);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #14
0
        public int AddComplaintAPI(Complaint Model)
        {
            try
            {
                using (PublicBL publicBL = new PublicBL())
                {
                    Complaint Complaint = new Complaint();
                    Complaint.UserID = Model.UserID;
                    Complaint.ComplaintLoggedTime = Model.ComplaintLoggedTime;
                    Complaint.ComplaintStatusID   = Model.ComplaintStatusID;
                    Complaint.ContactMethod       = Model.ContactMethod;
                    Complaint.CountryID           = Model.CountryID;
                    Complaint.Refund  = Model.Refund;
                    Complaint.Details = Model.Details;


                    return(publicBL.AddComplaint(Complaint));
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
        }