コード例 #1
0
        public ViewAllController()
        {
            _workoutBAL  = new WorkoutBAL();
            _categoryBAL = new CategoryBAL();

            _workouts   = _workoutBAL.GetAllWorkouts();
            _categories = _categoryBAL.GetAllCategories();

            _workoutViewModel = new WorkoutViewModel()
            {
                Workouts   = _workouts,
                Categories = _categories
            };
        }
コード例 #2
0
ファイル: CategoryController.cs プロジェクト: hazu90/git-hoc
        public ActionResult GetAll()
        {
            var categoryGroupBAL = new CategoryGroupBAL();
            var lstCateGroup     = categoryGroupBAL.GetAll();

            var categoryBAL = new CategoryBAL();
            var lstCategory = categoryBAL.GetAll();

            var model = new AllCategoryModel();

            model.LstCategory      = lstCategory;
            model.LstCategoryGroup = lstCateGroup;
            return(View(model));
        }
コード例 #3
0
        //
        // GET: /QuestionsCategory/Edit/5
        public ActionResult Edit(int id)
        {
            var _categoryBAL             = new CategoryBAL();
            QuestionsCategory _QCategory = _categoryBAL.GetCategoryById(id);
            var model = new CategoryModel();

            model.Id          = _QCategory.Id;
            model.Name        = _QCategory.Name;
            model.IsActive    = _QCategory.IsActive;
            model.CreatedBy   = _QCategory.CreatedBy;
            model.CreatedDate = _QCategory.CreatedDate;

            return(View(model));
        }
コード例 #4
0
    protected void LoadCategories()
    {
        ARC arc = ArcBAL.GetArcInfoByUserId(new Guid(Session[enumSessions.User_Id.ToString()].ToString()));

        if (arc == null)
        {
            string script = "alertify.alert('" + ltrUser.Text + "');";
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", script, true);
            return;
        }

        List <CategoryDTO> categories = CategoryBAL.GetCategoriesByArcId(arc.ARCId);

        dtCategories.DataSource = categories;
        dtCategories.DataBind();
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session[enumSessions.User_Id.ToString()] == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (Request.QueryString["CategoryId"] != null)
            {
                this.CategoryID = Convert.ToInt32(Request.QueryString["CategoryId"]);
                if (CategoryID == 0)
                {
                    Response.Redirect("Categories.aspx");
                }
            }

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["CategoryId"] != null)
                {
                    this.CategoryID = Convert.ToInt32(Request.QueryString["CategoryId"]);
                    if (CategoryID == 0)
                    {
                        Response.Redirect("Categories.aspx");
                    }

                    LoadProductDetails();

                    Category objCategory = CategoryBAL.GetCategory(CategoryID);
                    Page.Title           = objCategory.CategoryName;
                    Page.MetaDescription = objCategory.CategoryDesc;
                }
            }
        }
        catch (System.Threading.ThreadAbortException ex)
        {
            //
        }
        catch (Exception objException)
        {
            CSLOrderingARCBAL.LinqToSqlDataContext db;
            db = new CSLOrderingARCBAL.LinqToSqlDataContext();
            db.USP_SaveErrorDetails(Request.Url.ToString(), "Page_Load", Convert.ToString(objException.Message), Convert.ToString(objException.InnerException), Convert.ToString(objException.StackTrace), "", HttpContext.Current.Request.UserHostAddress, false, Convert.ToString(HttpContext.Current.Session[enumSessions.User_Id.ToString()]));
        }
    }
コード例 #6
0
        public frmWIPCosting()
        {
            InitializeComponent();
            itembal    = new ItemBAL();
            itemcombal = new ItemCompositionBAL();
            item       = new tbl_000_H_ITEM();
            itemcom    = new tbl_000_H_ITEM_PART();
            catbal     = new CategoryBAL();

            wip        = new tbl_100_WIP();
            wipbal     = new WIPBAL();
            wipmatbal  = new WIPMaterialsBAL();
            wipmatlist = new List <tbl_100_WIP_Materials>();
            dt         = new DataTable();

            err = new ErrorProviderExtended();
        }
