}//Populate DataSet Feild Officer Visitations3 public CustVisitDS GetCustDropingBuysNew() { CustVisitDS custVisit = new CustVisitDS(); try {//TMP.[DATE] RemoveDuplicats(); if (conn.State.ToString() == "Closed") { conn.Open(); } using (SqlCommand scmd = new SqlCommand(@"SELECT ID as GPS_CUST_ID,[DATE] as dat, substring([DATE],4,3) + substring([DATE],1,3)+substring([DATE],7,4) as Vhi_Park_Date, chart.CHT_ACC_ALIAS,chart.CHT_ACC_NAME,v4 as GPS_CUST_AREA, V5 as Start_Time, V6 as End_Time, INT2 as Vhi_Parking_Duration, (select [dbo].GET_CUS_SALES_INFORMATIONS(TMP.[DATE],tmp.IV2NAME,tmp.ILoc,'QTY')) as QTY, (select [dbo].GET_CUS_SALES_INFORMATIONS(TMP.[DATE],tmp.IV2NAME,tmp.ILoc,'AMT')) as AMT FROM GPS_CUS_PARK_TBL_TMP as tmp inner join CHART_ACC as chart on tmp.ILoc=chart.CHT_ACC_ACC_NO order by [DATE],Start_Time")) { using (SqlDataAdapter sda = new SqlDataAdapter()) { scmd.Connection = conn; sda.SelectCommand = scmd; sda.Fill(custVisit, "CustVisitDT"); } } } catch (Exception ex) { MessageBox.Show("Reports " + ex.Message, "GetCustomerDropingBuys()", MessageBoxButtons.OK, MessageBoxIcon.Hand); } finally { conn.Close(); } return(custVisit); }
public override global::System.Data.DataSet Clone() { CustVisitDS cln = ((CustVisitDS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { CustVisitDS ds = new CustVisitDS(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public void CustomerVisitToReport() {//GetCustDropingBuysNew() CustomerDropingbuysCR cusReport = new CustomerDropingbuysCR(); try { CustVisitDS VisitDataSet = db.GetCustDropingBuysNew();//Get report data from GPSCUStemp cusReport.SetDataSource(VisitDataSet); this.CRViewerGeo.ReportSource = cusReport; TextObject copyRight = (TextObject)cusReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtCopy"]; copyRight.Text = "[ Copyright \u00A9 " + DateTime.Now.Year.ToString() + " Delmo IT " + " PD :"; TextObject date = (TextObject)cusReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtDate"]; date.Text = DateTime.Now.ToString("dd/MM/yyyy");//TxtTime TextObject time = (TextObject)cusReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtTime"]; time.Text = DateTime.Now.ToString("hh:mm:ss tt"); TextObject pc = (TextObject)cusReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtPC"]; pc.Text = System.Environment.MachineName.ToString(); TextObject user = (TextObject)cusReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtUN"]; user.Text = Settings.Default.LastUser + " ]"; } catch { MessageBox.Show("Error loading with the report...", "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { DataTable table = db.FillReportHeader(); DataRow row = table.Rows[0]; TextObject heder = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCRName"]; heder.Text = row[0].ToString(); TextObject heder2 = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCrAddr"]; heder2.Text = row[1].ToString(); TextObject heder3 = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCRTPNo"]; heder3.Text = "Tel : " + row[2].ToString() + " / Fax : " + row[3].ToString(); TextObject heder4 = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCREmailWeb"]; heder4.Text = "E-Mail : " + row[4].ToString() + " / Web Address : " + row[5].ToString(); TextObject heder5 = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtHoLine"]; heder5.Text = "Hot Line : 0774410500 / " + row[2].ToString(); TextObject fromD = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["CrFromDatTxt"]; fromD.Text = _fromDate; TextObject toDay = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["CrToDatTxt"]; toDay.Text = _toDate; TextObject headerTxt = (TextObject)cusReport.ReportDefinition.Sections["Section1"].ReportObjects["VisitHeader"]; headerTxt.Text = _repName + " (" + _trackName + ")"; } catch { MessageBox.Show("Error loading with the report header...", "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.CRViewerGeo.RefreshReport(); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); CustVisitDS ds = new CustVisitDS(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "CustVisitDTDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }