The exception is "Function does not exist".But the fuction is actually exist and which is already working in a button click.A particular user only have the permission to do this.And in button click which is written using conditions.Is there any problem of mysql function permission?Webs ervice is in the form of url and i already pass the specific user id.Please reply me..
This is the code,
This is the code,
Code:
public ActionResult AddPatientTreatment(string patientid, string treatmentid, string treatmentdate, string doctorname, string remarks, string doctorid, string paymentstatus, string paymentpaiddate,string ipid) { string result = string.Empty, DateTimeFormat = string.Empty; try { _performtreatmentBAL.PatientId = Convert.ToInt32(patientid); _performtreatmentBAL.TreatmentId = Convert.ToInt32(treatmentid); if (treatmentdate != string.Empty) { DateTimeFormat = ClinicSettingsBLL.GetDateTimeFormate(); _performtreatmentBAL.TreatmentDate = Common.ChangeFormat(DateTimeFormat, treatmentdate); } else { _performtreatmentBAL.TreatmentDate = DateTime.Now; } _performtreatmentBAL.Doctor = doctorname; _performtreatmentBAL.Remarks = remarks; _performtreatmentBAL.DoctorID = Convert.ToInt32(doctorid); _performtreatmentBAL.PaymentPaidStatus = false; _performtreatmentBAL.PaymentPaidDate = DateTime.Now; _performtreatmentBAL.IPId = ipid; result = Convert.ToString(AddPatientTreatments()); var data = new { status = 200, message = "{'AddPatientTreatmentResult' : [{'result':'" + result + "'}]}" }; return Json(data, JsonRequestBehavior.AllowGet); //return GetXmlForResult("AddPatientTreatmentResult", result); } catch (Exception ex) { var data = new { status = 501, message =ex.Message }; return Json(data, JsonRequestBehavior.AllowGet); //return GetXmlForResult("Error", ex.Message); } } public int AddPatientTreatments() { try { //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "Before", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", ""); //******************************************************************************************************************************************************************************************************** MySqlConnection conn = new MySqlConnection(ConnectionString()); MySqlCommand cmd = new MySqlCommand("insertpatienttreatment", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new MySqlParameter("param1", _performtreatmentBAL.PatientId)); cmd.Parameters.Add(new MySqlParameter("param2", _performtreatmentBAL.TreatmentId)); cmd.Parameters.Add(new MySqlParameter("param3", string.Format("{0:s}", Convert.ToDateTime(_performtreatmentBAL.TreatmentDate)))); cmd.Parameters.Add(new MySqlParameter("param4", _performtreatmentBAL.Doctor)); cmd.Parameters.Add(new MySqlParameter("param5", _performtreatmentBAL.Remarks)); cmd.Parameters.Add(new MySqlParameter("param6", _performtreatmentBAL.DoctorID)); cmd.Parameters.Add(new MySqlParameter("param8", _performtreatmentBAL.PaymentPaidStatus)); cmd.Parameters.Add(new MySqlParameter("param9", _performtreatmentBAL.PaymentPaidDate)); cmd.Parameters.Add(new MySqlParameter("?param7", MySqlDbType.Int32)); cmd.Parameters["?param7"].Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(new MySqlParameter("param10", _performtreatmentBAL.IPId)); conn.Open(); cmd.ExecuteNonQuery(); object obj = new object(); obj = (object)(cmd.Parameters["?param7"].Value); this._performtreatmentBAL.PatientTreatmentId = Convert.ToInt32(obj); cmd.Connection.Close(); conn.Close(); //******************************************************************************************************************************************************************************************************** //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "After", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", ""); return this._performtreatmentBAL.PatientTreatmentId; } catch (Exception e) { //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "Error", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", e.Message.ToString()); //******************************************************************************************************************************************************************************************************** ErrorLogBAL.InsertException(e.Message, "InsertPatientTreatment"); return 0; } }
Comment