private void InsertHistory(int type) { if (type == 1) { Schedule sch = new Schedule(); sch.Show = txt_showsearch.Text.Trim().ToString();; sch.SettlementDate = txtcreatedatesearch.Text.Trim().ToString();; sch.Presenter = txt_presentersearch.Text.Trim().ToString();; sch.Status = txt_status.Text.Trim().ToString();; sch.Venue = txt_venuesearch.Text.Trim().ToString();; sch.City = txt_metrosearch.Text.Trim().ToString();; objmst.SearchHistoryUpdate(userid, sch,null,null,null,null, type); } else if (type == 2) { PriceScaleDetail psc = new PriceScaleDetail(); psc.Seats = txtbxSeatFrom.Text.Trim().ToString();; psc.Single = txtbxSinglefrom.Text.Trim().ToString();; psc.Group = txttbxgroupfrom.Text.Trim().ToString();; psc.Subscription = txtbxsubscriptionfrom.Text.Trim().ToString();; objmst.SearchHistoryUpdate(userid, null, psc,null,null,null, type); } else if (type == 3) { BoxOfficeDetail bd = new BoxOfficeDetail(); bd.GroupSales=txtbxgrpSalesfrm.Text.Trim().ToString(); bd.DropCount = txtbxdrpcountfrom.Text.Trim().ToString(); bd.PaidAttendance = txtbxPAfrom.Text.Trim().ToString(); bd.Comp = txtbxCompFrom.Text.Trim().ToString(); bd.TSSubscription = txtbxtsSubFrom.Text.Trim().ToString(); bd.GRSubscription = txtbxgrSubFrom.Text.Trim().ToString(); bd.TSPhone = txtbxtsPhoFrom.Text.Trim().ToString(); bd.GRPhone=txtbxgrPhoFrom.Text.Trim().ToString(); bd.TSInternet=txtbxtsIntFrom.Text.Trim().ToString(); bd.GRInternet=txtbxgrIntFrom.Text.Trim().ToString(); bd.TSCreditCard=txtbxtsCreFrom.Text.Trim().ToString(); bd.GRCreditCard=txtbxgrCreFrom.Text.Trim().ToString(); bd.TSRemoteOutlet=txtbxtsRemFrom.Text.Trim().ToString(); bd.GRRemoteOutlet=txtbxgrRemFrom.Text.Trim().ToString(); bd.TSSingleTickets=txtbxtsSinFrom.Text.Trim().ToString(); bd.GRSingleTickets=txtbxgrSinFrom.Text.Trim().ToString(); bd.GRGroup1=txtbxgrGrp1From.Text.Trim().ToString(); bd.GRGroup2=txtbxgrGrp2From.Text.Trim().ToString(); bd.TSGroup1 = txtbxtsGrp1From.Text.Trim().ToString(); bd.TSGroup2 = txtbxtsGrp2From.Text.Trim().ToString(); objmst.SearchHistoryUpdate(userid, null, null, bd, null,null, type); } else if (type == 4) { DealDetail dd = new DealDetail(); dd.Royalty = txt_royalty.Text.Trim().ToString(); dd.Company =txt_companymonies.Text.Trim().ToString(); dd.Tax1 =txt_tax.Text.Trim().ToString(); dd.TaxFacilityFee =txt_facilityfee.Text.Trim().ToString(); dd.Guarantee =txt_guarantee.Text.Trim().ToString(); dd.Presenter =txt_presentermonies.Text.Trim().ToString(); dd.TaxFacilityFee =txt_boxoffice.Text.Trim().ToString(); dd.Cap =txt_middlecap.Text.Trim().ToString(); dd.TaxAmountOver =txt_taxover.Text.Trim().ToString(); dd.Producer =txt_producershare.Text.Trim().ToString(); dd.Budget =txt_taxbudget.Text.Trim().ToString(); dd.Subscription =txt_subscriptionsale.Text.Trim().ToString(); dd.SingleTickets =txt_singleticket.Text.Trim().ToString(); dd.Other1 =txt_miscellaneous1.Text.Trim().ToString(); dd.Actual =txt_taxactual.Text.Trim().ToString(); dd.Phone =txt_phonecommission.Text.Trim().ToString(); dd.Group1 =txt_groupsale1.Text.Trim().ToString(); dd.Presenter =txt_presentershare2.Text.Trim().ToString(); dd.Internet =txt_internetsale.Text.Trim().ToString(); dd.Group2 =txt_groupsale3.Text.Trim().ToString(); dd.Other2 =txt_miscellaneous5.Text.Trim().ToString(); dd.CreditCard =txt_cardsale.Text.Trim().ToString(); dd.StarRoyalty =txt_starroyalty1.Text.Trim().ToString(); dd.Remote = txt_remotesale1.Text.Trim().ToString(); objmst.SearchHistoryUpdate(userid,null,null,null,dd,null,type); } else if (type == 5) { ExpenseDetails ed = new ExpenseDetails(); ed.BUDAdvertisingGross =txtadvt_bud.Text.Trim().ToString(); ed.ACTAdvertisingGross=txtadvt_act.Text.Trim().ToString(); ed.BUDADAExpense=txtadaexp_bud.Text.Trim().ToString(); ed.ACTADAExpense=txtadaexp_act.Text.Trim().ToString(); ed.BUDLaborCatering=txtlabourcatering_bud.Text.Trim().ToString(); ed.ACTLaborCatering=txtlabourcatering_act.Text.Trim().ToString(); ed.BUDBoxOffice=txtboxoff_bud.Text.Trim().ToString(); ed.ACTBoxOffice=txtboxoff_act.Text.Trim().ToString(); ed.BUDMusicians=txtmusicians_bud.Text.Trim().ToString(); ed.ACTMusicians=txtmusicians_act.Text.Trim().ToString(); ed.BUDCatering=txtcatering_bud.Text.Trim().ToString(); ed.ACTCatering=txtcatering_act.Text.Trim().ToString(); ed.BUDEquipmentRental=txteqiprental_bud.Text.Trim().ToString(); ed.ACTEquipmentRental=txteqiprental_act.Text.Trim().ToString(); ed.BUDGroupSalesExpenses=txtgrpsaleexp_bud.Text.Trim().ToString(); ed.ACTGroupSalesExpenses=txtgrpsaleexp_act.Text.Trim().ToString(); ed.BUDshLoadIn=txtstatehandin_bud.Text.Trim().ToString(); ed.ACTshLoadIn=txtstatehandin_act.Text.Trim().ToString(); ed.BUDHouseStaff=txthousestaff_bud.Text.Trim().ToString(); ed.ACTHouseStaff=txthousestaff_act.Text.Trim().ToString(); ed.BUDshLoadOut=txtstatehandout_bud.Text.Trim().ToString(); ed.ACTshLoadOut=txtstatehandout_act.Text.Trim().ToString(); ed.BUDLeagueFees=txtleaguefee_bud.Text.Trim().ToString(); ed.ACTLeagueFees=txtleaguefee_act.Text.Trim().ToString(); ed.BUDshRunning=txtstatehandsrun_bud.Text.Trim().ToString(); ed.ACTshRunning=txtstatehandsrun_act.Text.Trim().ToString(); ed.BUDLicensesPermits=txtlicpermits_bud.Text.Trim().ToString(); ed.ACTLicensesPermits=txtlicpermits_act.Text.Trim().ToString(); ed.BUDLimosAuto=txtlimosauto_bud.Text.Trim().ToString(); ed.ACTLimosAuto=txtlimosauto_act.Text.Trim().ToString(); ed.BUDOrchestraShellRemoval=txtorchestrashellrml_bud.Text.Trim().ToString(); ed.ACTOrchestraShellRemoval=txtorchestrashellrml_act.Text.Trim().ToString(); ed.BUDwrLoadIn=txtwardrobehairin_bud.Text.Trim().ToString(); ed.ACTwrLoadOut=txtwardrobehairin_act.Text.Trim().ToString(); ed.BUDPresenterProfit=txtpresenterprofit_bud.Text.Trim().ToString(); ed.ACTPresenterProfit=txtpresenterprofit_act.Text.Trim().ToString(); ed.BUDwrLoadOut=txtwardrobehairout_bud.Text.Trim().ToString(); ed.ACTwrLoadOut=txtwardrobehairout_act.Text.Trim().ToString(); ed.BUDPoliceSecurityFireMarshall=txtpol_sec_fire_mar_bud.Text.Trim().ToString(); ed.ACTPoliceSecurityFireMarshall=txtpol_sec_fire_mar_act.Text.Trim().ToString(); ed.BUDwrRunning=txtwardrobehairrun_bud.Text.Trim().ToString(); ed.ACTwrRunning=txtwardrobehairrun_act.Text.Trim().ToString(); ed.BUDProgram=txtprogram_bud.Text.Trim().ToString(); ed.ACTProgram=txtprogram_act.Text.Trim().ToString(); ed.BUDRent=txtrent_bud.Text.Trim().ToString(); ed.ACTRent=txtrent_act.Text.Trim().ToString(); //=txtinsurnace_de_unit.Text.Trim().ToString(); //=txtinsurance_bud.Text.Trim().ToString(); //=txtinsurance_act.Text.Trim().ToString(); ed.BUDSoundLights=txtsoundlignt_bud.Text.Trim().ToString(); ed.ACTSoundLights=txtsoundlignt_act.Text.Trim().ToString(); // =txtticketprint_de_unit.Text.Trim().ToString(); // =txtticketprint_de_bud.Text.Trim().ToString(); // =txtticketprint_de_act.Text.Trim().ToString(); //=txtticketprint_le_bud.Text.Trim().ToString(); //=txtticketprint_le_act.Text.Trim().ToString(); ed.BUDTelephonesInternet=txttel_internet_bud.Text.Trim().ToString(); ed.ACTTelephonesInternet=txttel_internet_act.Text.Trim().ToString(); ed.BUDDryIceC02=txtdryice_bud.Text.Trim().ToString(); ed.ACTDryIceC02=txtdryice_act.Text.Trim().ToString(); //=txtother1_de_bud.Text.Trim().ToString(); //=txtother1_de_act.Text.Trim().ToString(); //=txtother2_de_bud.Text.Trim().ToString(); //=txtother2_de_act.Text.Trim().ToString(); //=txtother1_le_bud.Text.Trim().ToString(); //=txtother1_le_act.Text.Trim().ToString(); //=txtother2_le_bud.Text.Trim().ToString(); //=txtother2_le_act.Text.Trim().ToString(); //=txtother3_le_bud.Text.Trim().ToString(); //=txtother3_le_act.Text.Trim().ToString(); //=txtother4_le_bud.Text.Trim().ToString(); //=txtother4_le_act.Text.Trim().ToString(); //=txtother5_le_bud.Text.Trim().ToString(); //=txtother5_le_act.Text.Trim().ToString(); ed.BUDLocalFixed=txtlocalfixed_bud.Text.Trim().ToString(); ed.ACTLocalFixed=txtlocalfixed_act.Text.Trim().ToString(); } else if (type == 6) { Discount d = new Discount(); d.Sub = txtbxDSubscription.Text.Trim().ToString(); d.SubTkt = txtxsubTktto.Text.Trim().ToString(); d.Group = txtbxGSubFrom.Text.Trim().ToString(); d.Grptkt = txtbxGtktFrom.Text.Trim().ToString(); d.Misc = txtbxmis.Text.Trim().ToString(); d.MiscTkt = txtbxmisTfrom.Text.Trim().ToString(); objmst.SearchHistoryUpdate(userid, null, null, null, null, d, 5); } }
public void SearchHistoryUpdate(string userid, Schedule sch, PriceScaleDetail psc, BoxOfficeDetail bd, DealDetail dd,Discount d, int type) { SqlCommand cmd = new SqlCommand("spInsertSearchDetails", dbconn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); if (type == 1) { cmd.Parameters.AddWithValue("@Arg1", sch.Show); cmd.Parameters.AddWithValue("@Arg2", sch.Presenter); cmd.Parameters.AddWithValue("@Arg3", sch.Status); cmd.Parameters.AddWithValue("@Arg4", sch.City); cmd.Parameters.AddWithValue("@Arg5", sch.SettlementDate); cmd.Parameters.AddWithValue("@Arg6", sch.Venue); cmd.Parameters.AddWithValue("@Arg7", ""); cmd.Parameters.AddWithValue("@Arg8", ""); cmd.Parameters.AddWithValue("@Arg9", ""); cmd.Parameters.AddWithValue("@Arg10", ""); cmd.Parameters.AddWithValue("@Arg11", ""); cmd.Parameters.AddWithValue("@Arg12", ""); cmd.Parameters.AddWithValue("@Arg13", ""); cmd.Parameters.AddWithValue("@Arg14", ""); cmd.Parameters.AddWithValue("@Arg15", ""); cmd.Parameters.AddWithValue("@Arg16", ""); cmd.Parameters.AddWithValue("@Arg17", ""); cmd.Parameters.AddWithValue("@Arg18", ""); cmd.Parameters.AddWithValue("@Arg19", ""); cmd.Parameters.AddWithValue("@Arg20", ""); cmd.Parameters.AddWithValue("@Arg21", ""); cmd.Parameters.AddWithValue("@Arg22", ""); cmd.Parameters.AddWithValue("@Arg23", ""); cmd.Parameters.AddWithValue("@Arg24", ""); cmd.Parameters.AddWithValue("@Arg25", ""); } else if (type == 2) { cmd.Parameters.AddWithValue("@Arg1", psc.Seats); cmd.Parameters.AddWithValue("@Arg2", psc.Single); cmd.Parameters.AddWithValue("@Arg3", psc.Group); cmd.Parameters.AddWithValue("@Arg4", psc.Subscription); cmd.Parameters.AddWithValue("@Arg5", ""); cmd.Parameters.AddWithValue("@Arg6", ""); cmd.Parameters.AddWithValue("@Arg7", ""); cmd.Parameters.AddWithValue("@Arg8", ""); cmd.Parameters.AddWithValue("@Arg9", ""); cmd.Parameters.AddWithValue("@Arg10", ""); cmd.Parameters.AddWithValue("@Arg11", ""); cmd.Parameters.AddWithValue("@Arg12", ""); cmd.Parameters.AddWithValue("@Arg13", ""); cmd.Parameters.AddWithValue("@Arg14", ""); cmd.Parameters.AddWithValue("@Arg15", ""); cmd.Parameters.AddWithValue("@Arg16", ""); cmd.Parameters.AddWithValue("@Arg17", ""); cmd.Parameters.AddWithValue("@Arg18", ""); cmd.Parameters.AddWithValue("@Arg19", ""); cmd.Parameters.AddWithValue("@Arg20", ""); cmd.Parameters.AddWithValue("@Arg21", ""); cmd.Parameters.AddWithValue("@Arg22", ""); cmd.Parameters.AddWithValue("@Arg23", ""); cmd.Parameters.AddWithValue("@Arg24", ""); cmd.Parameters.AddWithValue("@Arg25", ""); } else if (type == 3) { cmd.Parameters.AddWithValue("@Arg1 ", bd.GroupSales); cmd.Parameters.AddWithValue("@Arg2 ", bd.DropCount); cmd.Parameters.AddWithValue("@Arg3 ", bd.PaidAttendance); cmd.Parameters.AddWithValue("@Arg4 ", bd.Comp); cmd.Parameters.AddWithValue("@Arg5 ", bd.TSSubscription); cmd.Parameters.AddWithValue("@Arg6 ", bd.TSPhone); cmd.Parameters.AddWithValue("@Arg7 ", bd.TSInternet); cmd.Parameters.AddWithValue("@Arg8 ", bd.TSCreditCard); cmd.Parameters.AddWithValue("@Arg9 ", bd.TSRemoteOutlet); cmd.Parameters.AddWithValue("@Arg10 ", bd.TSSingleTickets); cmd.Parameters.AddWithValue("@Arg11 ", bd.TSGroup1); cmd.Parameters.AddWithValue("@Arg12 ", bd.TSGroup2); cmd.Parameters.AddWithValue("@Arg13 ", bd.GRSubscription); cmd.Parameters.AddWithValue("@Arg14 ", bd.GRPhone); cmd.Parameters.AddWithValue("@Arg15 ", bd.GRInternet); cmd.Parameters.AddWithValue("@Arg16 ", bd.GRCreditCard); cmd.Parameters.AddWithValue("@Arg17 ", bd.GRRemoteOutlet); cmd.Parameters.AddWithValue("@Arg18 ", bd.GRSingleTickets); cmd.Parameters.AddWithValue("@Arg19 ", bd.GRGroup1); cmd.Parameters.AddWithValue("@Arg20 ", bd.GRGroup2); } else if (type == 4) { cmd.Parameters.AddWithValue("@Arg1 ", dd.Royalty); cmd.Parameters.AddWithValue("@Arg2 ", dd.Company); cmd.Parameters.AddWithValue("@Arg3 ", dd.Guarantee); cmd.Parameters.AddWithValue("@Arg4 ", dd.Presenter); cmd.Parameters.AddWithValue("@Arg5 ", dd.Cap); cmd.Parameters.AddWithValue("@Arg6 ", dd.Tax1); cmd.Parameters.AddWithValue("@Arg7 ", dd.OnEachTicket); cmd.Parameters.AddWithValue("@Arg8 ", dd.Tax2); cmd.Parameters.AddWithValue("@Arg9 ", dd.TaxFacilityFee); cmd.Parameters.AddWithValue("@Arg10 ", dd.TaxAmountOver); cmd.Parameters.AddWithValue("@Arg11 ", dd.Producer); cmd.Parameters.AddWithValue("@Arg12 ", dd.Other1); //cmd.Parameters.AddWithValue("@Arg13 ", dd.Presenter); cmd.Parameters.AddWithValue("@Arg14 ", dd.Other2); cmd.Parameters.AddWithValue("@Arg15 ", dd.StarRoyalty); cmd.Parameters.AddWithValue("@Arg16 ", dd.Budget); cmd.Parameters.AddWithValue("@Arg17 ", dd.Actual); cmd.Parameters.AddWithValue("@Arg18 ", dd.Subscription); cmd.Parameters.AddWithValue("@Arg19 ", dd.Phone); cmd.Parameters.AddWithValue("@Arg20 ", dd.Internet); cmd.Parameters.AddWithValue("@Arg21 ", dd.CreditCard); cmd.Parameters.AddWithValue("@Arg22 ", dd.Remote); cmd.Parameters.AddWithValue("@Arg23 ", dd.SingleTickets); cmd.Parameters.AddWithValue("@Arg24 ", dd.Group1); cmd.Parameters.AddWithValue("@Arg25 ", dd.Group2); } else if (type == 5) { cmd.Parameters.AddWithValue("@Arg1 ", d.Sub); cmd.Parameters.AddWithValue("@Arg2 ", d.SubTkt); cmd.Parameters.AddWithValue("@Arg3 ", d.Group); cmd.Parameters.AddWithValue("@Arg4 ", d.Grptkt); cmd.Parameters.AddWithValue("@Arg5 ", d.Misc); cmd.Parameters.AddWithValue("@Arg6 ", d.MiscTkt); } cmd.Parameters.AddWithValue("@Type", type); cmd.Parameters.AddWithValue("@UserID", userid); try { if (dbconn.State == ConnectionState.Closed) { dbconn.Open(); } cmd.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } } }
private void LoadScheduleSearch(Schedule sch ) { txt_showsearch.Text = sch.Show; txt_presentersearch.Text = sch.Presenter; txt_metrosearch.Text = sch.City; txt_venuesearch.Text = sch.Venue; txtcreatedatesearch.Text = sch.SettlementDate; txt_status.Text = sch.Status; }
public Schedule GetScheduleSearchHistory(int mode, string userid) { DataTable dt = new DataTable(); Schedule sch = null; SqlCommand cmd = new SqlCommand("spGetSearchHistory", dbconn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Mode", mode); cmd.Parameters.AddWithValue("@UserID", userid); cmd.CommandType = CommandType.StoredProcedure; try { if (dbconn.State == ConnectionState.Closed) { dbconn.Open(); } SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); if (dt != null) { if (dt.Rows.Count > 0) { sch = new Schedule(); sch.Show = Convert.ToString(dt.Rows[0][0]); sch.SettlementDate = Convert.ToString(dt.Rows[0][4]); sch.Presenter = Convert.ToString(dt.Rows[0][1]); sch.City = Convert.ToString(dt.Rows[0][3]); sch.Status = Convert.ToString(dt.Rows[0][2]); sch.Venue = Convert.ToString(dt.Rows[0][5]); return sch; } } return sch; } catch (Exception ex) { throw ex; } finally { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } } }