public Task <int> PostDosham(Dosham dosham) { int result = 0; try { using (IDbConnection db = GetConnection()) { db.Open(); if (dosham.DoshamName != "") { var p = new DynamicParameters(); p.Add("@DoshamId", dosham.DoshamId, DbType.Int32, ParameterDirection.Input); p.Add("@DoshamName", dosham.DoshamName, DbType.String, ParameterDirection.Input); p.Add("@DoshamCreatedDate", dosham.DoshamCreatedDate, DbType.DateTime, ParameterDirection.Input); p.Add("@DoshamCreatedBy", dosham.DoshamCreatedBy, DbType.Int32, ParameterDirection.Input); p.Add("@DoshamModifiedDate", dosham.DoshamModifiedDate, DbType.DateTime, ParameterDirection.Input); p.Add("@DoshamModifiedBy", dosham.DoshamModifiedBy, DbType.Int32, ParameterDirection.Input); p.Add("@DoshamStatus", RecordStatus.Active, DbType.Int32, ParameterDirection.Input); if (dosham.DoshamId == 0) { p.Add("@ActionType", ActionType.Add.ToString(), DbType.String, ParameterDirection.Input); } else { p.Add("@ActionType", ActionType.Update.ToString(), DbType.String, ParameterDirection.Input); } p.Add("@OutputData", dosham.DoshamId, DbType.Int32, ParameterDirection.Output); result = db.Execute("usp_CRED_Dosham", p, commandType: CommandType.StoredProcedure); } return(Task.FromResult(result)); } } catch (Exception) { throw; } }
public Task <int> PostDosham(Dosham dosham) { return(doshamServiceobj.PostDosham(dosham)); }