コード例 #1
0
ファイル: AlterTable.aspx.cs プロジェクト: ymyymyymy/AspNet
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     TableBLL obj = new TableBLL();
     string id = (GridView1.DataKeys[e.RowIndex].Value).ToString();
     Response.Write(" <script>alert('" + obj.deleteTable(id) + "')</script>");
     displaypage();
 }
コード例 #2
0
        private void btnSiparisOlustur_Click(object sender, EventArgs e)
        {
            //Masa durumunu dolu set et++.
            var sonSiparis = OrderBLL.GetLastAddedOrder(masaID);

            if (sonSiparis.Item2 != true)
            {
                var donen = OrderBLL.AddOrder(masaID, calisanID);
                if (donen)
                {
                    MessageBox.Show("Sipariş eklendi.");
                    TableBLL.SetTableBusy(masaID);
                }
                else
                {
                    MessageBox.Show("Sipariş eklenirken hata oluştu.");
                }
            }
            else
            {
                MessageBox.Show("İçeride kapanmamış bir sipariş var.");
            }

            //int siparisID = donen.Item2.SiparisID;
            //orderID = siparisID;
        }
コード例 #3
0
        private void btnOdendi_Click(object sender, EventArgs e)
        {
            var faturaSiparis = OrderBLL.GetLastAddedOrder(masaID).Item1;

            var yemekVarmi = FoodNavigateBLL.GetLastOrderFoods(OrderBLL.GetLastAddedOrder(masaID).Item1.SiparisID);

            if (yemekVarmi.Count() > 0)
            {
                var f = OrderBLL.PayOrder(masaID);
                if (f.Item1)
                {
                    MessageBox.Show(f.Item2);
                    //Masayı boş set et.
                    TableBLL.SetTableFree(masaID);
                    //Adisyon bas.
                    FrmAdisyon fad = new FrmAdisyon(faturaSiparis);
                    this.Hide();
                    fad.Show();
                }
                else
                {
                    MessageBox.Show(f.Item2);
                }
            }
            else
            {
                MessageBox.Show("Masanın yemeği olmadığından , hesap almak yerine sipariş iptal edilmelidir.");
            }
        }
コード例 #4
0
ファイル: SeatSetup.cs プロジェクト: Thaibaduc/Restaurant
        private void btnAddArea_Click(object sender, EventArgs e)
        {
            AreaAddDialog addAreaDialog = new AreaAddDialog();
            DialogResult  dr            = addAreaDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                AreaBLL areaBLL = new AreaBLL();
                Area    area    = areaBLL.CreateArea(addAreaDialog.AreaName);

                // add table
                if (addAreaDialog.IsAddTable)
                {
                    TableBLL tableBLL = new TableBLL();
                    for (var i = addAreaDialog.TableFrom; i <= addAreaDialog.TableTo; i++)
                    {
                        tableBLL.CreateTable(new Table {
                            Name = "Bàn " + i, AreaID = area.ID
                        });
                    }
                }

                this.LoadData();
            }
        }
コード例 #5
0
        private void LoadData()
        {
            TableBLL tableBLL = new TableBLL();

            this.ListOrderedTables   = tableBLL.ListOrderedTables();
            this.ListAvailableTables = tableBLL.ListAvailableTables();

            foreach (DAL.Table table in this.Tables)
            {
                TableControl tableControl = new TableControl(table, false);
                tableControl.MouseDown += new MouseEventHandler(this.tableControl1_MouseDown);
                this.flowLayoutPanel1.Controls.Add(tableControl);
            }

            foreach (DAL.Table table in this.ListAvailableTables)
            {
                TableControl tableControl = new TableControl(table, false);
                tableControl.MouseDown += new MouseEventHandler(this.tableControl1_MouseDown);
                this.flowLayoutPanel2.Controls.Add(tableControl);
            }

            foreach (DAL.Table table in this.ListOrderedTables)
            {
                DAL.Table tt = this.Tables.Find(t => t.ID == table.ID);
                if (tt != null)
                {
                    continue;
                }

                TableControl tableControl = new TableControl(table, false);
                tableControl.MouseDown += new MouseEventHandler(this.tableControl1_MouseDown);
                this.flowLayoutPanel3.Controls.Add(tableControl);
            }
        }
