protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //LOGİN GİRİŞ BAŞLANGIÇ Guid userId = new Guid(); if (Membership.GetUser() != null) { userId = new Guid(Membership.GetUser().ProviderUserKey.ToString()); } else { FormsAuthentication.SignOut(); Session.Abandon(); Response.Redirect("~/Account/Login.aspx"); return; } //LOGİN GİRİŞ BİTİŞ } var list = tiger2db.OD_SP_006_01_CARI_EKSTRE("").ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } else { EmployeesGrid.DataSource = null; EmployeesGrid.DataBind(); } }
private void EmployeesGrid_CellClicked(object sender, GridCellClickedEventArgs e) { if (e.Col == 2) { EditEmployee((Employee)EmployeesGrid.GetData(e.Row)); } }
protected void BindGrid() { var urun = db.S_Urunler().ToList(); if (urun.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UrunID"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = urun; } var tip = db.S_Tip(6).ToList(); if (tip.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["Onay"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = tip; } ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); var list = db.S_Siparislerim(Convert.ToInt32(bayiid)).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
//the method that create window wherein you can write data about employee which you wanna add private void Add_Button_Click(object sender, RoutedEventArgs e) { AddEmployeeWindow AddWindow = new AddEmployeeWindow(); // creating window AddWindow.Owner = this; if (AddWindow.ShowDialog() == true) { string[] fields = { AddWindow.DatePickerAddEmployee.SelectedDate.ToString(), AddWindow.EmployeeFirstName.Text, AddWindow.EmployeeLastName.Text, AddWindow.EmployeeUserName.Text, AddWindow.EmployeeCity.Text, AddWindow.EmployeeCountry.Text }; context.Employees.Add(new Employee(fields)); // add employee to the context EmployeesGrid.SelectedItem = EmployeesGrid.Items[EmployeesGrid.Items.Count - 1]; EmployeesGrid.ScrollIntoView(EmployeesGrid.Items[EmployeesGrid.Items.Count - 1]); } else { MessageBox.Show("Добавление отменено", "Уведомление", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); _BaslangicTarihi = OwnerPage.BaslangicTarihi; _BitisTarihi = OwnerPage.BitisTarihi; ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string BayiID = curProfile.GetPropertyValue("BayiID").ToString(); if (Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelYonetici" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "PersonelTeknik" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "TemsilciYonetici" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "DeveloperUser" || Roles.GetRolesForUser(Membership.GetUser().UserName)[0].ToString() == "Muhasebe") //if ile vdm personel yönetici yetkisi için roles dan kontrol edip -1 göndermek lazım. { if (BayiID == null || BayiID == "" || BayiID == "130" || BayiID == "140") { BayiID = "-1"; } } var list = db.S_HedefSatisDurumu(Convert.ToInt32(BayiID), _BaslangicTarihi, _BitisTarihi).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } else { EmployeesGrid.DataSource = null; EmployeesGrid.DataBind(); } }
protected void BindGrid() { var urun = db.S_Urunler().ToList(); if (urun.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["UrunID"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = urun; } var bayi = db.S_Bayi(-1).ToList(); if (bayi.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["BayiID"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = bayi; } var tip = db.S_Tip(6).ToList(); if (tip.Count > 0) { GridViewDataComboBoxColumn combo = EmployeesGrid.Columns["Onay"] as GridViewDataComboBoxColumn; combo.PropertiesComboBox.ValueType = typeof(int); combo.PropertiesComboBox.DataSource = tip; } var list = db.S_Siparisler(-1).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string Adi = e.NewValues["Adi"] == null ? "" : e.NewValues["Adi"].ToString(); db.I_Grup(Adi); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { _AramaKelimesi = "%" + OwnerPage.AramaKelimesi + "%"; if (OwnerPage.AramaKelimesi == null || OwnerPage.AramaKelimesi == "") { return; } var listCihazTakip = tiger2db.OD_SP_CihazTakip(_AramaKelimesi).ToList(); var listAraRapor = db.S_CihazTakipAraRapor().ToList(); List <CihazTakip> list = new List <CihazTakip>(); foreach (var item in listCihazTakip) { if (listAraRapor.Count > 0) { foreach (var item2 in listAraRapor) { if (item.IMEI == item2.IMEI.ToString()) { //******************* DateTime baslamaTarihi = (DateTime)item.FATURA_TAR; DateTime bitisTarihi = (DateTime)item2.AktivasyonTarihi; TimeSpan kalangun = bitisTarihi - baslamaTarihi; //Sonucu zaman olarak döndürür int toplamGun = (int)kalangun.TotalDays; // kalanGun den TotalDays ile sadece toplam gun değerini çekiyoruz. //******************* var c = new CihazTakip { BayiAdi = item.FIRMA_ISMI, BayiKodu = item2.BayiKodu, CihazAdi = item.STOK_ACIKLAMASI, CihazKodu = item.STOK_KODU, IMEI = item.IMEI, FaturaTarihi = (DateTime)item.FATURA_TAR, FaturaTutari = (decimal)item.FATURA_NET_TUTARI, BayiSatisTarihi = (DateTime)item2.AktivasyonTarihi, Gun = toplamGun }; list.Add(c); } } } } if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } else { EmployeesGrid.DataSource = null; EmployeesGrid.DataBind(); } }
protected void BindGrid() { var list = db.S_AktivasyonYonetici(-1).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
protected void EmployeesGrid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { int rowindex = EmployeesGrid.FindVisibleIndexByKeyValue(e.Keys[EmployeesGrid.KeyFieldName]); ASPxGridView grid = (ASPxGridView)sender; var id = grid.GetRowValues(rowindex, "ID").ToString(); db.D_MusteriTemsilcisi(Convert.ToInt32(id)); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void EmployeesGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; string id = grid.GetRowValues(grid.EditingRowVisibleIndex, "ID").ToString(); string Adi = e.NewValues["Adi"] == null ? "" : e.NewValues["Adi"].ToString(); db.U_Grup(Convert.ToInt32(id), Adi); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string AdiSoyadi = e.NewValues["AdiSoyadi"] == null ? "" : e.NewValues["AdiSoyadi"].ToString(); string UserID = e.NewValues["UserID"] == null ? "" : e.NewValues["UserID"].ToString(); Guid guid = new Guid(UserID); db.I_MusteriTemsilcisi(AdiSoyadi, guid); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void EmployeesGrid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; int rowindex = EmployeesGrid.FindVisibleIndexByKeyValue(e.Keys[EmployeesGrid.KeyFieldName]); string id = grid.GetRowValues(rowindex, "ID").ToString(); db.D_Duyurular(Convert.ToInt32(id)); e.Cancel = true; grid.CancelEdit(); BindGrid(); }
protected void EmployeesGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; string id = grid.GetRowValues(grid.EditingRowVisibleIndex, "ID").ToString(); string onay = e.NewValues["Onay"].ToString(); db.U_Siparis(Convert.ToInt32(id), Convert.ToInt32(onay)); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); var list = db.OD_SP_PRONIST_006_FATURA().ToList(); EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); var list = db.OD_SP_US_006_01_MALZEME_SONALIMMALIYET().ToList(); EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string adet = e.NewValues["Adet"].ToString(); string urunid = e.NewValues["UrunID"].ToString(); string bayiid = e.NewValues["BayiID"].ToString(); db.I_Siparislerim(Convert.ToInt32(bayiid), Convert.ToInt32(urunid), Convert.ToInt32(adet)); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string adet = e.NewValues["Adet"].ToString(); string urunid = e.NewValues["UrunID"].ToString(); ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); db.I_Siparislerim(Convert.ToInt32(bayiid), Convert.ToInt32(urunid), Convert.ToInt32(adet)); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { ProfileBase curProfile = ProfileBase.Create(Membership.GetUser().UserName); string bayiid = curProfile.GetPropertyValue("BayiID").ToString(); var list = db.S_AktivasyonVodafoneNet(-1, Convert.ToInt32(bayiid)).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string DokumanAdi = e.NewValues["DokumanAdi"].ToString(); string tipid = e.NewValues["DokumanTipi_TipID5"].ToString(); ASPxCheckBox checkBox = EmployeesGrid.FindEditFormTemplateControl("ASPxGridViewTemplateReplacement6") as ASPxCheckBox; //ASPxCheckBox checkBox = ((ASPxGridView)sender).FindEditFormLayoutItemTemplateControl("ASPxGridViewTemplateReplacement6") as ASPxCheckBox; db.I_Dokuman(DokumanAdi, DataProvider.docAdi, Convert.ToBoolean(checkBox.Checked), Convert.ToInt32(tipid)); e.Cancel = true; EmployeesGrid.CancelEdit(); GridUpdating(); }
private void DepartmentsTree_SelectionChanged(object sender, EventArgs _) { TreeNode node = DepartmentsTree.SelectedNode; Employee[] emps = ((node != null ? (Employee[])Tree.GetTreeNodeData(node) : null) ?? new Employee[0]); EmployeesGrid.BeginRebuild(); foreach (Employee e in emps) { EmployeesGrid.AddItem(GetGridTexts(e), e); } EmployeesGrid.AddItem(GetGridTexts(null), null); EmployeesGrid.EndRebuild(); }
protected void EmployeesGrid_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "Total") { if (e.IsGetData) { int visibleIndex = EmployeesGrid.FindVisibleIndexByKeyValue(e.GetListSourceFieldValue("FISNO")); e.Value = (visibleIndex != 0) ? Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "BORC")) + Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "ALACAK")) + Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex - 1, "Total")) : Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "BORC")) - Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex - 1, "Total")); } } }
protected void EmployeesGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; string id = grid.GetRowValues(grid.EditingRowVisibleIndex, "ID").ToString(); string AdiSoyadi = e.NewValues["AdiSoyadi"] == null ? "" : e.NewValues["AdiSoyadi"].ToString(); string UserID = e.NewValues["UserID"] == null ? "" : e.NewValues["UserID"].ToString(); Guid guid = new Guid(UserID); db.U_MusteriTemsilcisi(Convert.ToInt32(id), AdiSoyadi, guid); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { var listBakiye = tiger2db.OD_SP_BayiBakiye(null).ToList(); var listTeminat = db.S_BayiTeminat().ToList(); List <BayiBakiyeTeminat> list = new List <BayiBakiyeTeminat>(); foreach (var item in listBakiye) { if (listTeminat.Count > 0) { foreach (var item2 in listTeminat) { if (item.CODE == item2.BayiKodu) { var c = new BayiBakiyeTeminat { BayiKodu = item.CODE, BayiAdi = item.BayiAdi, Bakiye = (decimal)item.Bakiye, Teminat = (decimal)item2.Teminat }; list.Add(c); } } } else { var c = new BayiBakiyeTeminat { BayiKodu = item.CODE, BayiAdi = item.BayiAdi, Bakiye = (decimal)item.Bakiye, Teminat = (decimal)0 }; list.Add(c); } } if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } else { EmployeesGrid.DataSource = null; EmployeesGrid.DataBind(); } }
protected void ASPxCallback1_Callback(object source, CallbackEventArgs e) { int editingRowVisibleIndex = EmployeesGrid.EditingRowVisibleIndex; if (editingRowVisibleIndex > -1) { string rowValue = EmployeesGrid.GetRowValues(editingRowVisibleIndex, "Aktif").ToString(); e.Result = rowValue; } else { e.Result = "False"; } }
private List <Employee> GetCurrentEmployees() { var l = new List <Employee>(); for (int i = 0, n = EmployeesGrid.NumRows; i < n; i++) { var e = (Employee)EmployeesGrid.GetData(i); if (e != null) { l.Add(e); } } return(l); }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); var list = db.S_Duyurularim(null).ToList(); if (list.Count > 0) { EmployeesGrid.DataSource = list; EmployeesGrid.DataBind(); } }
protected void EmployeesGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { string UrunKodu = e.NewValues["UrunKodu"] == null ? "" : e.NewValues["UrunKodu"].ToString(); string resimadi = DataProvider.urunresmi; string UrunAdi = e.NewValues["UrunAdi"] == null ? "" : e.NewValues["UrunAdi"].ToString(); string KategoriID_TipID4 = e.NewValues["KategoriID_TipID4"] == null ? "" : e.NewValues["KategoriID_TipID4"].ToString(); string Marka = e.NewValues["Marka"] == null ? "" : e.NewValues["Marka"].ToString(); string Model = e.NewValues["Model"] == null ? "" : e.NewValues["Model"].ToString(); string Fiyat = e.NewValues["Fiyat"] == null ? "" : e.NewValues["Fiyat"].ToString(); db.I_UrunTanimlari(UrunKodu, UrunAdi, Convert.ToInt32(KategoriID_TipID4), Marka, Model, Convert.ToDecimal(Fiyat), resimadi); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }
protected void BindGrid() { //EmployeesGrid.DataSource = DataProvider.Employees.ToList(); //EmployeesGrid.FilterExpression = OwnerPage.FilterBag.GetExpression(false); //EmployeesGrid.DataBind(); var users = Membership.GetAllUsers(); var userList = new List <MembershipUser>(); foreach (MembershipUser user in users) { userList.Add(user); } EmployeesGrid.DataSource = userList.ToList(); EmployeesGrid.DataBind(); }
protected void EmployeesGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; string id = grid.GetRowValues(grid.EditingRowVisibleIndex, "ID").ToString(); string UrunKodu = e.NewValues["UrunKodu"] == null ? "" : e.NewValues["UrunKodu"].ToString(); string resimadi = DataProvider.urunresmi; string UrunAdi = e.NewValues["UrunAdi"] == null ? "" : e.NewValues["UrunAdi"].ToString(); string KategoriID_TipID4 = e.NewValues["KategoriID_TipID4"] == null ? "" : e.NewValues["KategoriID_TipID4"].ToString(); string Marka = e.NewValues["Marka"] == null ? "" : e.NewValues["Marka"].ToString(); string Model = e.NewValues["Model"] == null ? "" : e.NewValues["Model"].ToString(); string Fiyat = e.NewValues["Fiyat"] == null ? "" : e.NewValues["Fiyat"].ToString(); db.U_UrunTanimlari(Convert.ToInt32(id), UrunKodu, UrunAdi, Convert.ToInt32(KategoriID_TipID4), Marka, Model, Convert.ToDecimal(Fiyat), resimadi); e.Cancel = true; EmployeesGrid.CancelEdit(); Update(); }