private void DEl_all_Click(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_cargo select c; db.tbl_cargo.RemoveRange(all); db.SaveChanges(); cargo_datagrid.ItemsSource = db.tbl_cargo.ToList(); }
private void Delete_all_rows_Click(object sender, RoutedEventArgs e) { try { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_crw select c; db.tbl_crw.RemoveRange(all); db.SaveChanges(); crew_datagrid.ItemsSource = db.tbl_crw.ToList(); } catch { } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { try { Database1Entities db = new Database1Entities(); var del = db.tbl_deliverygrid.Where(c => c.Id.ToString() == Id).SingleOrDefault(); db.tbl_deliverygrid.Remove(del); db.SaveChanges(); invoice_datagrid.ItemsSource = db.tbl_deliverygrid.ToList(); } catch { notifier.ShowError("رکوردی موجود نیست"); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { try { Database1Entities db = new Database1Entities(); var del = db.tbl_manifest.Where(c => c.Id.ToString() == Id).SingleOrDefault(); db.tbl_manifest.Remove(del); db.SaveChanges(); manifest_datagrid.ItemsSource = db.tbl_manifest.ToList(); } catch { } }
private void Delete_info_Click(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_crwInf select c; db.tbl_crwInf.RemoveRange(all); db.SaveChanges(); notifier.ShowWarning("اطلاعات قبلی با موقیت پاک شد.بعد از وارد کردن اطلاعات جدید " + "\n submit info \n" + "را بزنید"); }
private void Button_Click_2(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_ImoGen select c; db.tbl_ImoGen.RemoveRange(all); db.SaveChanges(); notifier.ShowWarning("اطلاعات قبلی با موفقیت حذف گردید . اطلاعات جدید را وارد و سپس " + "\n submit \n" + "را بزنید"); }
private void Button_Click_2(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_bill select c; db.tbl_bill.RemoveRange(all); db.SaveChanges(); notifier.ShowWarning("اطلاعات قبلی با موفقیت پاک شد .بعد از اضافه کردن اطلاعات جدید " + "\n submit info \n" + "را بزنید"); }
private void Del_rows_Click(object sender, RoutedEventArgs e) { try { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_deliverygrid select c; db.tbl_deliverygrid.RemoveRange(all); db.SaveChanges(); invoice_datagrid.ItemsSource = db.tbl_deliverygrid.ToList(); } catch { notifier.ShowWarning("رکوردی موجود نیست"); } }
private void Del_info_Click(object sender, RoutedEventArgs e) { try { Database1Entities db = new Database1Entities(); var all = from c in db.tbl_deliveryinfo select c; db.tbl_deliveryinfo.RemoveRange(all); db.SaveChanges(); notifier.ShowWarning("اطلاعات قبلی با موفقیت ثبت شد . بعد از وارد کردن اطلاعات جدید " + "\n submit info \n " + "را بزنید"); } catch { } }
private void delete_Click(object sender, RoutedEventArgs e) { try { string constr = "metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="Data Source="; constr = constr + System.Reflection.Assembly.GetExecutingAssembly().Location + "\\Debug\\PishDB.sdf" + "; Max Database Size = 4000 & quot; providerName = 'System.Data.EntityClient' />"; MessageBox.Show(constr); Database1Entities db = new Database1Entities(); var del = db.tbl_cargo.Where(c => c.Id.ToString() == Id).SingleOrDefault(); db.tbl_cargo.Remove(del); db.SaveChanges(); cargo_datagrid.ItemsSource = db.tbl_cargo.ToList(); } catch { notifier.ShowError("رکوردی موجود نیست"); } }
private void Submit_info_Click(object sender, RoutedEventArgs e) { if (Acheck.IsChecked == false & Dcheck.IsChecked == true) { txtblck_AD.Text = "Departure"; } else if (Acheck.IsChecked == true & Dcheck.IsChecked == false) { txtblck_AD.Text = "Arrival"; } else if (Acheck.IsChecked == true & Dcheck.IsChecked == true) { notifier.ShowError("یک وضعیت فقط قابل انتخاب است"); } else if (Acheck.IsChecked == false & Dcheck.IsChecked == false) { notifier.ShowError("لطفا ورود یا خروج را تعیین کنید"); } if (call_sign_txt.Text == "" || IMO_num.Text == "" || ship_name.Text == "" || portAD.Text == "" || flag_text.Text == "" || masters.Text == "" || lastport.Text == "" || dateAD.Text == "" || txtblck_AD.Text == "") { notifier.ShowError("لطفا تمامی فیلد ها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_CargoInf tcargoInf = new tbl_CargoInf() { call_sign = call_sign_txt.Text, name_ship = ship_name.Text, imo_number = int.Parse(IMO_num.Text), port_report = portAD.Text, flag_ship = flag_text.Text, masters_name = masters.Text, portOfLoading = lastport.Text, portOfDischarge = dateAD.Text, ArrivalDeparture = txtblck_AD.Text }; db.tbl_CargoInf.Add(tcargoInf); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); } }
private void Submit_info_Click(object sender, RoutedEventArgs e) { if (AcheckcheckBox.IsChecked == false & Dcheck.IsChecked == true) { ADtxt.Text = "Departure"; } else if (AcheckcheckBox.IsChecked == true & Dcheck.IsChecked == false) { ADtxt.Text = "Arrival"; } else if (AcheckcheckBox.IsChecked == true & Dcheck.IsChecked == true) { notifier.ShowError("فقط یک وضعیت قابل انتخاب است"); } else { notifier.ShowError("ورود یا خروج را تعیین کنید"); } if (call_sign.Text == "" || ship_name.Text == "" || voyage_num.Text == "" || portAD.Text == "" || flag.Text == "" || imo_num.Text == "" || lastport.Text == "" || dateAD.Text == "" || ADtxt.Text == "") { notifier.ShowError("تمامی فیلدها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_crwInf newcrewinf = new tbl_crwInf() { crw_arr_depar = ADtxt.Text, call_signcrw = call_sign.Text, name_shipcrw = ship_name.Text, voyage_crw = voyage_num.Text, port_arr_dep = portAD.Text, flag_crw = flag.Text, imo_crw = imo_num.Text, lastReportCall_crw = lastport.Text, date_arr_depar = dateAD.Text, }; db.tbl_crwInf.Add(newcrewinf); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); } }
private void Add_Click(object sender, RoutedEventArgs e) { if (name_text.Text == "" || rank_text.Text == "" || nationality_text.Text == "" || cdcNUM_text.Text == "" || CDCExpiry_text.Text == "" || passportNum_text.Text == "" || passport_expiry_tetxt.Text == "" || datebirth_text.Text == "" || placebirth_text.Text == "") { notifier.ShowError("لطفا تمامی فیلدها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_crw tcrew = new tbl_crw() { name = name_text.Text, ranking = rank_text.Text, nationality = nationality_text.Text, cdc_num = cdcNUM_text.Text, cdc_exp = cdcNUM_text.Text, passport_num = passportNum_text.Text, passport_exp = passport_expiry_tetxt.Text, date_birth = datebirth_text.Text, birthplace = placebirth_text.Text }; db.tbl_crw.Add(tcrew); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); name_text.Text = String.Empty; rank_text.Text = String.Empty; nationality_text.Text = String.Empty; cdcNUM_text.Text = String.Empty; CDCExpiry_text.Text = String.Empty; passportNum_text.Text = String.Empty; passport_expiry_tetxt.Text = String.Empty; datebirth_text.Text = String.Empty; placebirth_text.Text = String.Empty; } //update function later on .... //else if {} }
private void Submit_Click(object sender, RoutedEventArgs e) { if (gross_text.Text == "" || description_text.Text == "" || container_mark_text.Text == "") { notifier.ShowError("لطفا تمامی فیلدها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_deliverygrid tDeliver = new tbl_deliverygrid() { container_marks = container_mark_text.Text, des_goods = description_text.Text, gross = gross_text.Text, }; db.tbl_deliverygrid.Add(tDeliver); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); gross_text.Text = String.Empty; description_text.Text = String.Empty; container_mark_text.Text = String.Empty; } }
private void Sub_info_Click(object sender, RoutedEventArgs e) { if (master_text.Text == "" || FromPort_text.Text == "" || PortOf_text.Text == "" || Date_text.Text == "" || voyageNo_text.Text == "" || GeneralManifest_text.Text == "") { notifier.ShowError("تمامی فیلد ها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_ManifestInfo Nmanifest = new tbl_ManifestInfo() { maniMaster = master_text.Text, fromPortMani = FromPort_text.Text, portofMani = PortOf_text.Text, DateMani = Date_text.Text, voyage_mani = voyageNo_text.Text, general_mani = GeneralManifest_text.Text }; db.tbl_ManifestInfo.Add(Nmanifest); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); } }
private void Submit_Click(object sender, RoutedEventArgs e) { if (quantity_text.Text == "" || description_text.Text == "" || unitprice_text.Text == "" || amount_text.Text == "") { notifier.ShowError("لطفا تمامی فیلدها را پر کنید"); } else { Database1Entities db = new Database1Entities(); tbl_invoice tinvoice = new tbl_invoice() { quantity = int.Parse(quantity_text.Text), description = description_text.Text, unitprice = unitprice_text.Text, amount = int.Parse(amount_text.Text) }; db.tbl_invoice.Add(tinvoice); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); quantity_text.Text = String.Empty; amount_text.Text = String.Empty; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { Database1Entities db = new Database1Entities(); cargo_datagrid.ItemsSource = db.tbl_cargo.ToList(); }
private void Window_Activated(object sender, EventArgs e) { Database1Entities db = new Database1Entities(); invoice_datagrid.ItemsSource = db.tbl_deliverygrid.ToList(); }
private void Window_Activated(object sender, EventArgs e) { Database1Entities db = new Database1Entities(); manifest_datagrid.ItemsSource = db.tbl_manifest.ToList(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (Acheck.IsChecked == false & Dcheck.IsChecked == true) { ADtxt.Text = "Departure"; } else if (Acheck.IsChecked == true & Dcheck.IsChecked == false) { ADtxt.Text = "Arrival"; } else if (Acheck.IsChecked == true & Dcheck.IsChecked == true) { notifier.ShowError("لطفا یک گزینه را انتخاب کنید"); } else if (Acheck.IsChecked == false & Dcheck.IsChecked == false) { notifier.ShowError("وضعیت ورود یا خروج را مشخص کنید"); } else { } Database1Entities db = new Database1Entities(); tbl_ImoGen tGen = new tbl_ImoGen() { nameship = nameship_text.Text, ArrDepa = ADtxt.Text, flag = flag_text.Text, voyage_num = voyage_num_txt.Text, imo_num = imo_text.Text, callsign = call_sign_text.Text, master_name = master_text.Text, agent_ship = agent_text.Text, portA = porta_text.Text, portdes = portd_text.Text, dateAD = dateAD_text.Text, brifeVoy = brife_text.Text, arrivedDes = portDeparture_text.Text, position_ship = shipposition_text.Text, passenger_number = passenger_num_tetxt.Text, crew_number = numCrew_text.Text, gross_ton = gross_text.Text, net_ton = nettonnage_text.Text, brife_cargo = brifeCargo_text.Text, registry = registry_text.Text, remarks = remark_tetxt.Text, attached_doc = attachedDocpage_text.Text, ship_dec = storedeclaration_text.Text, passenger_list = passengerlistpage_text.Text, cargo_dec = cargoDEclaration_text.Text, crew_list = crewlist_text.Text, crew_effect = effect_tetxt.Text, maritime_dec = maritime_tetxt.Text, ships_req = requirement_tetxt.Text }; db.tbl_ImoGen.Add(tGen); db.SaveChanges(); notifier.ShowSuccess("اطلاعات با موفقیت ثبت گردید"); }