コード例 #6
0
 public UCTable_Edit(Form_Restaurant form1)
 {
     mainform = form1;
     tables   = new List <Table>();
     tableBLL = new TableBLL();
     InitializeComponent();
     LoadData();
 }
コード例 #7
0
        protected void subbtim_Click(object sender, EventArgs e)
        {
            TableBLL obj    = new TableBLL();
            int      id     = Convert.ToInt32(userName.Text);
            int      status = Convert.ToInt32(DropDownList1.SelectedValue);
            string   sql    = obj.addTable(id, status);

            Response.Write(string.Format("<script>alert('{0}')</script>", sql));
        }
コード例 #8
0
ファイル: AlterTable.aspx.cs プロジェクト: ymyymyymy/AspNet
 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     TableBLL obj = new TableBLL();
     int status = Convert.ToInt32(((DropDownList)(GridView1.Rows[e.RowIndex].FindControl("DropDownList1"))).SelectedValue);
     string id = (GridView1.DataKeys[e.RowIndex].Value).ToString();
     Response.Write(" <script>alert('" + obj.updateTable(id,status) + "')</script>");
     GridView1.EditIndex = -1;
     displaypage();
 }
コード例 #9
0
        /// <summary>
        /// 单击单元格(编辑、删除、缓存)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvSource_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            string id = this.dgvSource.Rows[e.RowIndex].Cells["ID"].Value.ToString();

            if (e.ColumnIndex == 0)//修改
            {
                OpenDetailWin(id);
            }
            else if (e.ColumnIndex == 1)//删除
            {
                DialogResult dr = MessageBox.Show("是否确定删除?", "提示", MessageBoxButtons.OKCancel);
                if (dr == DialogResult.OK)
                {
                    string msg;
                    bll.DeleteDBSet(id, out msg);
                    MessageBox.Show(msg, "提示", MessageBoxButtons.OK);
                    BindDBList();
                }
            }
            else if (e.ColumnIndex == 2)//缓存
            {
                DialogResult dr = MessageBox.Show("是否确定缓存数据源?", "提示", MessageBoxButtons.OKCancel);
                if (dr == DialogResult.OK)
                {
                    this.Enabled = false;
                    PgsBar   pgs    = new PgsBar(pgsDBList, lblShow);
                    TableBLL auxbll = new TableBLL();

                    string    filename = bll.GetFilePath(id, this.dgvSource.Rows[e.RowIndex].Cells["NAME"].Value.ToString());
                    DBSetting setmodel = new DBSetting();
                    setmodel.Flag           = CommonConfig.DataType.DB;
                    setmodel.DBAccount.DB   = this.dgvSource.Rows[e.RowIndex].Cells["DB"].Value.ToString();
                    setmodel.DBAccount.User = this.dgvSource.Rows[e.RowIndex].Cells["USER"].Value.ToString();
                    setmodel.DBAccount.Pwd  = this.dgvSource.Rows[e.RowIndex].Cells["PWD"].Value.ToString();

                    auxbll.IninDefinitionDAL(setmodel);
                    string retmsg;
                    if (auxbll.CacheTable(pgs, filename, out retmsg))
                    {
                        DataBaseModel model = new DataBaseModel();
                        model.ID   = id;
                        model.PATH = filename;
                        if (!bll.SetCache(model, out retmsg))
                        {
                            MessageBox.Show(retmsg, "提示", MessageBoxButtons.OK);
                        }
                    }
                    this.Enabled = true;
                    BindDBList();
                }
            }
        }
