////private void dtpDate_ValueChanged(object sender, EventArgs e) ////{ //// // Update the hour property //// this.Hour = dtpDate.Value.Hour; ////} private void btnapply_Click(object sender, EventArgs e) { try { //int counter=1; if (CBoxExpert.Text == "" || CBoxMobileManufacturer.Text == "" || CBoxMobileName.Text == "" || txtOwner.Text == "") { MessageBox.Show("لطفا موارد خواسته شده را پر نمایید"); } else { var db = new linqDataContext(); var gvObj = new MainFrm(); //while (db.ChechOrderId(counter) != null) { counter++; } //while (gvObj.GVTable.Rows[3].Cells["OrederId"].Value!= null) { counter++; } //store /Convert.ToInt32(txtOrderId.Text), db.ApplyOrderOwnerDeviceTBL(Convert.ToInt32(CBSrvMan.SelectedValue.ToString()), CHBox1.Checked, CHBox2.Checked, CHBox3.Checked, false, mtxtDate.Text, Convert.ToInt32(txtpayment.Text), txtexpr.Text, txtOwner.Text, txtPhoneNumber.Text , CBoxMobileManufacturer.Text, CBoxMobileName.Text); this.Close(); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
public JsonResult SinhVien_load_list() { linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); var sp_result = obj.SinhVien_load_list(); var data = (from a in sp_result select new SinhvienModel { ID = a.ID.ToString(), Ma_sv = a.Ma_sv, Ten_sv = a.Ten_sv, CMND = a.CMND, SĐT = a.Sđt, Email = a.Email, Ngay_sinh = a.Ngay_sinh.ToString(), Gioi_tinh = a.Gioi_tinh, Active = a.Active.ToString(), UserName = a.UserName, PassWord = a.PassWord }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public JsonResult Load_thong_tinGV() { linqDataContext db = new linqDataContext(); var data = (from a in db.tb_giaoviens orderby a.Ten_gv select new GiaoVienModel { ID = a.ID.ToString(), Ma_gv = a.Ma_gv, Ten_gv = a.Ten_gv, Sđt = a.Sđt, Email = a.Email, Ngay_sinh = a.Ngay_sinh.ToString(), Gioi_tinh = a.Gioi_tinh, Active = a.Active.ToString(), UserName = a.UserName, PassWord = a.PassWord }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public JsonResult GiaoVien_load_ID() { var ses = (user_save)Session[constant.GV_SESSION]; linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); var sp_result = obj.GiaoVien_load_list(); var data = (from a in sp_result where a.ID == ses.UserID select new GiaoVienModel { ID = a.ID.ToString(), Ma_gv = a.Ma_gv, Ten_gv = a.Ten_gv, Gioi_tinh = a.Gioi_tinh, Ngay_sinh = a.Ngay_sinh.ToString(), Sđt = a.Sđt, Email = a.Email, Active = a.Active.ToString(), UserName = a.UserName, PassWord = a.PassWord }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public JsonResult LichHen_load_ID() { var ses = (user_save)Session[constant.GV_SESSION]; linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); var sp_result = obj.LichHen_load_list(); var data = (from a in sp_result where a.ID_gv == ses.UserID.ToString() select new LichHenModel { ID_lich_hen = a.ID_lich_hen.ToString(), Noi_dung_hen = a.Noi_dung_hen, ID_sv = a.ID_sv.ToString(), Ten_sv = a.Ten_sv, ID_gv = a.ID_gv.ToString(), Ten_gv = a.Ten_gv, Ngay_hen = a.Ngay_hen.ToString(), Gio_hen = a.Gio_hen.ToString(), Active = a.Active.ToString(), Ly_do_huy = a.Ly_do_huy, CreateUser = a.CreateUser, CreateDate = a.CreateDate.ToString(), ModifyUser = a.ModifyUser, ModifyDate = a.ModifyDate == null ? "" : a.ModifyDate.ToString() }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
private void btnApply_Click(object sender, EventArgs e) { try { // int temp; if (txtLName.Text == "" || txtname.Text == "") { MessageBox.Show("لطفا موارد خواسته شده را پر نمایید"); } else { var db = new linqDataContext(); var mainfrmObj = new MainFrm(); // temp = Convert.ToInt32(db.GetMaxIdSrvman()); ///stored //Convert.ToInt32(++temp), db.ApplySrvman(txtname.Text, txtLName.Text, CBoxExpert.Text); this.Close(); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
public JsonResult Load_thong_tinSV() { var ses = (user_save)Session[constant.SV_SESSION]; linqDataContext db = new linqDataContext(); var data = (from a in db.tb_sinhviens where a.ID == ses.UserID select new SinhvienModel { ID = a.ID.ToString(), Ma_sv = a.Ma_sv, Ten_sv = a.Ten_sv, CMND = a.CMND, SĐT = a.Sđt, Email = a.Email, Ngay_sinh = a.Ngay_sinh.ToString(), Gioi_tinh = a.Gioi_tinh, Active = a.Active.ToString(), UserName = a.UserName, PassWord = a.PassWord }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public JsonResult LichNghi_insert(LichNghiModel m) { var ses = (user_save)Session[constant.GV_SESSION]; m.ID_gv = ses.UserID.ToString(); linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); string dt; try { var check = (from x in db.tb_lichnghis where x.Ngay_nghi.ToString().Substring(0, 10) == m.Ngay_nghi.Substring(0, 10) && x.ID_gv == int.Parse(m.ID_gv) select x).ToList(); if (check.Count == 0) { var a = obj.LichNghi_insert(m); dt = a; } else { dt = "false"; } } catch (Exception ex) { dt = "Lỗi dữ liệu"; } return(Json(dt, JsonRequestBehavior.AllowGet)); }
public JsonResult LichHen_updateGV(LichHenModel m) { var ses = (user_save)Session[constant.GV_SESSION]; m.ModifyUser = ses.USER_NAME; QLDanhMucDAL obj = new QLDanhMucDAL(); string dt; try { var sp = obj.LichHen_update(m); if (sp == "true") { linqDataContext db = new linqDataContext(); var data = (from x in db.tb_giaoviens where x.ID == ses.UserID select x).ToList(); var info = data.FirstOrDefault(); var data2 = (from x in db.tb_sinhviens where x.ID == int.Parse(m.ID_sv) select x).ToList(); var info2 = data2.FirstOrDefault(); var data3 = (from x in db.tb_lichhens where x.ID_lich_hen == int.Parse(m.ID_lich_hen) select x).ToList(); var info3 = data3.FirstOrDefault(); Utils s = new Utils(); string email = WebConfigurationManager.AppSettings["Email_Support"]; string password = WebConfigurationManager.AppSettings["PassWord_Email_Support"]; var subject = "Thông báo lịch hẹn đã được duyệt"; var body = "Lịch hẹn của bạn và giảng viên : " + info.Ten_gv + " vào " + info3.Gio_hen + " giờ ngày " + (info3.Ngay_hen.ToString()).Substring(0, 10) + " đã được xác nhận, vui lòng đến địa điểm hẹn theo lịch đã đặt ra"; var a = s.SendEmail(info2.Email, subject, body, password, email); if (a.Result == "true") { dt = "Đã xác nhận lịch hẹn!"; } else { dt = a.Message; } } else { dt = sp; } } catch (Exception ex) { dt = "Lỗi dữ liệu"; } return(Json(dt, JsonRequestBehavior.AllowGet)); }
private void PersonalInfDelFrm_Load(object sender, EventArgs e) { try { var db = new linqDataContext(); GVTableDelSrv.DataSource = db.ShowSrvman(); this.FormBorderStyle = FormBorderStyle.FixedDialog; } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void SelectPartFrm_Load(object sender, EventArgs e) { try { var db = new linqDataContext(); GVTableShowPforD.DataSource = db.ShowPartsforDevice(); this.FormBorderStyle = FormBorderStyle.FixedDialog; } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void btnColse_Click(object sender, EventArgs e) { try { this.Close(); var db = new linqDataContext(); var MainFrmObj = new MainFrm(); MainFrmObj.GVTableSrv1.DataSource = db.ShowDeviceReapairing(Convert.ToInt32(MainFrmObj.txtSelectSrvman.SelectedValue)); MainFrmObj.GVTableSrv2.DataSource = db.ShowDeviceRepaired(Convert.ToInt32(MainFrmObj.txtSelectSrvman.SelectedValue)); } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void PersonalInfFrm_Load(object sender, EventArgs e) { try { // int temp; var db = new linqDataContext(); // MessageBox.Show(db.GetMaxIdSrvman().ToString()); // temp = Convert.ToInt32(db.GetMaxIdSrvman()); // textBoxSrvId.Text = (++temp).ToString(); this.FormBorderStyle = FormBorderStyle.FixedDialog; } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void btnDelSrv_Click(object sender, EventArgs e) { try { if (GVTableDelSrv.RowCount > 0) { var db = new linqDataContext(); db.DelSrvman(Convert.ToInt32(GVTableDelSrv.CurrentRow.Cells[0].Value)); GVTableDelSrv.DataSource = db.ShowSrvman(); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void SelectDevicesOfSrvman_Load(object sender, EventArgs e) { try { //label1.Text = idvalue; // var mainObj = new MainFrm(); var db = new linqDataContext(); GVTableNotSelectedDevice.DataSource = db.ShowDeviceNSofSrvman(); GVTableSelectedDevice.DataSource = db.ShowDeviceSofSrvman(Convert.ToInt32(idvalue)); ////Convert.ToInt32(mainObj.txtSelectSrvman.Text) this.FormBorderStyle = FormBorderStyle.FixedDialog; } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void btnApplyPForD_Click(object sender, EventArgs e) { try { if (GVTableShowPforD.RowCount > 0) { var db = new linqDataContext(); var gvObj = new MainFrm(); db.SelectPartsforDevice(db.GivePartIdTakePartName(GVTableShowPforD.CurrentRow.Cells[0].Value.ToString()), Convert.ToInt32(orderIdValue), PersianDate.GetPersianDate()); this.Close(); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
public JsonResult GiaoVien_load_lichnghi_ID(int ID) { linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); var sp_result = obj.GiaoVien_load_lichnghi(ID); var data = (from a in sp_result select new LichNghiModel { IDchitiet = a.IDChiTiet, ID_gv = a.ID_gv.ToString(), Ngay_nghi = a.Ngay_nghi.ToString() }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
private void btnApply_Click_1(object sender, EventArgs e) { try { //if (txtAlarm.Text == "" || txtName.Text == "" || txtPartId.Text == "" || txtPrice.Text == "") // MessageBox.Show("لطفا موارد خواسته شده را پر نمایید"); //else //{ var db = new linqDataContext(); db.EditPart(Convert.ToInt32(txtPartId.Text), txtPartName.Text, Convert.ToInt32(txtPartPrice.Text), Convert.ToInt32(txtPartAlert.Text)); var gvobj = new MainFrm(); gvobj.GVTablePart.DataSource = db.ShowParts(); this.Close(); } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } //} }
private void btnLtoR_Click(object sender, EventArgs e) { try { if (GVTableSelectedDevice.RowCount > 0) { var mainObj = new MainFrm(); var db = new linqDataContext(); db.FreeDeviceSrvMan(Convert.ToInt32(GVTableSelectedDevice.CurrentRow.Cells[0].Value), null); GVTableNotSelectedDevice.DataSource = db.ShowDeviceNSofSrvman(); GVTableSelectedDevice.DataSource = db.ShowDeviceSofSrvman(Convert.ToInt32(idvalue)); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
protected void btnDone_Click(object sender, EventArgs e) { linqDataContext dc = new linqDataContext(); PickUp tc = new PickUp(); tc.TaxiNo = txtTaxi.Text; tc.Depart = ddlDeparture.SelectedValue; tc.Arrival = ddlArrival.SelectedValue; tc.Price = Convert.ToDouble(txtPrice.Text); tc.DriverName = txtName.Text; tc.startTime = lblStart.Text; tc.endTime = lblEnd.Text; tc.Date = Convert.ToDateTime(lblDate.Text); dc.PickUps.InsertOnSubmit(tc); dc.SubmitChanges(); Response.Redirect("DriverPickUpDone.aspx?Email=" + txtEmail.Text); }
public JsonResult GiaoVien_load_lichnghi() { var ses = (user_save)Session[constant.GV_SESSION]; linqDataContext db = new linqDataContext(); QLDanhMucDAL obj = new QLDanhMucDAL(); var sp_result = obj.GiaoVien_load_lichnghi(ses.UserID); var data = (from a in sp_result select new LichNghiModel { IDchitiet = a.IDChiTiet, ID_gv = a.ID_gv.ToString(), Ngay_nghi = a.Ngay_nghi.ToString() }); return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
private void MainForm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'common_DataSet.ownertbl' table. You can move, or remove it, as needed. this.ownertblTableAdapter.Fill(this.common_DataSet.ownertbl); try { // TODO: This line of code loads data into the 'common_DataSet.MaxOrderId' table. You can move, or remove it, as needed. this.maxOrderIdTableAdapter.Fill(this.common_DataSet.MaxOrderId); // TODO: This line of code loads data into the 'common_DataSet.ShowDefectType' table. You can move, or remove it, as needed. this.showDefectTypeTableAdapter.Fill(this.common_DataSet.ShowDefectType); while (true) { LoginFrm obj = new LoginFrm(); System.Windows.Forms.DialogResult dr = obj.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.Abort) { MessageBox.Show("کاربر مورد نظر معتبر نمیباشد ", "وارد شدن کاربر نامعتبر" , MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading); } else if (dr == System.Windows.Forms.DialogResult.OK) { obj.Dispose(); break; } else if (dr == System.Windows.Forms.DialogResult.Cancel) { Application.Exit(); break; } obj.Dispose(); } // TODO: This line of code loads data into the 'common_DataSet.ShowDeviceManufacturer' table. You can move, or remove it, as needed. this.showDeviceManufacturerTableAdapter.Fill(this.common_DataSet.ShowDeviceManufacturer); // TODO: This line of code loads data into the 'common_DataSet.ShowSrvman' table. You can move, or remove it, as needed. this.showSrvmanTableAdapter.Fill(this.common_DataSet.ShowSrvman); // TODO: This line of code loads data into the 'common_DataSet.ShowDefectSolution' table. You can move, or remove it, as needed. this.showDefectSolutionTableAdapter.Fill(this.common_DataSet.ShowDefectSolution, CBoxDeviceName_for_ShowDefect.Text, CBoxDefectType_for_ShowDefect.Text , txtSearchDefect.Text); // TODO: This line of code loads data into the 'common_DataSet.ShowOrderMenu' table. You can move, or remove it, as needed. this.showOrderMenuTableAdapter.Fill(this.common_DataSet.ShowOrderMenu , txtSearchOrderId.Text , txtSearchDeviceName.Text , txtSearchOwner.Text); // TODO: This line of code loads data into the 'common_DataSet.ShowDeviceNames' table. You can move, or remove it, as needed. this.showDeviceNamesTableAdapter.Fill(this.common_DataSet.ShowDeviceNames); // TODO: This line of code loads data into the 'common_DataSet.ShowDefectType' table. You can move, or remove it, as needed. this.showDefectTypeTableAdapter.Fill(this.common_DataSet.ShowDefectType); // TODO: This line of code loads data into the 'common_DataSet.ShowSrvman' table. You can move, or remove it, as needed. this.showSrvmanTableAdapter.Fill(this.common_DataSet.ShowSrvman); # region DataGridview //foreach (DataRow row in GVTable)//??????????????????????? //{ // GVTable.Rows[0].Cells[0]. //} //this.txtSelectSrvman.Text="1"; // DataGridViewCheckBoxColumn GVchekedbox = new DataGridViewCheckBoxColumn(); //this.رمDataGridViewCheckBoxColumn.DataPropertyName = "رم"; //this.رمDataGridViewCheckBoxColumn.HeaderText = "رم"; //this.رمDataGridViewCheckBoxColumn.Name = "رمDataGridViewCheckBoxColumn"; //this.رمDataGridViewCheckBoxColumn.ReadOnly = true; //// //// شارژرDataGridViewCheckBoxColumn //// //this.شارژرDataGridViewCheckBoxColumn.DataPropertyName = "شارژر"; //this.شارژرDataGridViewCheckBoxColumn.HeaderText = "شارژر"; //this.شارژرDataGridViewCheckBoxColumn.Name = "شارژرDataGridViewCheckBoxColumn"; //this.شارژرDataGridViewCheckBoxColumn.ReadOnly = true; //// //// باطریDataGridViewCheckBoxColumn //// //this.باطریDataGridViewCheckBoxColumn.DataPropertyName = "باطری"; //this.باطریDataGridViewCheckBoxColumn.HeaderText = "باطری"; //this.باطریDataGridViewCheckBoxColumn.Name = "باطریDataGridViewCheckBoxColumn"; //this.باطریDataGridViewCheckBoxColumn.ReadOnly = true; //this.GVTable.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { // this.شمارهسفارشDataGridViewTextBoxColumn, // this.نامگوشیDataGridViewTextBoxColumn, // this.ناممشتریDataGridViewTextBoxColumn, // this.رمDataGridViewCheckBoxColumn, // this.شارژرDataGridViewCheckBoxColumn, // this.باطریDataGridViewCheckBoxColumn, // this.تاریخدریافتDataGridViewTextBoxColumn, // this.تاریختعمیرDataGridViewTextBoxColumn, // this.پیشپرداختDataGridViewTextBoxColumn, // this.توضیحاتDataGridViewTextBoxColumn, // this.نامقطعهDataGridViewTextBoxColumn, // this.نامتعمیرکارDataGridViewTextBoxColumn, // this.نختعمیرکارDataGridViewTextBoxColumn}); #endregion var db = new linqDataContext(); //GVTable.DataSource = db.ShowOrderMenu();///????????????????? GVTableSrv1.DataSource = db.ShowDeviceReapairing(Convert.ToInt32(txtSelectSrvman.SelectedValue)); GVTableSrv2.DataSource = db.ShowDeviceRepaired(Convert.ToInt32(txtSelectSrvman.SelectedValue)); GVTablePart.DataSource = db.ShowParts(); this.FormBorderStyle = FormBorderStyle.FixedDialog; }
public AccountDAL() { db = new linqDataContext(); }
public QLDanhMucDAL() { db = new linqDataContext(); }