本文整理汇总了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();
}
示例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;
}
}
示例3: SeatExpenseForm
//构造函数
public SeatExpenseForm(Seat seat)
{
db = new BathDBDataContext(LogIn.connectionString);
m_Seat = db.Seat.FirstOrDefault(x => x.text == seat.text);
InitializeComponent();
}
示例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);
}
}
示例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();
}
示例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);
}
示例7: TableOrderTableForm
//构造函数
public TableOrderTableForm(string con_str, Employee user)
{
m_con_str = con_str;
m_user = user;
db = new BathDBDataContext(m_con_str);
InitializeComponent();
}
示例8: InputSeatForm
//重载构造函数
public InputSeatForm(List<int> ss)
{
db = new BathDBDataContext(MainWindow.connectionString);
m_StatusList = ss;
InitializeComponent();
}
示例9: InputHotelRoomForm
//重载构造函数
public InputHotelRoomForm(List<int> ss)
{
db = new BathDBDataContext(LogIn.connectionString);
m_StatusList = ss;
InitializeComponent();
}
示例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;
}
示例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);
}
示例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 : "";
}
示例13: CheckForm
//构造函数
public CheckForm(Employee user)
{
m_User = user;
db = new BathDBDataContext(MainForm.connectionString);
InitializeComponent();
btnPwd.Text = "修改\n密码";
}
示例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);
}
示例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();
}