public override global::System.Data.DataSet Clone() { ItineraryPlanDataSet cln = ((ItineraryPlanDataSet)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { ItineraryPlanDataSet ds = new ItineraryPlanDataSet(); 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); }
}//Remove duplicate rows public ItineraryPlanDataSet GetItinaryPlanActual(int fieldOffId, int wipID) { ItineraryPlanDataSet visitDS = new ItineraryPlanDataSet(); try { if (fieldOffId == 37) { RemoveDuplicats(); } //RemoveDuplicats();//If comment duplicate will remain if (conn.State.ToString() == "Closed") { conn.Open(); } using (SqlCommand cmd = new SqlCommand(@"select substring(WIPM.ITINERARY_MST_DATE,4,3) + substring(WIPM.ITINERARY_MST_DATE,1,3)+substring(WIPM.ITINERARY_MST_DATE,7,4) as [Date], convert(VARCHAR, CAST(WIPM.ITINERARY_MST_DATE AS DATETIME),106) as ITINERARY_DATE,Fl.FAR_LOC_MST_NAME,FHM.FAR_HDR_MST_CODE, FHM.FAR_HDR_MST_NAME , BCH.BAT_CRT_CODE,BCH.BAT_CRT_NO_CHICKS , dbo.GET_FRM_PRE_BROO_STATUS(WIPM.ITINERARY_PB_STSTUS) AS P_B_Status from GPS_CUS_PARK_TBL_TMP as GCPT inner join WEEKLY_ITINERARY_PLAN_MASTER as WIPM on GCPT.IV2NAME= WIPM.FAR_HDR_MST_FAR_NO_FK inner join ITINERARY_PLAN_SERIES_TBL AS IPST ON WIPM.ITINERARY_ID_FK = IPST.ITINERARY_ID inner join FARMER_MASTER_FARM_DETAILS AS FMFD on WIPM.FAR_HDR_MST_FAR_NO_FK= FMFD.FAR_MST_FAM_DET_CODE Inner join FARMER_HEADER_MASTER AS FHM ON FMFD.FAR_MST_FAM_DET_CODE = FHM.FAR_HDR_MST_FAR_NO inner join FIELD_OFFICER_MASTER FOM ON FMFD.FAR_MST_FAM_DET_FIELD_OFFICER = FOM.FLD_OFF_MST_CODE inner join FARMER_LOCATION as FL on FMFD.FAR_MST_FAM_DET_LOCATION_CODE=FL.FAR_LOC_MST_CODE inner join BATCH_CREATE_HEADER as BCH on WIPM.BAT_CRT_NO_FK = BCH.BAT_CRT_NO where FOM.FLD_OFF_MST_CODE=" + fieldOffId + " and GCPT.USERID=" + lastuser + " and IPST.ITINERARY_ID =" + wipID + " order by FHM.FAR_HDR_MST_CODE")) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = conn; sda.SelectCommand = cmd; sda.Fill(visitDS, "ItinaryPlanDT"); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "GetItinaryPlanActual()", MessageBoxButtons.OK, MessageBoxIcon.Hand); } finally { conn.Close(); } return(visitDS); }
public void LoadReportItinerary() { ItineraryPlanReport crystalReport = new ItineraryPlanReport(); try { DataTable dt = itinerary.GetDataToReport(_wipID, _officerID); DataRow dr = dt.Rows[0]; string wipFromD, wipToD, wipOfficer, wipCode; wipFromD = dr["fromDat"].ToString(); wipToD = dr["toDat"].ToString(); wipOfficer = dr["fieldOff"].ToString(); wipCode = dr["wipCode"].ToString(); ItineraryPlanDataSet VisitDataSet = new ItineraryPlanDataSet(); if (_itinaryType == "itinary") { VisitDataSet = itinerary.GetItinaryPlanActual(_officerID, _wipID); } else if (_itinaryType == "missItinary") { VisitDataSet = itinerary.GetItinaryPlanNotVisits(_officerID, _wipID); } crystalReport.SetDataSource(VisitDataSet); this.CRViewerGeo.ReportSource = crystalReport; TextObject yr = (TextObject)crystalReport.ReportDefinition.Sections["Section5"].ReportObjects["TxtObjLogUser"]; yr.Text = "[ Copyright \u00A9 " + DateTime.Now.Year.ToString() + " Delmo IT " + " PD : " + DateTime.Now.ToString("dd/MM/yyyy") + " PT : " + DateTime.Now.ToString("hh:mm:ss tt") + " Com : " + System.Environment.MachineName.ToString() + " UN : " + Settings.Default.LastUser + " ]"; DataTable table = db.FillReportHeader(); DataRow row = table.Rows[0]; TextObject heder = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCRName"]; heder.Text = row[0].ToString(); TextObject heder2 = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCrAddr"]; heder2.Text = row[1].ToString(); TextObject heder3 = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCRTPNo"]; heder3.Text = "Tel : " + row[2].ToString() + " / Fax : " + row[3].ToString(); TextObject heder4 = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtCREmailWeb"]; heder4.Text = "E-Mail : " + row[4].ToString() + " / Web Address : " + row[5].ToString(); TextObject heder5 = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["TxtHoLine"]; heder5.Text = "Hot Line : 0774410500 / " + row[2].ToString(); TextObject fromD = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["CrFromDatTxt"]; fromD.Text = wipFromD; TextObject toDay = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["CrToDatTxt"]; toDay.Text = wipToD; TextObject getWIP = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["WIPNoTxt"]; getWIP.Text = wipCode; TextObject headerTxt = (TextObject)crystalReport.ReportDefinition.Sections["Section1"].ReportObjects["VisitHeader"]; if (_itinaryType == "itinary") { headerTxt.Text = wipOfficer + " Itinerary Actual Visits"; } else if (_itinaryType == "missItinary") { headerTxt.Text = wipOfficer + " Itinerary Missed Visits"; } } 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(); ItineraryPlanDataSet ds = new ItineraryPlanDataSet(); 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 = "ItinaryPlanDTDataTable"; 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); }