public ApiPostResponse SaveTractorUserDetail(string FarmerName, int StateId, string MobileNo, int CategoryId, int BzProductId, string ModelNo, decimal QuotationPrice, string RequestSource, string DemoDate, string TimeSlot) { SqlConnection connection; SqlCommand command = new SqlCommand(); System.Data.SqlTypes.SqlDateTime sqldatenul; string Msg = ""; connection = new SqlConnection(connetionString); ApiPostResponse objDataObject = new ApiPostResponse(); try { sqldatenul = System.Data.SqlTypes.SqlDateTime.Null; connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "usp_SaveUpdateTractorUsersDetail"; command.Parameters.AddWithValue("@FarmerName", FarmerName); command.Parameters.AddWithValue("@StateId", StateId); command.Parameters.AddWithValue("@MobileNo", MobileNo); command.Parameters.AddWithValue("@CategoryId", CategoryId); command.Parameters.AddWithValue("@BzProductId", BzProductId); command.Parameters.AddWithValue("@ModelNo", ModelNo); command.Parameters.AddWithValue("@QuotationPrice", QuotationPrice); command.Parameters.AddWithValue("@RequestSource", RequestSource); if (string.IsNullOrEmpty(DemoDate)) { command.Parameters.AddWithValue("@DemoDate", sqldatenul); } else { command.Parameters.AddWithValue("@DemoDate", Convert.ToDateTime(DemoDate)); } command.Parameters.AddWithValue("@TimeSlot", TimeSlot); Msg = Convert.ToString(command.ExecuteScalar()); if (Msg != "") { objDataObject.Success = true; objDataObject.Msg = Msg; } else { objDataObject.Success = false; objDataObject.Msg = "Issue Occurred, Please try again!!"; } command.Parameters.Clear(); LogDal.MethodCallLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); } connection.Close(); return(objDataObject); }
public ApiPostResponse SaveTractorUserDetailV2(string FarmerName, int StateId, string MobileNo, int CategoryId, string ModelNo, decimal QuotationPrice) { SqlConnection connection; SqlCommand command = new SqlCommand(); string Msg = ""; connection = new SqlConnection(connetionString); ApiPostResponse objDataObject = new ApiPostResponse(); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "usp_SaveUpdateTractorUsersDetail_Test"; command.Parameters.AddWithValue("@FarmerName", FarmerName); command.Parameters.AddWithValue("@StateId", StateId); command.Parameters.AddWithValue("@MobileNo", MobileNo); command.Parameters.AddWithValue("@CategoryId", CategoryId); command.Parameters.AddWithValue("@ModelNo", ModelNo); command.Parameters.AddWithValue("@QuotationPrice", QuotationPrice); Msg = Convert.ToString(command.ExecuteScalar()); if (Msg != "") { objDataObject.Success = true; objDataObject.Msg = Msg; } else { objDataObject.Success = false; objDataObject.Msg = "Issue Occurred, Please try again!!"; } command.Parameters.Clear(); LogDal.MethodCallLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); } connection.Close(); return(objDataObject); }
public ApiPostResponse SaveTractorUsersDetailV2(TractorUsers obj) { ReasonStatusBal _rsbal = new ReasonStatusBal(); ApiPostResponse objSavedData = new ApiPostResponse(); int flag = 0; Dictionary <string, int> returndata = new Dictionary <string, int>(); returndata.Add("status", 0); try { objSavedData = _rsbal.SaveTractorUserDetailV2(obj); } catch (Exception ex) { LogDal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); } return(objSavedData); }
public ApiPostResponse SaveTractorUserDetail(TractorUsers obj) { ApiPostResponse objCreateData = _rsdal.SaveTractorUserDetail(obj.FarmerName, obj.StateID, obj.MobileNo, obj.CategoryId, obj.BzProductId, obj.ModelNo, obj.QuotationPrice, obj.RequestSource, obj.DemoDate, obj.TimeSlot); return(objCreateData); }
public ApiPostResponse SaveTractorUserDetailV2(TractorUsers obj) { ApiPostResponse objCreateData = _rsdal.SaveTractorUserDetailV2(obj.FarmerName, obj.StateID, obj.MobileNo, obj.CategoryId, obj.ModelNo, obj.QuotationPrice); return(objCreateData); }