當前位置: 首頁>>代碼示例>>C#>>正文


C# YouSoftBathGeneralClass.BathDBDataContext類代碼示例

本文整理匯總了C#中YouSoftBathGeneralClass.BathDBDataContext的典型用法代碼示例。如果您正苦於以下問題:C# BathDBDataContext類的具體用法?C# BathDBDataContext怎麽用?C# BathDBDataContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BathDBDataContext類屬於YouSoftBathGeneralClass命名空間,在下文中一共展示了BathDBDataContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EmployeeAuthorityForm

        public EmployeeAuthorityForm(BathDBDataContext dc, Employee employee)
        {
            db = dc;
            m_Employee = employee;

            InitializeComponent();
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:7,代碼來源:EmployeeAuthorityForm.cs

示例2: BonusTableForm_Load

        //對話框載入
        private void BonusTableForm_Load(object sender, EventArgs e)
        {
            db = new BathDBDataContext(LogIn.connectionString);
            var format = db.Options.FirstOrDefault().提成報表格式;
            if (format == null)
            {
                format = FORMAT_ALL_DIANLUN;
                db.SubmitChanges();
            }

            if (format == FORMAT_ALL_DIANLUN)
            {
                CheckerLunDian.Checked = true;
                CheckerPaid.Checked = true;
            }
            else if (format == FORMAT_ALL_NODIANLUN)
            {
                CheckerLunDian.Checked = false;
                CheckerPaid.Checked = true;
            }
            else if (format == FORMAT_INPUTTIME_DIANLUN)
            {
                CheckerLunDian.Checked = true;
                CheckerPaid.Checked = false;
            }
            else if (format == FORMAT_INPUTTIME_NODIANLUN)
            {
                CheckerLunDian.Checked = false;
                CheckerPaid.Checked = false;
            }
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:32,代碼來源:BounsTableSetForm.cs

示例3: SeatExpenseForm

        //構造函數
        public SeatExpenseForm(Seat seat)
        {
            db = new BathDBDataContext(LogIn.connectionString);
            m_Seat = db.Seat.FirstOrDefault(x => x.text == seat.text);

            InitializeComponent();
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:SeatExpenseForm.cs

示例4: BTRegister_Click

        private void BTRegister_Click(object sender, EventArgs e)
        {
            string code = TextCode.Text.Trim();
            if (code == "")
            {
                BathClass.printErrorMsg("公司代碼為空!");
                return;
            }

            string name = TextName.Text.Trim();
            if (name == "")
            {
                BathClass.printErrorMsg("公司名稱為空!");
                return;
            }

            string errorDesc = "";
            var success = ShopManagement.registerCompany(LogIn.connectionIP, code, name, TextTel.Text.Trim(), TextTel.Text.Trim(), out errorDesc);

            if (success)
            {
                var db = new BathDBDataContext(LogIn.connectionString);
                db.Options.FirstOrDefault().company_Code = code;
                db.SubmitChanges();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                BathClass.printErrorMsg(errorDesc);
            }
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:33,代碼來源:ChainRegisterForm.cs

示例5: MemberPromotionForm

 //構造函數
 public MemberPromotionForm(List<HotelRoom> seat, string systemid)
 {
     m_systemId = systemid;
     db = new BathDBDataContext(LogIn.connectionString);
     m_Seats.AddRange(db.HotelRoom.Where(x => seat.Contains(x)));
     InitializeComponent();
 }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:MemberPromotionForm.cs

示例6: dgv_show

        //查詢
        private void dgv_show()
        {
            dgv.Rows.Clear();

            var dc = new BathDBDataContext(LogIn.connectionString);
            var all_his_orders = dc.HisOrders.Where(x => x.inputTime >= lastTime && x.inputTime <= thisTime && x.deleteEmployee == null);
            var orderLst = dc.Orders.Where(x => x.inputTime >= lastTime && x.inputTime <= thisTime && x.deleteEmployee == null);

            all_his_orders = all_his_orders.Where(x => x.technician != null);
            orderLst = orderLst.Where(x => x.technician != null);

            if (catgory.Text != "所有類別")
            {
                var catgoryId = dc.Catgory.FirstOrDefault(x => x.name == catgory.Text).id;
                var menus = dc.Menu.Where(x => x.technician && x.catgoryId == catgoryId).Select(x => x.name);
                orderLst = orderLst.Where(x => menus.Contains(x.menu));
                all_his_orders = all_his_orders.Where(x => menus.Contains(x.menu));
            }
            foreach (var order in all_his_orders)
            {
                dgv.Rows.Add(order.technician, order.text, order.menu, order.number, order.inputTime.ToString("MM-dd HH:mm"));
            }

            foreach (var order in orderLst)
            {
                dgv.Rows.Add(order.technician, order.text, order.menu, order.number, order.inputTime.ToString("MM-dd HH:mm"));
            }
            BathClass.set_dgv_fit(dgv);
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:30,代碼來源:TechDetailsForm.cs

示例7: TableOrderTableForm

 //構造函數
 public TableOrderTableForm(string con_str, Employee user)
 {
     m_con_str = con_str;
     m_user = user;
     db = new BathDBDataContext(m_con_str);
     InitializeComponent();
 }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:TableOrderTableForm.cs

示例8: InputSeatForm

        //重載構造函數
        public InputSeatForm(List<int> ss)
        {
            db = new BathDBDataContext(MainWindow.connectionString);
            m_StatusList = ss;

            InitializeComponent();
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:InputSeatForm.cs

示例9: InputHotelRoomForm

        //重載構造函數
        public InputHotelRoomForm(List<int> ss)
        {
            db = new BathDBDataContext(LogIn.connectionString);
            m_StatusList = ss;

            InitializeComponent();
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:InputHotelRoomForm.cs

示例10: InputEmployee

        private bool use_card = false; //使用工卡

        #endregion Fields

        #region Constructors

        //構造函數
        public InputEmployee(BathDBDataContext dc)
        {
            db = dc;
            use_card = MConvert<bool>.ToTypeOrDefault(db.Options.FirstOrDefault().啟用員工服務卡, false);
            InitializeComponent();
            text.Enabled = !use_card;
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:14,代碼來源:InputEmployee.cs

示例11: getCurrentStock

        public double getCurrentStock(BathDBDataContext db, string name)
        {
            DateTime dt_st = DateTime.Parse(st.Value.Date.ToString("yyyy-MM-dd") + " 00:00:00");
            DateTime dt_et = DateTime.Parse(et.Value.Date.ToString("yyyy-MM-dd") + " 23:59:59");
            double number_Ins = 0;
            double number_Outs = 0;
            double number_OrderOuts = 0;
            double number_pans = 0;
            double number_Total = 0;

            var name_stockIns = db.StockIn.Where(x => x.name == name).Where(x => x.amount != null).Where(x=>x.date>=dt_st&&x.date<=dt_et);
            if (name_stockIns.Any())
                number_Ins = name_stockIns.Sum(x => x.amount).Value;

            var name_stockOuts = db.StockOut.Where(x => x.name == name).Where(x => x.amount != null).Where(x=>x.date>=dt_st&&x.date<=dt_et);
            if (name_stockOuts.Any())
                number_Outs = MConvert<double>.ToTypeOrDefault(name_stockOuts.Sum(x => x.amount), 0);

            var name_orderStockOuts = db.OrderStockOut.Where(x => x.name == name).Where(x => x.amount != null).Where(x => x.date >= dt_st && x.date <= dt_et);
            if (name_orderStockOuts.Any())
                number_OrderOuts = MConvert<double>.ToTypeOrDefault(name_orderStockOuts.Sum(x => x.amount), 0);

            var name_pans = db.Pan.Where(x => x.name == name).Where(x => x.amount != null).Where(x => x.date >= dt_st && x.date <= dt_et);
            if (name_pans.Any())
                number_pans = MConvert<double>.ToTypeOrDefault(name_pans.Sum(x => x.amount), 0);
            number_Total = number_Ins + number_pans - number_Outs - number_OrderOuts;
            return Math.Round(number_Total,2);
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:28,代碼來源:TransferStockMangeForm.cs

示例12: EditForm

 public EditForm(BathDBDataContext dc, StockIn stockin)
 {
     db = dc;
     inStock = stockin;
     InitializeComponent();
     stock.Items.AddRange(db.Stock.Select(x => x.name).ToArray());
     provider.Items.AddRange(db.Provider.Select(x => x.name).ToArray());
     goodsCat.Items.AddRange(db.GoodsCat.Select(x => x.name).ToArray());
     unit.Items.AddRange(db.Unit.Select(x => x.name).ToArray());
     var employees = db.Employee.Where(x => !db.Job.FirstOrDefault(y => y.id == x.jobId).name.Contains("技師"));
     checker.Items.AddRange(employees.Select(x => x.name).ToArray());
     transactor.Items.AddRange(employees.Select(x => x.name).ToArray());
     var stocktext = db.Stock.FirstOrDefault(x => x.id == stockin.stockId);
     stock.Text = stocktext !=null?stocktext.name:"";
     string nametext = stockin.name;
     name.Text = nametext != "" ? nametext : "";
     var goodCatext = db.GoodsCat.FirstOrDefault(y => y.id == db.StorageList.FirstOrDefault(x => x.name == stockin.name).goodsCatId);
     //MessageBox.Show("該商品沒分類");
     goodsCat.Text = goodCatext != null ? goodCatext.name : "";
     string amouttext = stockin.amount.ToString();
     amount.Text = amouttext != "" ? amouttext : "";
     var providertext = db.Provider.FirstOrDefault(x => x.id == stockin.providerId);
     provider.Text = providertext != null ? providertext.name : "";
     string costtext = stockin.cost.ToString();
     cost.Text = costtext != "" ? costtext : "";
     string moneytext = stockin.money.ToString();
     money.Text = moneytext != "" ? moneytext : "";
     dtPickerIntoStock.Value = stockin.date != null ? stockin.date : DateTime.Now;
     string checkertext = stockin.checker;
     checker.Text = checkertext != "" ? checkertext : "";
     string transactortext=stockin.transactor;
     transactor.Text = transactortext != "" ? transactortext : "";
     string notetext = stockin.note;
     note.Text = notetext != "" ? notetext : "";
 }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:35,代碼來源:EditForm.cs

示例13: CheckForm

 //構造函數
 public CheckForm(Employee user)
 {
     m_User = user;
     db = new BathDBDataContext(MainForm.connectionString);
     InitializeComponent();
     btnPwd.Text = "修改\n密碼";
 }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:CheckForm.cs

示例14: dgvDetails_show

        //顯示詳細訂單信息
        private void dgvDetails_show()
        {
            var idobj = dgv.CurrentRow.Cells[5].Value;
            if (idobj == null)
                return;

            Int64 act_id;
            if (!Int64.TryParse(idobj.ToString(), out act_id))
                return;

            var dc = new BathDBDataContext(LogIn.connectionString);
            var act = dc.Account.FirstOrDefault(x => x.id == act_id);
            if (act == null)
                return;

            var orders = dc.HisOrders.Where(x => x.accountId == act_id);
            orders = orders.OrderBy(x => x.inputTime);
            foreach (var o in orders)
            {
                string[] row = new string[7];
                row[0] = o.text;
                row[1] = o.menu;
                row[2] = o.technician;

                row[4] = o.number.ToString();

                row[6] = o.inputEmployee;

                var m = dc.Menu.FirstOrDefault(x => x.name == o.menu);
                bool redRow = false;
                if (m == null)
                {
                    row[3] = "";
                    row[5] = o.money.ToString();
                    redRow = true;
                }
                else
                {
                    if (o.priceType == "每小時")
                    {
                        row[3] = o.money.ToString() + "/時";
                        row[5] = (Math.Ceiling((act.payTime - o.inputTime).TotalHours) * o.money).ToString();
                    }
                    else
                    {
                        row[3] = m.price.ToString();
                        row[5] = o.money.ToString();
                    }
                }
                this.Invoke(new delegate_add_row(add_row_details), (Object)row);
                //dgvExpense.Rows.Add(row);
                if (redRow)
                {
                    this.Invoke(new delegate_no_para(change_dgv_color), null);
                    //dgvExpense.Rows[dgvExpense.Rows.Count - 1].DefaultCellStyle.BackColor = Color.Red;
                }
            }
            //BathClass.set_dgv_fit(dgvExpense);
        }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:60,代碼來源:MemberExpenseTableForm.cs

示例15: OpenSeatForm

 public OpenSeatForm(HotelRoom seat, bool open)
 {
     m_open = open;
     db = new BathDBDataContext(LogIn.connectionString);
     m_Seats.Add(seat);
     chainId = BathClass.chainId(db, LogIn.connectionString);
     InitializeComponent();
 }
開發者ID:huaminglee,項目名稱:yousoftbath,代碼行數:8,代碼來源:OpenSeatForm.cs


注:本文中的YouSoftBathGeneralClass.BathDBDataContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。