コード例 #10
0
ファイル: FieldsController.cs プロジェクト: benxuu/SYPM
 /// <summary>
 /// 新增字段
 /// </summary>
 /// <returns></returns>
 public ActionResult AddFields()
 {
     try
     {
         UserEntity   uInfo     = ViewData["Account"] as UserEntity;
         FieldsEntity entityAdd = new FieldsEntity();
         entityAdd.TabId           = int.Parse(Request["TabId"]);
         entityAdd.FieldName       = Request["FieldName"].Trim();
         entityAdd.FieldViewName   = Request["FieldViewName"].Trim();
         entityAdd.FieldDataTypeId = int.Parse(Request["FieldDataTypeId"]);
         entityAdd.IsActive        = bool.Parse(Request["IsActive"]);
         entityAdd.IsSearch        = bool.Parse(Request["IsSearch"]);
         entityAdd.CreateBy        = uInfo.AccountName;
         entityAdd.CreateTime      = DateTime.Now;
         entityAdd.UpdateBy        = uInfo.AccountName;
         entityAdd.UpdateTime      = DateTime.Now;
         entityAdd.Sort            = int.Parse(Request["Sort"]);
         bool ExistsFieldName     = new FieldsBLL().ExistsFieldName(entityAdd.FieldName, entityAdd.TabId);
         bool ExistsFieldViewName = new FieldsBLL().ExistsFieldViewName(entityAdd.FieldViewName, entityAdd.TabId);
         if (ExistsFieldName)
         {
             return(Content("{\"msg\":\"添加失败,字段名已存在!\",\"success\":false}"));
         }
         else if (ExistsFieldViewName)
         {
             return(Content("{\"msg\":\"添加失败,字段显示名已存在!\",\"success\":false}"));
         }
         else
         {
             int entityId = new FieldsBLL().Add(entityAdd);
             if (entityId > 0)
             {
                 //新增数据库表字段 获取表信息
                 TableEntity    tabEntity      = new TableBLL().GetModel(entityAdd.TabId);
                 DataTypeEntity dataTypeEntity = new DataTypeBLL().GetModel(entityAdd.FieldDataTypeId);
                 string         dbTabName      = "tb_" + tabEntity.TabName;
                 if (Comm.AddTabField(dbTabName, entityAdd.FieldName, dataTypeEntity.DataType))
                 {
                     return(Content("{\"msg\":\"添加成功!\",\"success\":true}"));
                 }
                 else
                 {
                     return(Content("{\"msg\":\"添加失败!\",\"success\":false}"));
                 }
             }
             else
             {
                 return(Content("{\"msg\":\"添加失败!\",\"success\":false}"));
             }
         }
     }
     catch (Exception ex)
     {
         return(Content("{\"msg\":\"添加失败," + ex.Message + "\",\"success\":false}"));
     }
 }
