예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string sUser = UsuarioWeb.GetNomeUsuarioConectado(Session);
            if (sUser == "")
            {
                Response.Redirect("~/Login.aspx");
            }

            BaseDAO.CancelarOperacaoObjetoDAO((BaseDAO)Session["ObjetoClienteDetalhado"]);
            ParametroPesquisaCapoli.InicializarParametroPesquisa(
                "FiltroClientes", "CLIFOR", this.Session);
            Session["DadosConsultaClientes"] = null;

            if (Request["CD_ALTER"] != null)
            {
                MultViewPesquisaCliente.ActiveViewIndex = 1;
                UsuarioWeb objUsuario = (UsuarioWeb)Session["ObjetoUsuario"];
                lblMsg.Text          = "Cliente Salvo com sucesso!";
                lblCodigo.Text       = Request["CD_ALTER"].ToString();
                lblNmCliente.Text    = objUsuario.oTabelas.hlpDbFuncoes.qrySeekValue("CLIFOR", "nm_clifor", "CD_ALTER='" + Request["CD_ALTER"].ToString() + "'");
                Session["NM_CLIFOR"] = "";
                Session["CD_ALTER"]  = null;
            }
        }
    }
        public object GetSingleTeacher(int id)
        {
            BaseDAO dao       = new BaseDAO();
            var     myTeacher = dao.Model.Teachers.FirstOrDefault(f => f.ID == id);

            return(myTeacher);
        }
예제 #3
0
        private void btn_Add_Click(object sender, RoutedEventArgs e)
        {
            if (checkValue() == false)
            {
                MessageBox.Show("Chưa điền đủ thông tin", "Error", MessageBoxButton.OK, MessageBoxImage.Error);

                return;
            }

            ProductEntity newProduct = new ProductEntity
            {
                ProductName = txt_Name.Text.Trim(),
                Type        = txt_Type.Text.Trim(),
                Brand       = txt_Brand.Text.Trim(),
                Price       = int.Parse(txt_Price.Text.Trim()),
                Quantity    = int.Parse(txt_Quantity.Text.Trim()),
                ImageURL    = txt_URLimage.Text.Trim(),
                Description = txt_Description.Text.Trim()
            };
            BaseDAO dao = BaseDAO.getInstance();

            dao.insert(newProduct);

            MessageBox.Show("Thêm sản phẩm thành công", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
            Close();
        }
        public object GetListProvince()
        {
            BaseDAO dao         = new BaseDAO();
            var     lstProvince = dao.Model.Provinces.ToList();

            return(lstProvince);
        }
        public object GetListStatusTeacher()
        {
            BaseDAO dao = new BaseDAO();
            var     lstStatusTeacher = dao.Model.StatusTeachers.ToList();

            return(lstStatusTeacher);
        }
예제 #6
0
        public object GetListInvoiceStatus()
        {
            BaseDAO dao = new BaseDAO();
            var     lstInvoiceStatus = dao.Model.InvoiceStatus.Where(f => f.IsDelete == false).ToList();

            return(lstInvoiceStatus);
        }
        public D_EmployeeForm(BaseDAO <Employee> employeeDAO, Action <Employee> onOK, Employee employee = null)
        {
            InitializeComponent();

            EmployeeDAO = employeeDAO;
            OnOK        = onOK;

            cbGender.SelectedIndex = 0;
            cbType.SelectedIndex   = 0;

            if (employee != null)
            {
                txtId.Text            = employee.EntityId;
                txtName.Text          = employee.FullName;
                txtPhone.Text         = employee.PhoneNumber;
                cbGender.SelectedItem = employee.Gender;
                dtpBirthdate.Value    = employee.BirthDate;
                txtUsername.Text      = employee.Username;
                txtPassword.Text      = employee.Password;
                cbType.SelectedItem   = employee.Type;
            }
            else
            {
                txtId.Text = "NV" + (EmployeeDAO.Count() + 1);
            }
        }
예제 #8
0
        public object GetListWard(string id)
        {
            BaseDAO dao     = new BaseDAO();
            var     lstWard = dao.Model.Wards.Where(f => f.DistrictID == id).ToList();

            return(lstWard);
        }
예제 #9
0
        public object GetListClass()
        {
            BaseDAO dao      = new BaseDAO();
            var     lstClass = dao.Model.Classes.Where(f => f.IsDelete == false).ToList();

            return(lstClass);
        }
        public object GetSingleClass(string id)
        {
            BaseDAO dao     = new BaseDAO();
            var     myClass = dao.Model.Classes.FirstOrDefault(f => f.ID == id);

            return(myClass);
        }
        public object GetSingleBranch(int id)
        {
            BaseDAO dao     = new BaseDAO();
            var     myClass = dao.Model.Branches.FirstOrDefault(f => f.ID == id);

            return(myClass);
        }
        private void BtnCapNhatSoLuongMonAn_Click(object sender, RoutedEventArgs e)
        {
            int maMonAn = Convert.ToInt32((dtgMonAn.SelectedItem as DataRowView).Row[0]);
            int soLuong = Int32.Parse(txtSoLuong.Text);

            BaseDAO.CapNhapSoLuongMonAn(maMonAn, soLuong);
        }
        private void btnGiamSoLuongMonAnUnrepeatableRead_fixed_Click(object sender, RoutedEventArgs e)
        {
            int maMonAn = Convert.ToInt32((dtgMonAn.SelectedItem as DataRowView).Row[0]);
            int soLuong = Int32.Parse(txtSoLuong.Text);

            BaseDAO.GiamSoLuongMonAn_UnrepeatableRead_fixed(maMonAn, soLuong);
        }
예제 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sUser = UsuarioWeb.GetNomeUsuarioConectado(Session);

        if (sUser == "")
        {
            Response.Redirect("~/Login.aspx");
        }
        if (!Page.IsPostBack)
        {
            string sTabela = WebConfigurationManager.AppSettings["TableItens"];
            if (sTabela.ToUpper() == "MOVIPEND")
            {
                gridConsultaPedidos.Columns[5].Visible = false;
            }
            BaseDAO.CancelarOperacaoObjetoDAO((BaseDAO)Session["ObjetoPedidoDetalhado"]);
            ParametroPesquisa objParametros = (ParametroPesquisa)Session["FiltroPedidos"];
            bool bParametrosValidos         = (objParametros != null);
            if (bParametrosValidos)
            {
                bParametrosValidos = (!objParametros.AindaNaoDefiniuFiltro());
            }
            if (!bParametrosValidos)
            {
                Response.Redirect("~/PesquisarPedidos.aspx");
                return;
            }

            PesquisaDadosPedido(objParametros);
        }
    }
        public D_MedicineDetailForm(BaseDAO <MedicineDetail> medDetailDAO, Action <MedicineDetail> onOK,
                                    Medicine medicine = null, MedicineDetail medDetail = null)
        {
            InitializeComponent();

            MedDetailDAO = medDetailDAO;
            OnOK         = onOK;
            Medicine     = medicine;
            MedDetail    = medDetail;

            if (medDetail != null)
            {
                numQuantity.Value       = medDetail.Quantity;
                txtPrice.Text           = medDetail.UnitPrice.ToString();
                dtpAddedDate.Value      = medDetail.AddedDate;
                dtpExpiredDate.Value    = medDetail.ExpirationDate;
                cbSupplier.SelectedItem = medDetail.MedicineSupplier.Name;

                numQuantity.ReadOnly   = true;
                txtPrice.Enabled       = false;
                dtpAddedDate.Enabled   = false;
                dtpExpiredDate.Enabled = false;
                cbSupplier.Enabled     = false;
            }
        }
예제 #16
0
        public IActionResult AddMeeting()
        {
            List <object[]> roomList = BaseDAO.Select("Rooms", null, null);

            ViewBag.listOfRooms = roomList;

            List <object[]> membersList = BaseDAO.Select("Members", new List <string>()
            {
                "IdEmployee", "IdMeeting", "ConfirmationOfPresence"
            }, null);
            string membersId = string.Empty;

            foreach (object[] member in membersList)
            {
                membersId += (int)member[0] + ",";
            }
            ViewBag.membersId = membersId;

            String   format = "dd.MM.yyyy";
            DateTime today  = DateTime.Today;

            ViewBag.Today = today.ToString(format);

            return(PartialView());
        }
예제 #17
0
        //Client

        #region MenuVideos
        public void MenuVideos(Menu menu, int iParentID, string _lang)
        {
            try
            {
                DataTable table   = new DataTable();
                BaseDAO   baseDAO = new BaseDAO();
                using (SqlConnection connection = baseDAO.GetConnection())
                {
                    SqlCommand command = new SqlCommand("_VideosCateGetClient", connection);
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@VideosCateID", iParentID);
                    command.Parameters.AddWithValue("@Language", _lang);
                    connection.Open();
                    using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                    {
                        adapter.Fill(table);
                        command.Dispose();
                    }
                }
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        MenuItem menuitem = new MenuItem(row["VideosCateName"].ToString());
                        menuitem.NavigateUrl = "~/Default.aspx?go=videoscate&id=" + row["VideosCateID"].ToString();
                        this.SubMenuNews(menuitem, Convert.ToInt32(row["VideosCateID"]), _lang);
                        menu.Items.Add(menuitem);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new DataAccessException(ex.Message.ToString());
            }
        }
        public object GetBranchID()
        {
            BaseDAO dao = new BaseDAO();
            var     lst = dao.Model.Branches.Where(f => f.IsDelete == false).ToList();

            return(lst);
        }
예제 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sUser = UsuarioWeb.GetNomeUsuarioConectado(Session);

        if (sUser == "")
        {
            Response.Redirect("~/Home.aspx");
        }
        if (!Page.IsPostBack)
        {
            BaseDAO.CancelarOperacaoObjetoDAO((BaseDAO)Session["ObjetoPedidoDetalhado"]);
            ParametroPesquisa objParametros = (ParametroPesquisa)Session["FiltroPedidos"];
            bool bParametrosValidos         = (objParametros != null);
            if (bParametrosValidos)
            {
                bParametrosValidos = (!objParametros.AindaNaoDefiniuFiltro());
            }
            if (!bParametrosValidos)
            {
                Response.Redirect("~/PesquisarPedidos.aspx");
                return;
            }
            PesquisarDados(objParametros.GetWhere(), objParametros.GetHaving());
        }
    }
        public object GetClassRoomID()
        {
            BaseDAO dao = new BaseDAO();
            var     lst = dao.Model.ClassRooms.Where(f => f.IsDelete == false).ToList();

            return(lst);
        }
예제 #21
0
        public object GetSingleInvoice(int id)
        {
            BaseDAO dao        = new BaseDAO();
            var     lstInvoice = dao.Model.Invoices.FirstOrDefault(f => f.ID == id);

            return(lstInvoice);
        }
        public object GetStatusClassID()
        {
            BaseDAO dao = new BaseDAO();
            var     lst = dao.Model.StatusClasses.Where(f => f.IsDelete == false).ToList();

            return(lst);
        }
예제 #23
0
        public object GetListAccount()
        {
            BaseDAO dao        = new BaseDAO();
            var     lstAccount = dao.Model.AccountConfigs.Where(f => f.IsDelete == false).ToList();

            return(lstAccount);
        }
예제 #24
0
        public sale()
        {
            InitializeComponent();

            main.Visibility       = Visibility.Hidden;
            loadingGif.Visibility = Visibility.Visible;

            Task.Run(() =>
            {
                Dispatcher.Invoke(() =>
                {
                    BaseDAO dao          = BaseDAO.getInstance();
                    listitems            = new ObservableCollection <ProductEntity>((dao.getAll(typeof(ProductEntity)) as List <ProductEntity>));
                    listitem.ItemsSource = listitems;
                    CollectionView view  = (CollectionView)CollectionViewSource.GetDefaultView(listitem.ItemsSource);
                    view.Filter          = UserFilter;

                    PropertyGroupDescription group = new PropertyGroupDescription("Type");
                    view.GroupDescriptions.Add(group);
                    listbill.ItemsSource = baskets;

                    baskets.CollectionChanged += OnCollectionChanged;

                    main.Visibility       = Visibility.Visible;
                    loadingGif.Visibility = Visibility.Collapsed;
                });
            });
        }
예제 #25
0
        public object ListInvoice()
        {
            BaseDAO dao = new BaseDAO();
            var     lst = dao.Model.Invoices.ToList();

            return(lst);
        }
예제 #26
0
        public DataTable getCateClientGroupUrl(int iCate, string lang, int group, bool status)
        {
            BaseDAO   baseDAO = new BaseDAO();
            DataTable table   = new DataTable();

            using (SqlConnection connection = baseDAO.GetConnection())
            {
                string     SQL     = "select * from tblCateNews where ParentNewsID = @CateNewsID and Language = @Language and GroupCate = @GroupCate and Status=@Status order by CateNewsOrder ASC";
                SqlCommand command = new SqlCommand(SQL, connection);
                command.CommandText = SQL;

                command.Parameters.AddWithValue("@CateNewsID", iCate);
                command.Parameters.AddWithValue("@Language", lang);
                command.Parameters.AddWithValue("@GroupCate", group);
                command.Parameters.AddWithValue("@Status", status);
                connection.Open();
                using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                {
                    adapter.Fill(table);
                    command.Dispose();
                }
            }

            return(table);
        }
        public object GetListBranch()
        {
            BaseDAO dao       = new BaseDAO();
            var     lstBranch = dao.Model.Branches.ToList();

            return(lstBranch);
        }
예제 #28
0
        public void Initialize()
        {
            CargoDAO cargoDao = new CargoDAO();

            cargo1      = CreateCargo();
            cargo2      = CreateCargo();
            cargo2.Type = "newtype";
            cargoDao.InsertCargo(cargo1);
            cargoDao.InsertCargo(cargo2);

            BaseDAO bas = new BaseDAO();

            newBase        = new Base();
            newBase.Planet = "Země";
            bas.InsertBase(newBase);

            PlayerDAO playerDao = new PlayerDAO();

            player = CreatePlayer();
            playerDao.InsertPlayer(player);

            SpaceShipDAO shipDao = new SpaceShipDAO();

            ship = CreateSpaceShip();
            shipDao.InsertSpaceShip(ship);
        }
        public object GetListDistrict(string ID)
        {
            BaseDAO dao         = new BaseDAO();
            var     lstDistrict = dao.Model.Districts.Where(f => f.ProvinceID == ID).ToList();

            return(lstDistrict);
        }
예제 #30
0
 private void SubMenuNews(MenuItem _parentNote, int iCate_ID, string _lang)
 {
     try
     {
         BaseDAO   baseDAO   = new BaseDAO();
         DataTable datatable = new DataTable();
         using (SqlConnection connection = baseDAO.GetConnection())
         {
             SqlCommand command = new SqlCommand("_VideosCateGetClient", connection);
             command.CommandType = CommandType.StoredProcedure;
             command.Parameters.AddWithValue("@VideosCateID", iCate_ID);
             command.Parameters.AddWithValue("@Language", _lang);
             connection.Open();
             using (SqlDataAdapter adapter = new SqlDataAdapter(command))
             {
                 adapter.Fill(datatable);
                 command.Dispose();
             }
         }
         if (datatable.Rows.Count > 0)
         {
             foreach (DataRow row in datatable.Rows)
             {
                 MenuItem _childNote = new MenuItem(row["VideosCateName"].ToString());
                 _childNote.NavigateUrl = "~/Default.aspx?go=videoscate&id=" + row["VideosCateID"].ToString();
                 _parentNote.ChildItems.Add(_childNote);
                 this.SubMenuNews(_childNote, Convert.ToInt32(row["VideosCateID"]), _lang);
             }
         }
     }
     catch (Exception ex)
     {
         throw new DataAccessException(ex.Message.ToString());
     }
 }
예제 #31
0
        static DAOFactory()
        {
            ExpenseDAO = new BaseDAO<Expense>();
            ExpenseCategoryDAO = new BaseDAO<ExpenseCategory>();

            InitializeExpenses();
            InitializeCategories();
        }
 public InsertExpenseFlyout()
 {
     this.InitializeComponent();
     expenseDao = new BaseDAO<Expense>();
 }