コード例 #7
0
        public ActionResult Index()
        {
            QuestionBAL              questionBAL  = new QuestionBAL();
            CategoryBAL              _categoryBAL = new CategoryBAL();
            List <Question>          _Qlist       = questionBAL.GetAllQuestion();
            List <QuestionViewModel> _QlistModel  = new List <QuestionViewModel>();

            foreach (var i in _Qlist)
            {
                var model = new QuestionViewModel();
                List <QuestionsCategory> _categorylist = _categoryBAL.GetAllCategory();
                foreach (var category in _categorylist)
                {
                    model.Category.Add(new SelectListItem
                    {
                        Text  = category.Name,
                        Value = category.Id.ToString()
                    });
                }



                model.Id                  = i.Id;
                model.Title               = i.Title;
                model.QuestionDetail      = i.QuestionDetail;
                model.QuestionsCategoryId = i.QuestionsCategoryId;
                model.ServiceLocationId   = i.ServiceLocationId;
                model.StatusId            = i.StatusId;
                model.UserId              = i.UserId;
                model.IsActive            = i.IsActive == true ? "True" : "False";
                model.GetCall             = (bool)i.GetCall;
                model.Notification        = (bool)i.Notification;
                model.FilePath            = i.FilePath;
                model.CreatedDate         = i.CreatedDate;
                model.CreatedBy           = i.CreatedBy;


                _QlistModel.Add(model);
            }
            HomeViewModel homeViewModel = new HomeViewModel();

            homeViewModel.QuestionViewModels = _QlistModel;
            return(View(homeViewModel));
        }
