private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { repoerts_form rp_form = new repoerts_form(); ParameterFields pars = new ParameterFields(); mony_store er_rp = new mony_store(); ParameterField start_field_par = new ParameterField(); ParameterDiscreteValue start_dis = new ParameterDiscreteValue(); start_field_par.Name = "start_date"; start_dis.Value = s_m_start_date.Text; start_field_par.CurrentValues.Add(start_dis); pars.Add(start_field_par); ParameterField end_field_par = new ParameterField(); ParameterDiscreteValue end_dis = new ParameterDiscreteValue(); end_field_par.Name = "end_date"; end_dis.Value = s_m_end_date.Text; end_field_par.CurrentValues.Add(end_dis); pars.Add(end_field_par); rp_form.rep_crst.ReportSource = er_rp; rp_form.rep_crst.ParameterFieldInfo = pars; er_rp.Refresh(); rp_form.ShowDialog(); } catch (Exception dd) { MessageBox.Show(dd.Message); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { report_frm.WindowState = FormWindowState.Normal; grd_nawks_rp_ less_rp = new grd_nawks_rp_(); ParameterFields less_params = new ParameterFields(); //////////////////////////////////////////////////////////////////////////////////////////////////////less sanf num ParameterField less_par = new ParameterField(); ParameterDiscreteValue less_dis = new ParameterDiscreteValue(); less_par.Name = "sanf_num_par"; less_dis.Value = rep_sanf_num_bx.Value; less_par.CurrentValues.Add(less_dis); less_params.Add(less_par); ///////////////////////////////////////////////////////////end date////////////// report_frm.rep_crst.ParameterFieldInfo = less_params; report_frm.rep_crst.ReportSource = less_rp; report_frm.rep_crst.Refresh(); report_frm.ShowDialog(); } catch (Exception ff) { MessageBox.Show(ff.Message + " طباعة تقرير عدد اقل"); } }
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { repoerts_form rp_form = new repoerts_form(); ParameterFields pars = new ParameterFields(); item_analysis i_anal_rp = new item_analysis(); ParameterField start_field_par = new ParameterField(); ParameterDiscreteValue start_dis = new ParameterDiscreteValue(); start_field_par.Name = "start_date"; start_dis.Value = anal_start_date.Text; start_field_par.CurrentValues.Add(start_dis); pars.Add(start_field_par); ParameterField it_id_field_par = new ParameterField(); ParameterDiscreteValue it_id_dis = new ParameterDiscreteValue(); it_id_field_par.Name = "item_id"; if (anal_sanf_cod_bx.Text.Trim() != "") { it_id_dis.Value = anal_sanf_cod_bx.Text.Trim(); } else { it_id_dis.Value = 1; } it_id_field_par.CurrentValues.Add(it_id_dis); pars.Add(it_id_field_par); ParameterField end_field_par = new ParameterField(); ParameterDiscreteValue end_dis = new ParameterDiscreteValue(); end_field_par.Name = "end_date"; end_dis.Value = anal_end_date.Text; end_field_par.CurrentValues.Add(end_dis); pars.Add(end_field_par); rp_form.rep_crst.ReportSource = i_anal_rp; rp_form.rep_crst.ParameterFieldInfo = pars; i_anal_rp.Refresh(); rp_form.ShowDialog(); } catch (Exception dd) { MessageBox.Show(dd.Message); } }
private void mor_acc_rep_lnk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { repoerts_form mor_rp_form = new repoerts_form(); pay_ag_period p_mor_rp = new pay_ag_period(); ParameterFields mor_params = new ParameterFields(); //////////mor name///////////// ParameterField mor_name_par = new ParameterField(); ParameterDiscreteValue mor_nam_dis = new ParameterDiscreteValue(); mor_nam_dis.Value = 0; mor_name_par.Name = "mor_id"; if (mor_name_cmbx.Text.Trim() != "") { mor_nam_dis.Value = meth.select_mor_by_name_or_code(mor_name_cmbx.SelectedValue.ToString(), "NULL").Rows[0][0]; } mor_name_par.CurrentValues.Add(mor_nam_dis); mor_params.Add(mor_name_par); /////////////////////////////////////////////////////choice//////// ParameterField choice_par = new ParameterField(); ParameterDiscreteValue choice_dis = new ParameterDiscreteValue(); choice_par.Name = "choice_par"; if (query_choice_cmbx.SelectedIndex == 0) { choice_dis.Value = 1; } else { choice_dis.Value = 0; } choice_par.CurrentValues.Add(choice_dis); mor_params.Add(choice_par); //////////////////////////////////////////////////////////////////////////////////////////////////////start date ParameterField mor_start_dat_par = new ParameterField(); ParameterDiscreteValue mor_start_dat_dis = new ParameterDiscreteValue(); mor_start_dat_par.Name = "start_date"; mor_start_dat_dis.Value = mor_acc_start_date.Text; mor_start_dat_par.CurrentValues.Add(mor_start_dat_dis); mor_params.Add(mor_start_dat_par); ///////////////////////////////////////////////////////////end date////////////// ParameterField mor_end_dat_par = new ParameterField(); ParameterDiscreteValue mor_end_dat_dis = new ParameterDiscreteValue(); mor_end_dat_par.Name = "end_date"; mor_end_dat_dis.Value = mor_acc_end_date.Text; mor_end_dat_par.CurrentValues.Add(mor_end_dat_dis); mor_params.Add(mor_end_dat_par); //////////////////////////////////////////////////////////////////////////////////////// mor_rp_form.rep_crst.ParameterFieldInfo = mor_params; mor_rp_form.rep_crst.ReportSource = p_mor_rp; mor_rp_form.ShowDialog(); } catch (Exception ff) { MessageBox.Show(ff.Message + " طباعة تقرير حسابات مورد"); } }
private void earn_lnklbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { try { partener_cmbx.DisplayMember = "paretener_name"; partener_cmbx.ValueMember = "partener_id"; string datelastday; total_earn ec = new total_earn(); /// datelastday = (Int32.Parse(DateTime.Now.Day.ToString()) - 1).ToString(); //datelastday = datelastday + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString(); if (earn_all_part_rdbtn.Checked) { ec.EarnCalcOper(earn_start_date.Text, earn_end_date.Text, ""); } else { ec.EarnCalcOper(earn_start_date.Text, earn_end_date.Text, partener_cmbx.SelectedValue.ToString()); } } catch (Exception ff) { MessageBox.Show(ff.Message); } repoerts_form rp_form = new repoerts_form(); ParameterFields pars = new ParameterFields(); earn_rp er_rp = new earn_rp(); earn_partener_rp e_part = new earn_partener_rp(); ParameterField start_field_par = new ParameterField(); ParameterDiscreteValue start_dis = new ParameterDiscreteValue(); start_field_par.Name = "start_date"; start_dis.Value = earn_start_date.Text; start_field_par.CurrentValues.Add(start_dis); pars.Add(start_field_par); ParameterField end_field_par = new ParameterField(); ParameterDiscreteValue end_dis = new ParameterDiscreteValue(); end_field_par.Name = "end_date"; end_dis.Value = earn_end_date.Text; end_field_par.CurrentValues.Add(end_dis); pars.Add(end_field_par); if (earn_all_part_rdbtn.Checked) { rp_form.rep_crst.ReportSource = er_rp; rp_form.rep_crst.ParameterFieldInfo = pars; er_rp.Refresh(); rp_form.ShowDialog(); } else { ParameterField part_id_par = new ParameterField(); ParameterDiscreteValue part_id_dis = new ParameterDiscreteValue(); part_id_par.Name = "partener_name"; part_id_dis.Value = partener_cmbx.Text; part_id_par.CurrentValues.Add(part_id_dis); pars.Add(part_id_par); rp_form.rep_crst.ReportSource = e_part; rp_form.rep_crst.ParameterFieldInfo = pars; e_part.Refresh(); rp_form.ShowDialog(); } } catch (Exception ss) { MessageBox.Show(ss.Message); } }
private void gard_stor_rp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { repoerts_form rp_form = new repoerts_form(); rp_form.WindowState = FormWindowState.Normal; grd_rp sanf_rem_rp = new grd_rp(); ParameterFields sanf_rem_params = new ParameterFields(); ParameterField rem_choic_par = new ParameterField(); ParameterField rem_value_par = new ParameterField(); ParameterField sanf_name_par = new ParameterField(); ParameterDiscreteValue rem_choic_dis = new ParameterDiscreteValue(); ParameterDiscreteValue rem_value_dis = new ParameterDiscreteValue(); ParameterDiscreteValue sanf_name_dis = new ParameterDiscreteValue(); rem_choic_dis.Value = 0; rem_value_dis.Value = 0; sanf_name_dis.Value = 0; rem_choic_par.Name = "remain_choic_par"; rem_value_par.Name = "sanf_search_value"; sanf_name_par.Name = "sanf_name_par"; Int64 sanf_code = 0; if (gard_sanf_code_rdbtn.Checked && grd_sanf_cod_bx.Text.Trim() != "")//كود الصنف { rem_choic_dis.Value = 0; sanf_code = Int64.Parse(grd_sanf_cod_bx.Text.Trim()); if (meth.select_sanf_data_by_barcode_orcode(sanf_code.ToString()).Rows.Count > 0) { rem_value_dis.Value = meth.select_sanf_data_by_barcode_orcode(sanf_code.ToString()).Rows[0][0].ToString(); } else { MessageBox.Show("لايوجد صنف بهذا الكود"); } grd_sanf_cod_bx.Clear(); } if (gard_sanf_name_rdbtn.Checked)//اسم الصنف { if (grd_sanf_nam_bx.Text.Trim() != "") { rem_choic_dis.Value = 1; sanf_name_dis.Value = grd_sanf_nam_bx.Text.Trim(); } else { MessageBox.Show("من فضلك ادخل اسم الصنف"); } } if (gard_tasn_rdbtn.Checked)//كود القسم { if (grd_tasn_bx.Text.Trim() != "") { rem_choic_dis.Value = 2; rem_value_dis.Value = meth.select_tasn_data_bynam_orcode("NULL", grd_tasn_bx.Text.Trim()).Rows[0][0].ToString(); } else { MessageBox.Show("من فضلك ادخل التصنيف"); } } if (gard_all_rdbtn.Checked)//الكل { rem_choic_dis.Value = 3; rem_value_dis.Value = 0; } if (company_chbtn.Checked)//الشركه { rem_choic_dis.Value = 4; rem_value_dis.Value = company_cmbx.SelectedValue.ToString() ; } rem_choic_par.CurrentValues.Add(rem_choic_dis); rem_value_par.CurrentValues.Add(rem_value_dis); sanf_name_par.CurrentValues.Add(sanf_name_dis); sanf_rem_params.Add(rem_choic_par); sanf_rem_params.Add(rem_value_par); sanf_rem_params.Add(sanf_name_par); rp_form.rep_crst.ParameterFieldInfo = sanf_rem_params; rp_form.rep_crst.ReportSource = sanf_rem_rp; sanf_rem_rp.Refresh(); rp_form.ShowDialog(); } catch (Exception ff) { MessageBox.Show(ff.Message); } }
private void show_bef_prnt_btn_Click(object sender, EventArgs e) { try { SqlCommand delete_cmd = connect_sal.CreateCommand(); delete_cmd.CommandText = "delete from barcode_table"; connect_sal.Open(); delete_cmd.ExecuteNonQuery(); connect_sal.Close(); SqlCommand insert_bar_cmd = connect_sal.CreateCommand(); if (bar_grid.Rows.Count > 0) { string bar = ""; for (int i = 0; i < bar_grid.Rows.Count; i++) { for (int count = 0; count < Convert.ToInt32(bar_grid.Rows[i].Cells[2].Value.ToString()); count++) { bar = "*" + bar_grid.Rows[i].Cells[0].Value.ToString() + "*"; insert_bar_cmd.CommandText = "insert into barcode_table(sanf_code_b, sanf_code, price, sanf_name, qat_pric" + ")values('" + bar + "','" + bar_grid.Rows[i].Cells[0].Value.ToString() + "','" + meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][3].ToString() + "','" + meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][1].ToString() + "','" + meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][4].ToString() + "')"; connect_sal.Open(); insert_bar_cmd.ExecuteNonQuery(); connect_sal.Close(); } } if (a4_compl_rdbnt.Checked) { repoerts_form report_frm = new repoerts_form(); bar_rp br = new bar_rp(); report_frm.rep_crst.ReportSource = br; br.Refresh(); report_frm.rep_crst.ExportReport(); report_frm.ShowDialog(); } else if (a4_splited_rdbtn.Checked) { repoerts_form report_frm = new repoerts_form(); barcode br2 = new barcode(); report_frm.rep_crst.ReportSource = br2; //CrystalDecisions.Shared.ExportOptions op = new ExportOptions(); // op.ExportFormatOptions = CrystalDecisions.Shared.ExportOptions.CreateHTMLFormatOptions(); // op.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.HTML40; br2.Refresh(); // br2.Export(op); //.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.HTML40, "1"); report_frm.ShowDialog(); } } } catch (Exception dd) { MessageBox.Show(dd.Message); connect_sal.Close(); } }
private void sels_of_part_lnklbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { repoerts_form rp_form = new repoerts_form(); ParameterFields pars = new ParameterFields(); sels_partener_rep sel_par_rp = new sels_partener_rep(); ParameterField part_id_par = new ParameterField(); ParameterDiscreteValue part_id_dis = new ParameterDiscreteValue(); part_id_par.Name = "parte_id"; if (parte_cmbx.Text != "") { part_id_dis.Value = parte_cmbx.SelectedValue.ToString(); } else { part_id_dis.Value = 0; } part_id_par.CurrentValues.Add(part_id_dis); pars.Add(part_id_par); ParameterField tas_id_par = new ParameterField(); ParameterDiscreteValue tas_id_dis = new ParameterDiscreteValue(); tas_id_par.Name = "tasneef_id"; if (tasneef_cmbx.SelectedIndex >= 0) { tas_id_dis.Value = tasneef_cmbx.SelectedValue.ToString(); } else { tas_id_dis.Value = 0; } tas_id_par.CurrentValues.Add(tas_id_dis); pars.Add(tas_id_par); ParameterField type_s_par = new ParameterField(); ParameterDiscreteValue type_s_dis = new ParameterDiscreteValue(); type_s_par.Name = "type_of_serach"; if (sels_part_about_cmbx.SelectedIndex == 0) { type_s_dis.Value = 0; } else if (sels_part_about_cmbx.SelectedIndex == 1) { type_s_dis.Value = 1; } else { type_s_dis.Value = 2; } type_s_par.CurrentValues.Add(type_s_dis); pars.Add(type_s_par); ParameterField start_field_par = new ParameterField(); ParameterDiscreteValue start_dis = new ParameterDiscreteValue(); start_field_par.Name = "start_date"; start_dis.Value = sels_parte_start_date.Text; start_field_par.CurrentValues.Add(start_dis); pars.Add(start_field_par); ParameterField end_field_par = new ParameterField(); ParameterDiscreteValue end_dis = new ParameterDiscreteValue(); end_field_par.Name = "end_date"; end_dis.Value = sels_part_end_date.Text; end_field_par.CurrentValues.Add(end_dis); pars.Add(end_field_par); ParameterField comp_field_par = new ParameterField(); ParameterDiscreteValue comp_dis = new ParameterDiscreteValue(); comp_field_par.Name = "compant_par"; if (company_cmbx.Text.Trim() != "") { comp_dis.Value = company_cmbx.SelectedValue.ToString(); } else { comp_dis.Value = "0"; } comp_field_par.CurrentValues.Add(comp_dis); pars.Add(comp_field_par); rp_form.rep_crst.ReportSource = sel_par_rp; rp_form.rep_crst.ParameterFieldInfo = pars; sel_par_rp.Refresh(); rp_form.ShowDialog(); } catch (Exception dd) { MessageBox.Show(dd.Message); } }