/// <summary> /// Adds the ministry. /// </summary> /// <param name="objComMinistry">The object COM ministry.</param> /// <param name="ministryId">The ministry identifier.</param> public int AddMinistry(ComMinistry objComMinistry, int ministryId) { int i = 0; if (ministryId == 0)//to insert ministry item { DbCommand cmd = null; cmd = db.GetStoredProcCommand("pkg_ministry.add_ministry"); db.AddInParameter(cmd, "v_ministry_nep_name", DbType.String, objComMinistry.ministryNepaliName); db.AddInParameter(cmd, "v_ministry_eng_name", DbType.String, objComMinistry.ministryEnglishName); db.AddInParameter(cmd, "v_ministry_code", DbType.String, objComMinistry.ministryCode); i = db.ExecuteNonQuery(cmd); } else // to update ministry item { DbCommand cmd = null; cmd = db.GetStoredProcCommand("pkg_ministry.update_ministry"); db.AddInParameter(cmd, "v_ministry_nep_name", DbType.String, objComMinistry.ministryNepaliName); db.AddInParameter(cmd, "v_ministry_eng_name", DbType.String, objComMinistry.ministryEnglishName); db.AddInParameter(cmd, "v_ministry_code", DbType.String, objComMinistry.ministryCode); db.AddInParameter(cmd, "v_ministry_id", DbType.Int16, ministryId); i = db.ExecuteNonQuery(cmd); } return(i); }
public int AddMinistry(ComMinistry objComMinistry, int ministryId) { Base objDal = new Base(); return(objDal.AddMinistry(objComMinistry, ministryId)); }