コード例 #1
0
        public override global::System.Data.DataSet Clone()
        {
            CartonDataSet2 cln = ((CartonDataSet2)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
コード例 #2
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            CartonDataSet2 ds = new CartonDataSet2();

            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);
        }
コード例 #3
0
ファイル: Form2.cs プロジェクト: pulmuone/FCL
        private void Form2_Load(object sender, EventArgs e)
        {
            _myReport = new CrystalReport2();
            //_myReport.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;

            if (string.IsNullOrEmpty(Settings.Default.PaperOrientation))
            {
                comboBox1.SelectedIndex = 0;
            }
            else if (Settings.Default.PaperOrientation.ToString() == "DefaultPaperOrientation")
            {
                comboBox1.SelectedIndex = 0;
            }
            else if (Settings.Default.PaperOrientation.ToString() == "Portrait")
            {
                comboBox1.SelectedIndex = 1;
            }
            else if (Settings.Default.PaperOrientation.ToString() == "Landscape")
            {
                comboBox1.SelectedIndex = 2;
            }

            //더미로 해 놓아야 Manual로 입력한 것을 Export할 수 있다.
            CartonDataSet2 ds = new CartonDataSet2();

            ds.Tables[0].Columns.Remove("Price2");
            ds.Tables[0].Columns.Remove("ProdCodeBarCode");
            //ds.Tables[0].Columns.Remove("MCIDImage");
            this.dataGridView1.DataSource = ds.Tables[0];

            //Printer 기본설정
            if (string.IsNullOrEmpty(Settings.Default.PrinterName))               //프로그램에서의 기본 프린터
            {
                Settings.Default.PrinterName = new PrinterSettings().PrinterName; //작업 컴퓨터의 Default 프린터로 출력하게 한다.
            }

            PrinterSingleton.Instance.PrinterName = Settings.Default.PrinterName;
            PrinterName(PrinterSingleton.Instance.PrinterName);

            //this.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            Version myVersion;

            myVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion;
            this.Text = myVersion.Major.ToString() + "." + myVersion.Minor + "." + myVersion.Build + "," + myVersion.Revision;
        }
コード例 #4
0
ファイル: Form3.cs プロジェクト: pulmuone/FCL
        private void btnPreview_Click(object sender, EventArgs e)
        {
            CartonDataSet2 cartonDataSet = new CartonDataSet2();
            DataTable      dt            = new DataTable();
            DataRow        dr;
            string         mcid = string.Empty;

            printerSettings.PrinterName = PrinterSingleton.Instance.PrinterName;

            System.Drawing.Printing.PageSettings pageSettings = new System.Drawing.Printing.PageSettings(printerSettings);
            //pageSettings.Landscape = true; //작동 안함...차이 없음.....

            PrintLayout.FitHorizontalPages = true;
            PrintLayout.Scaling            = PrintLayoutSettings.PrintScaling.DoNotScale;
            PrintLayout.Centered           = true;

            foreach (DataGridViewRow Rows in this.dataGridView1.Rows)
            {
                if (Rows.Cells["Print"].Value != null)
                {
                    if (Rows.Cells["Print"].Value.ToString() == "True")
                    {
                        if (Rows.Cells["ProdCode"].Value != null)
                        {
                            dr             = cartonDataSet.Tables[0].NewRow();
                            dr["ProdName"] = string.IsNullOrEmpty(Rows.Cells["ProdName"].Value.ToString()) ? string.Empty : Rows.Cells["ProdName"].Value.ToString().Trim();
                            dr["Price"]    = string.IsNullOrEmpty(Rows.Cells["Price"].Value.ToString()) ? string.Empty : Rows.Cells["Price"].Value.ToString().Trim();
                            dr["Price2"]   = string.IsNullOrEmpty(Rows.Cells["Price2"].Value.ToString()) ? string.Empty : Rows.Cells["Price2"].Value.ToString().Trim();
                            dr["ProdCode"] = string.IsNullOrEmpty(Rows.Cells["ProdCode"].Value.ToString()) ? string.Empty : Rows.Cells["ProdCode"].Value.ToString().Trim();
                            mcid           = string.IsNullOrEmpty(Rows.Cells["ProdCode"].Value.ToString()) ? string.Empty : Rows.Cells["ProdCode"].Value.ToString().Trim();

                            if (string.IsNullOrEmpty(mcid))
                            {
                                dr["ProdCodeBarCode"] = null;
                            }
                            else
                            {
                                //BarcodeLibSingleton.Instance.Barcode.Encode(BarcodeLib.TYPE.CODE128, mcid, 300, 100);
                                //dr["ProdCodeBarCode"] = string.IsNullOrEmpty(mcid) ? null : BarcodeLibSingleton.Instance.Barcode.Encoded_Image_Bytes;
                                dr["ProdCodeBarCode"] = string.IsNullOrEmpty(mcid) ? null : Encoded_Image_Bytes(mcid);
                            }

                            cartonDataSet.Tables[0].Rows.Add(dr);
                        }
                    }
                }
            }

            PrintOptions printOptions = this._myReport.PrintOptions;

            printOptions.DissociatePageSizeAndPrinterPaperSize = false;

            switch (comboBox1.SelectedIndex)
            {
            case 0:
                printOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation;
                break;

            case 1:
                printOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait;
                break;

            case 2:
                printOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
                break;
            }

            //printOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;

            _myReport.SetDataSource(cartonDataSet);

            crystalReportViewer1.ReportSource = _myReport;
        }
コード例 #5
0
            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();
                CartonDataSet2 ds = new CartonDataSet2();

                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 = "CartonDataSet2DataTable";
                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);
            }