コード例 #11
0
        private void save()
        {
            this.table.Name = this.txtName.Text;
            TableBLL tableBLL = new TableBLL();

            tableBLL.Update(this.table);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #12
0
        private void addTable()
        {
            TableBLL tableBLL = new TableBLL();

            tableBLL.CreateTable(new Table {
                Name = this.txtName.Text, AreaID = this.area.ID
            });
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #13
0
 public Form_BookingTable(Form_Restaurant form, int TableID)
 {
     mainform        = form;
     TabID           = TableID;
     tableBLL        = new TableBLL();
     bookingTableBLL = new BookingTableBLL();
     customerBLL     = new CustomerBLL();
     InitializeComponent();
     lbTableID.Text = Convert.ToString(TabID);
 }
コード例 #14
0
        private void TableControrlGroup_Load(object sender, EventArgs e)
        {
            this.tableBLL            = new TableBLL();
            bindingSource.DataSource = tableBLL.ds;
            dataGridView1.DataSource = bindingSource;
            dataGridView1.DataMember = "table";

            textBoxUpdateId.DataBindings.Add("Text", bindingSource, "table.id", true, DataSourceUpdateMode.OnPropertyChanged);
            textUpdateTableNumber.DataBindings.Add("Text", bindingSource, "table.table_number");
        }
コード例 #15
0
ファイル: UCTable.cs プロジェクト: tiendat07/QuanLyNhaHang
 public UCTable(Form_Restaurant form1)
 {
     orderBLL       = new OrderBLL();
     orderDetailBLL = new OrderDetailBLL();
     tableBLL       = new TableBLL();
     lsTable_temp   = tableBLL.GetListTable();
     orderBLL       = new OrderBLL();
     mainform       = form1;
     InitializeComponent();
     LoadData();
 }
コード例 #16
0
ファイル: FieldsController.cs プロジェクト: benxuu/SYPM
        /// <summary>
        /// 编辑字段
        /// </summary>
        /// <returns></returns>
        public ActionResult EditFields()
        {
            try
            {
                UserEntity uInfo = ViewData["Account"] as UserEntity;

                int    id               = Convert.ToInt32(Request["id"]);
                string originalName     = Request["originalName"];
                string originalViewName = Request["originalViewName"];

                FieldsEntity entityEdit = new FieldsBLL().GetModel(id);
                entityEdit.FieldName       = Request["FieldName"].Trim();
                entityEdit.FieldViewName   = Request["FieldViewName"].Trim();
                entityEdit.FieldDataTypeId = int.Parse(Request["FieldDataTypeId"]);
                entityEdit.IsActive        = bool.Parse(Request["IsActive"]);
                entityEdit.IsSearch        = bool.Parse(Request["IsSearch"]);
                entityEdit.Sort            = int.Parse(Request["Sort"]);
                entityEdit.UpdateBy        = uInfo.AccountName;
                entityEdit.UpdateTime      = DateTime.Now;
                bool ExistsFieldViewName = new FieldsBLL().ExistsFieldViewName(entityEdit.FieldViewName, entityEdit.TabId);
                if (entityEdit.FieldViewName != originalViewName && ExistsFieldViewName)
                {
                    return(Content("{\"msg\":\"修改失败,字段显示名已存在!\",\"success\":false}"));
                }
                else
                {
                    int result = new FieldsBLL().Update(entityEdit);
                    if (result > 0)
                    {
                        //新增数据库表字段 获取表信息
                        TableEntity    tabEntity      = new TableBLL().GetModel(entityEdit.TabId);
                        DataTypeEntity dataTypeEntity = new DataTypeBLL().GetModel(entityEdit.FieldDataTypeId);
                        string         dbTabName      = "tb_" + tabEntity.TabName;
                        if (Comm.UpdateTabField(dbTabName, entityEdit.FieldName, dataTypeEntity.DataType))
                        {
                            return(Content("{\"msg\":\"修改成功!\",\"success\":true}"));
                        }
                        else
                        {
                            return(Content("{\"msg\":\"修改失败!\",\"success\":false}"));
                        }
                    }
                    else
                    {
                        return(Content("{\"msg\":\"修改失败!\",\"success\":false}"));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Content("{\"msg\":\"修改失败," + ex.Message + "\",\"success\":false}"));
            }
        }
コード例 #17
0
ファイル: TableController.cs プロジェクト: winterone/AFeiDemo
        /// <summary>
        /// 新增数据表
        /// </summary>
        /// <returns></returns>
        public ActionResult AddTable()
        {
            try
            {
                UserModel  uInfo   = ViewData["Account"] as UserModel;
                TableModel typeAdd = new TableModel();
                typeAdd.TabName     = Request["TabName"].Trim();
                typeAdd.TabViewName = Request["TabViewName"].Trim();
                typeAdd.IsActive    = bool.Parse(Request["IsActive"]);
                typeAdd.CreateBy    = uInfo.AccountName;
                typeAdd.CreateTime  = DateTime.Now;
                typeAdd.UpdateBy    = uInfo.AccountName;
                typeAdd.UpdateTime  = DateTime.Now;

                bool ExistsTabName     = new TableBLL().ExistsTabName(typeAdd.TabName);
                bool ExistsTabViewName = new TableBLL().ExistsTabViewName(typeAdd.TabViewName);
                if (ExistsTabName)
                {
                    return(Content("{\"msg\":\"添加失败,物理表名已存在!\",\"success\":false}"));
                }
                else if (ExistsTabViewName)
                {
                    return(Content("{\"msg\":\"添加失败,表显示名已存在!\",\"success\":false}"));
                }
                else
                {
                    int typeId = new TableBLL().Add(typeAdd);
                    if (typeId > 0)
                    {
                        //数据库-新建物理表
                        string dbTabName = "tb_" + typeAdd.TabName;
                        if (Comm.CreateTable(dbTabName))
                        {
                            return(Content("{\"msg\":\"添加成功!\",\"success\":true}"));
                        }
                        else
                        {
                            return(Content("{\"msg\":\"添加物理表失败!\",\"success\":false}"));
                        }
                    }
                    else
                    {
                        return(Content("{\"msg\":\"添加失败!\",\"success\":false}"));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Content("{\"msg\":\"添加失败," + ex.Message + "\",\"success\":false}"));
            }
        }
コード例 #18
0
ファイル: AlterTable.aspx.cs プロジェクト: ymyymyymy/AspNet
 /// <summary>
 /// page
 /// </summary>
 public void displaypage()
 {
     TableBLL obj = new TableBLL();
     pds.DataSource = obj.GetList();
     pds.AllowPaging = true;
     pds.PageSize = 5;
     pds.CurrentPageIndex = Pages;
     Label4.Text = pds.DataSourceCount.ToString();
     pagecount = pds.DataSourceCount;
     Label2.Text = (pds.CurrentPageIndex + 1).ToString();
     Label3.Text = pds.PageCount.ToString();
     GridView1.DataSource = pds;
     GridView1.DataBind();
 }
コード例 #19
0
ファイル: FrmAdmin.cs プロジェクト: krmckmz/restaurantProject
 private void FrmAdmin_Load(object sender, EventArgs e)
 {
     SayWelcome(um);
     tmrSaat.Enabled = true;
     ListUsers(UserBLL.GetUsers());
     ListEmployees(EmployeeBLL.GetEmployees());
     AddEmployeesToUser(EmployeeBLL.GetEmployees());
     AddCategoriesToFood();
     ListFoods(FoodBLL.GetFoods());
     PaintTables(TableBLL.GetTables());
     MasalariDoldur(TableBLL.GetTables());
     PozisyonlarıDoldur();
     SiparisListele(OrderBLL.GetOrders());
 }
コード例 #20
0
ファイル: TableController.cs プロジェクト: winterone/AFeiDemo
        /// <summary>
        /// 获取表数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTabDataInfoByTabId()
        {
            int    TabId      = int.Parse(Request["TabId"] == null ? "0" : Request["TabId"]);
            string sort       = Request["sort"] == null ? "Id" : Request["sort"];
            string order      = Request["order"] == null ? "asc" : Request["order"];
            int    pageindex  = Request["page"] == null ? 1 : Convert.ToInt32(Request["page"]);
            int    pagesize   = Request["rows"] == null ? 10 : Convert.ToInt32(Request["rows"]);
            int    totalCount = 0;

            TableModel entity    = new TableBLL().GetModel(TabId);
            string     dbTabName = "tb_" + entity.TabName;
            string     strJson   = new FieldsBLL().GetPager(dbTabName, Comm.GetColumnsStr(TabId), sort + " " + order, pagesize, pageindex, " 1=1 ", out totalCount);

            return(Content(strJson));
        }
コード例 #21
0
 public UCOrder_Pay(Form_Restaurant form, List <OrderDetail> orderDetails, int EmployeeID, int TableID, int CustomerID)
 {
     CusID          = CustomerID;
     tableBLL       = new TableBLL();
     orDer          = new Order();
     orderBLL       = new OrderBLL();
     orderDetailBLL = new OrderDetailBLL();
     foodDrinkBLL   = new FoodDrinkBLL();
     EmpID          = EmployeeID;
     TabID          = TableID;
     mainform       = form;
     lsOrderDetail  = orderDetails;
     InitializeComponent();
     LoadData();
 }
コード例 #22
0
        private void btnİptal_Click(object sender, EventArgs e)
        {
            var donen = OrderBLL.CancelOrder(masaID);


            if (donen.Item1)
            {
                MessageBox.Show(donen.Item2);
                //Masayı boş set et.
                TableBLL.SetTableFree(masaID);
            }
            else
            {
                MessageBox.Show(donen.Item2);
            }
        }
コード例 #23
0
ファイル: Form1.cs プロジェクト: WilsonLaures/UTS-PROJECT
        private void Form1_Load(object sender, EventArgs e)
        {
            TableBLL tabelBLL = new TableBLL();

            foreach (DataRow row in tabelBLL.ds.Tables["table"].AsEnumerable())
            {
                Button button = new Button();
                button.Text = "Table " + row["table_number"];
                button.Name = row["id"].ToString();
                button.Size = new System.Drawing.Size(160, 124);
                button.UseVisualStyleBackColor = true;

                button.Click += new System.EventHandler(this.button_Click);
                flowLayoutPanel1.Controls.Add(button);
            }
        }
コード例 #24
0
ファイル: TableControl.cs プロジェクト: Thaibaduc/Restaurant
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure to delete table \"" + this.Table.Name + "\"", "Confirm", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                TableBLL tableBLL = new TableBLL();
                tableBLL.Delete(this.Table);

                // fire event
                if (this.OnDelete != null)
                {
                    this.OnDelete(this.Table);
                }
            }
        }
コード例 #25
0
ファイル: FieldsController.cs プロジェクト: benxuu/SYPM
 public ActionResult DelFieldsByIDs()
 {
     try
     {
         string Ids = Request["IDs"] == null ? "" : Request["IDs"];
         if (!string.IsNullOrEmpty(Ids))
         {
             string[] idArr = Ids.TrimEnd(',').Split(',');
             int      num   = 0;
             foreach (string id in idArr)
             {
                 FieldsEntity model     = new FieldsBLL().GetModel(int.Parse(id));
                 TableEntity  tabEntity = new TableBLL().GetModel(model.TabId);
                 string       dbTabName = "tb_" + tabEntity.TabName;
                 if (Comm.DelTabField(dbTabName, model.FieldName))
                 {
                     num = num + 1;
                 }
             }
             if (idArr.Length == num)
             {
                 if (new FieldsBLL().DeleteList(Ids))
                 {
                     return(Content("{\"msg\":\"删除成功!\",\"success\":true}"));
                 }
                 else
                 {
                     return(Content("{\"msg\":\"删除失败!\",\"success\":false}"));
                 }
             }
             else
             {
                 return(Content("{\"msg\":\"删除物理数据表失败!\",\"success\":false}"));
             }
         }
         else
         {
             return(Content("{\"msg\":\"删除失败!\",\"success\":false}"));
         }
     }
     catch (Exception ex)
     {
         return(Content("{\"msg\":\"删除失败," + ex.Message + "\",\"success\":false}"));
     }
 }
コード例 #26
0
ファイル: Form1.cs プロジェクト: WilsonLaures/UTS-PROJECT
        private void button_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            this.Visible = false;

            TableBLL tableBLL = new TableBLL();

            DataRow row = tableBLL.ds.Tables["table"].Select("id=" + btn.Name).FirstOrDefault();

            int id          = int.Parse(row["id"].ToString());
            int tableNumber = int.Parse(row["table_number"].ToString());

            MenuClient page = new MenuClient(id, tableNumber);

            page.ShowDialog();

            this.Close();
        }
コード例 #27
0
ファイル: TableController.cs プロジェクト: winterone/AFeiDemo
        public ActionResult GetAllTableInfo()
        {
            string strWhere = "1=1";
            string sort     = Request["sort"] == null ? "id" : Request["sort"];
            string order    = Request["order"] == null ? "asc" : Request["order"];

            if (!string.IsNullOrEmpty(Request["TabName"]) && !SqlInjection.GetString(Request["TabName"]))
            {
                strWhere += " and TabName like '%" + Request["TabName"] + "%'";
            }
            if (!string.IsNullOrEmpty(Request["TabViewName"]) && !SqlInjection.GetString(Request["TabViewName"]))
            {
                strWhere += " and TabViewName like '%" + Request["TabViewName"] + "%'";
            }
            //首先获取前台传递过来的参数
            int    pageindex  = Request["page"] == null ? 1 : Convert.ToInt32(Request["page"]);
            int    pagesize   = Request["rows"] == null ? 10 : Convert.ToInt32(Request["rows"]);
            int    totalCount = 0; //输出参数
            string strJson    = new TableBLL().GetPager("tbTable", "Id, TabName, TabViewName, IsActive, CreateTime, CreateBy, UpdateTime, UpdateBy", sort + " " + order, pagesize, pageindex, strWhere, out totalCount);

            return(Content("{\"total\": " + totalCount.ToString() + ",\"rows\":" + strJson + "}"));
        }
コード例 #28
0
ファイル: TableController.cs プロジェクト: winterone/AFeiDemo
        /// <summary>
        /// 编辑数据表
        /// </summary>
        /// <returns></returns>
        public ActionResult EditTable()
        {
            try
            {
                UserModel uInfo = ViewData["Account"] as UserModel;

                int        id               = Convert.ToInt32(Request["id"]);
                string     originalName     = Request["originalName"];
                string     originalViewName = Request["originalViewName"];
                TableModel typeEdit         = new TableBLL().GetModel(id);
                typeEdit.TabName     = Request["TabName"].Trim();
                typeEdit.TabViewName = Request["TabViewName"].Trim();
                typeEdit.IsActive    = bool.Parse(Request["IsActive"]);
                typeEdit.UpdateBy    = uInfo.AccountName;
                typeEdit.UpdateTime  = DateTime.Now;
                bool ExistsTabViewName = new TableBLL().ExistsTabViewName(typeEdit.TabViewName);
                if (typeEdit.TabViewName != originalViewName && ExistsTabViewName)
                {
                    return(Content("{\"msg\":\"修改失败,表显示名已存在!\",\"success\":false}"));
                }
                else
                {
                    int result = new TableBLL().Update(typeEdit);
                    if (result > 0)
                    {
                        return(Content("{\"msg\":\"修改成功!\",\"success\":true}"));
                    }
                    else
                    {
                        return(Content("{\"msg\":\"修改失败!\",\"success\":false}"));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Content("{\"msg\":\"修改失败," + ex.Message + "\",\"success\":false}"));
            }
        }
コード例 #29
0
        private void LoadData()
        {
            AreaBLL         areaBLL = new AreaBLL();
            List <DAL.Area> areas   = areaBLL.ListArea();

            this.tabControl.Controls.Clear();

            foreach (DAL.Area area in areas)
            {
                var t = new TabPage();
                t.Location = new Point(4, 22);
                t.Name     = area.Name;
                t.Padding  = new Padding(3);
                t.Size     = new Size(597, 257);
                t.Font     = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
                t.Text     = area.Name;
                t.UseVisualStyleBackColor = true;
                t.AutoScroll = true;
                this.tabControl.Controls.Add(t);

                // add layout
                FlowLayoutPanel flowLayoutPanel = new FlowLayoutPanel();
                flowLayoutPanel.Dock       = DockStyle.Fill;
                flowLayoutPanel.AutoScroll = true;
                t.Controls.Add(flowLayoutPanel);

                // add menu item
                TableBLL         tableBLL = new TableBLL();
                List <DAL.Table> tables   = tableBLL.ListTablesByArea(area);
                for (int i = 0; i < tables.Count; i++)
                {
                    TableControl tableControl = new TableControl(tables[i], true);
                    tableControl.Tag = area;
                    flowLayoutPanel.Controls.Add(tableControl);
                    tableControl.Click += new EventHandler(this.tableControl_Click);
                }
            }
        }
コード例 #30
0
ファイル: AlterTable.aspx.cs プロジェクト: ymyymyymy/AspNet
        protected void Button2_Click(object sender, EventArgs e)
        {
            string id = null;
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))).Checked)
                {
                    id += "'" + GridView1.DataKeys[i].Value + "'" + ",";

                }
            }

            if (id == null)
            {
               Response.Write(" <script>alert('请选择要删除的行!')</script>");
            }
            else
            {
                id = id.Substring(0, id.Length - 1);
                TableBLL obj = new TableBLL();
                Response.Write(" <script>alert('" + obj.deleteTablebyIds(id) + "')</script>");
                displaypage();
            }
        }