public static void Delete(Category category)
 {
     if (!string.IsNullOrEmpty(category.Name))
     {
         CategoryDa.DeleteCategory(category);
     }
 }
        public static Category GetCategoryWithId(int id)
        {
            if (id > 0)                             //resharper make it shorter
            {
                return(CategoryDa.GetCategory(id)); //to not consume memory dont use var
            }

            return(new Category());
        }
示例#3
0
        override protected void Page_Load(object sender, System.EventArgs e)
        {
            AppointmentDa aptDa = new AppointmentDa();

            //populate clinic list Physicians from look up codes
            //rptClinicPhysicians.DataSource = CacheManager.GetLookupCodeList("apptPhysician");
            //updated 9/22 fs
            rptClinicPhysicians.DataSource = aptDa.GetDistinctAppointmentPhysicians().Tables[0].DefaultView;
            rptClinicPhysicians.DataBind();


            //append inpatient services to the bottom of the clinic list drop down
            //added 12/06/04 to allow form printing of inpatients
            InPatientDa ipda = new InPatientDa();

            rptInPatientServices.DataSource = ipda.GetInPatientServices();
            rptInPatientServices.DataBind();

            //populate contact status from distinct values- status also present in look up codes
            PatientDa patDa = new PatientDa();
            //count of patients in each contact status should be based on dataset user is logged into
            string  datasetSql      = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataSet contactStatusDs = patDa.GetDistinctContactStatus(datasetSql);

            rptStatus.DataSource = contactStatusDs;
            rptStatus.DataBind();

            //populate categories from distinct values, takes username to display private
            SecurityController ct       = new SecurityController();
            string             userName = ct.GetUserName();

            CategoryDa catDa = new CategoryDa();
            DataSet    catDs = catDa.GetDistinctCategories(userName);

            rptCategories.DataSource = catDs;
            rptCategories.DataBind();

            //v5.1: count of patients by action items
            ActionDa  actionDa = new ActionDa();
            DataTable actionDt = actionDa.GetDistinctPatientActions(datasetSql);

            rptActions.DataSource = actionDt;
            rptActions.DataBind();
        }
 public static string Update(string name, int id)
 {
     return(CategoryDa.UpdateCategory(name, id));
 }
 public static string Add(string name)
 {
     return(CategoryDa.AddCategory(name));
 }
 public static List <Category> Get()
 {
     return(CategoryDa.GetCategories());
 }