public bool resolveServiceRequest(ServiceRequestModel objsr)
        {
            bool     status = false;
            dbHelper db     = new dbHelper();

            status = db.resolveServiceRequest(objsr);

            return(status);
        }
        public bool saveServiceRequest(ServiceRequestModel objsr)
        {
            bool     Inserted = false;
            dbHelper db       = new dbHelper();

            Inserted = db.saveServiceRequest(objsr);

            return(Inserted);
        }
예제 #3
0
        public List <ServiceRequestModel> LoadServiceRequest()
        {
            List <ServiceRequestModel> ServiceRequestModelList = new List <ServiceRequestModel>();

            try
            {
                MySqlConnection sqlcon = db.OpenConnection();
                MySqlCommand    cmd    = new MySqlCommand("sp_ServiceRequest", sqlcon);
                cmd.CommandType = CommandType.StoredProcedure;

                MySqlDataReader sdr = cmd.ExecuteReader();


                while (sdr.Read())
                {
                    ServiceRequestModel sr = new ServiceRequestModel();
                    sr.idsr        = sdr["idsr"].ToString();
                    sr.userName    = sdr["userName"].ToString();
                    sr.emailId     = sdr["email"].ToString();
                    sr.title       = sdr["title"].ToString();
                    sr.category    = sdr["category"].ToString();
                    sr.subCategory = sdr["sub_category"].ToString();

                    sr.priority = sdr["priority"].ToString();
                    sr.status   = sdr["status"].ToString();
                    ServiceRequestModelList.Add(sr);
                }
                sdr.Close();
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            finally
            {
                db.CloseConnection();
            }
            return(ServiceRequestModelList);
        }
예제 #4
0
        //for changing the status from pending to done

        public bool resolveServiceRequest(ServiceRequestModel objsr)
        {
            bool status = false;

            try
            {
                MySqlConnection sqlcon = db.OpenConnection();
                MySqlCommand    cmd    = new MySqlCommand("sp_resolveServiceRequest", sqlcon);
                cmd.CommandType = CommandType.StoredProcedure;



                cmd.Parameters.AddWithValue("spidsr", objsr.idsr);
                //cmd.Parameters.AddWithValue("spemail", objsr.emailId);
                //cmd.Parameters.AddWithValue("sptitle", objsr.title);
                //cmd.Parameters.AddWithValue("spcategory", objsr.category);
                //cmd.Parameters.AddWithValue("spsubcategory", objsr.subCategory);
                //cmd.Parameters.AddWithValue("sppriority", objsr.priority);
                //cmd.Parameters.AddWithValue("spdescription", objsr.description);

                int rowInserted = cmd.ExecuteNonQuery();

                if (rowInserted > 0)
                {
                    status = true;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            finally
            {
                db.CloseConnection();
            }
            return(status);
        }