コード例 #8
0
        public ActionResult Delete(int id, CategoryModel model)
        {
            try
            {
                CategoryBAL       _categoryBAL = new CategoryBAL();
                QuestionsCategory Qcategory    = _categoryBAL.GetCategoryById(id);
                Qcategory.Id          = model.Id;
                Qcategory.Name        = model.Name;
                Qcategory.UpdatedBy   = "Admin";
                Qcategory.UpdatedDate = DateTime.Now.ToUniversalTime();
                _categoryBAL.DeleteQuestoinsCategory(Qcategory);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #9
0
 protected void gvCategory_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteRecord")
     {
         if (e.CommandArgument != null)
         {
             CategoryBAL balCategory = new CategoryBAL();
             if (balCategory.Delete(Convert.ToInt32(e.CommandArgument.ToString().Trim())))
             {
                 FillCategoryGridView();
             }
             else
             {
                 lblMessage.Text    = balCategory.Message;
                 divMessage.Visible = true;
             }
         }
     }
 }
コード例 #10
0
        //
        // GET: /QuestionsCategory/
        public ActionResult Index()
        {
            CategoryBAL _catogery = new CategoryBAL();
            List <QuestionsCategory> _QCategory     = _catogery.GetAllCategory();
            List <CategoryModel>     _categoryModel = new List <CategoryModel>();

            foreach (var i in _QCategory)
            {
                var model = new CategoryModel();
                model.Id          = i.Id;
                model.Name        = i.Name;
                model.CreatedBy   = "Admin";
                model.CreatedDate = DateTime.Now.ToUniversalTime();
                model.UpdatedBy   = i.UpdatedBy;
                model.UpdatedDate = i.UpdatedDate;
                _categoryModel.Add(model);
            }
            return(View(_categoryModel));
        }
コード例 #11
0
        //
        // GET: /Questions/Create
        public ActionResult Create()
        {
            var model = new QuestionViewModel();

            model.Notification = true;
            model.GetCall      = true;
            CategoryBAL _categoryBAL          = new CategoryBAL();
            List <QuestionsCategory> category = _categoryBAL.GetAllCategory();

            foreach (var i in category)
            {
                model.Category.Add(new SelectListItem
                {
                    Text  = i.Name,
                    Value = i.Id.ToString()
                });
            }
            return(View(model));
        }
コード例 #12
0
        public frm_DynamicList()
        {
            InitializeComponent();
            combal  = new ComponentBAL();
            com     = new tbl_000_H_PART();
            pibal   = new PlasticInjectionBAL();
            pi      = new tbl_000_H_PI();
            vpbal   = new VacuumPlatingBAL();
            vp      = new tbl_000_H_VP();
            assybal = new AssymblyBAL();
            assy    = new tbl_000_H_ASSY();
            mrbal   = new MODRCBAL();
            modrc   = new tbl_000_MODRC();
            itembal = new ItemBAL();
            item    = new tbl_000_H_ITEM();
            catbal  = new CategoryBAL();
            cat     = new tbl_000_H_CATEGORY();

            comlist = new List <tbl_000_H_PART>();
        }
コード例 #13
0
        public ActionResult Create(CategoryModel category)
        {
            try
            {
                // TODO: Add insert logic here
                CategoryBAL       _categoryBAL = new CategoryBAL();
                QuestionsCategory _QCategory   = new QuestionsCategory();
                _QCategory.Id          = category.Id;
                _QCategory.Name        = category.Name;
                _QCategory.CreatedBy   = "Admin";
                _QCategory.CreatedDate = DateTime.Now.ToUniversalTime();
                _categoryBAL.AddQuestionCategory(_QCategory);


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #14
0
        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            CategoryBAL CB = new CategoryBAL();
            CategoryDAL CD = new CategoryDAL();

            if (TxtCategoryName.Text != "")
            {
                CB.CatID        = Cat_ID;
                CB.CategoryName = TxtCategoryName.Text.Trim();
                int Result = CD.UpdateCategory(CB);
                if (Result > 0)
                {
                    MessageBox.Show("Category Updated with Category ID Number " + Cat_ID + " Successfully");
                    LoadDGVCategory();
                }
                else
                {
                    MessageBox.Show("Something Went Wrong");
                    LoadDGVCategory();
                }
            }
        }
コード例 #15
0
ファイル: CategoryDAL.cs プロジェクト: AswinPG/ShopBillingApp
 public int InsertCategory(CategoryBAL B)
 {
     try
     {
         using (C.Con)
         {
             MySqlCommand cmd = new MySqlCommand("AddCategory", C.Con)
             {
                 CommandType = CommandType.StoredProcedure
             };
             cmd.Parameters.Add(new MySqlParameter("Category", B.CategoryName));
             cmd.Connection.Open();
             int Result = cmd.ExecuteNonQuery();
             C.Con.Close();
             return(Result);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         throw;
     }
 }
コード例 #16
0
 public HomeView()
 {
     notificationBal = new NotificationBAL();
     categoryBal     = new CategoryBAL();
     eventBal        = new EventBAL();
 }
コード例 #17
0
 public AddEventView()
 {
     eventBal           = new EventBAL();
     categoryBal        = new CategoryBAL();
     selectedCategoryId = 1;
 }
コード例 #18
0
 public UserCartBAL()
 {
     this.cartBal     = new CartBAL();
     this.accountBal  = new AccountBAL();
     this.categoryBal = new CategoryBAL();
 }
コード例 #19
0
 public BookInfoBAL()
 {
     this.bookBal     = new BookBAL();
     this.cartBal     = new CartBAL();
     this.categoryBal = new CategoryBAL();
 }
コード例 #20
0
 public ListBookBAL()
 {
     categoryBal  = new CategoryBAL();
     publisherBal = new PublisherBAL();
     bookBal      = new BookBAL();
 }
コード例 #21
0
 public CategoryController()
 {
     _categories = new CategoryBAL();
 }
コード例 #22
0
 public frm_CopierCat()
 {
     InitializeComponent();
     catbal = new CategoryBAL();
     cat    = new tbl_000_H_CATEGORY();
 }