public yy_pz_xg_panel(yy_pz_panel yypzpanel, YY_PZ_TAB pzobj) { InitializeComponent(); _pzobj = pzobj; _yypzpanel = yypzpanel; }
private void buttonX3_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { if (MessageBox.Show("删除该记录?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Cursor.Current = Cursors.WaitCursor; try { YY_PZ_TAB pzobj = dataGridView1.SelectedRows[0].Tag as YY_PZ_TAB; if (yypzbll.Delete(pzobj.ID)) { MessageBox.Show("删除成功!", "软件提示"); RefreshCode(); } else { MessageBox.Show("删除失败!", "请联系管理员"); } } finally { Cursor.Current = Cursors.Default; } } } else { MessageBox.Show("该记录还未保存!"); } }
private YY_PZ_TAB GetObj() { YY_PZ_TAB yypzobj = CommonHelper.GetObj <YY_PZ_TAB>(this.Controls); if (_pzobj != null) { yypzobj.ID = _pzobj.ID; } return(yypzobj); }
private void buttonX4_Click(object sender, EventArgs e) { YY_PZ_TAB yypzobj = GetObj(); if (yypzbll.SaveOrUpdate(yypzobj)) { MessageBox.Show("保存成功!"); this.Close(); _yypzpanel.RefreshCode(); } else { MessageBox.Show("保存失败!请联系管理员"); } }
private void Generate(bool justOne) { var isFull = true; var yy_xm = this.yy_xm.Text; YY_PZ_TAB pzobj = pzbll.GetByXm(yy_xm); DateTime starttime = dateTimePicker1.Value; DateTime endtime = dateTimePicker2.Value; int daycount = (endtime - starttime).Days; if (pzobj != null) { YY_ASD_TAB yyobj = CommonHelper.GetObjMenzhen <YY_ASD_TAB>(panel2.Controls, 0); if (!String.IsNullOrEmpty(pzobj.PZ_XQ)) { string[] xqargs = pzobj.PZ_XQ.Split(','); //foreach (string xq in xqargs) //{ for (int i = 0; i <= daycount; i++) { var sjdargs = _detailList.Select(t => t.TIME).ToArray(); if (xqargs.Contains(((int)starttime.AddDays(i).DayOfWeek).ToString())) { for (int j = 0; j < sjdargs.Length; j++) { if (bll.IsFull(yy_xm, starttime.AddDays(i).ToString("yyyy-MM-dd"), sjdargs[j])) { continue; } isFull = false; yyobj.YY_BH = ""; yyobj.YY_BZ = ""; yyobj.YY_DJRQ = DateTime.Now.ToString("yyyy-MM-dd"); yyobj.YY_RQ = starttime.AddDays(i).ToString("yyyy-MM-dd"); yyobj.YY_SFJF = ""; yyobj.YY_SJD = sjdargs[j]; yyobj.YY_XM = yy_xm; bll.Add(yyobj); if (justOne) { _obj = yyobj; RefreshCheckList(); return; } } } } //} if (isFull) { MessageBox.Show("该时间段的预约已满"); } else { RefreshCheckList(); } } } }