public formPreviews(DetailData data)
        {
            InitializeComponent();
            datas = data;

            init(0);
            this.ppcPrint.MouseWheel
                += new System.Windows.Forms.MouseEventHandler(this.ppc_MouseWheel);
        }
Beispiel #2
0
        private static void createFile(StreamWriter sw, DetailData data)
        {
            sw.WriteLine(","+data.Title + ",,,," + data.Today);
            sw.WriteLine(",,,,,");
            sw.WriteLine(data.YourCompanyName + ",,,,,");
            sw.WriteLine(data.DeliveryDate + ",,,,,");
            sw.WriteLine(data.ConstractionName + ",,,,,");
            sw.WriteLine(data.PaymentTerms + ",,,,,");
            sw.WriteLine(data.ExpirationDate + ",,,,,");
            sw.WriteLine(",,,,"+data.MyChargeName+",");
            sw.WriteLine(",,,,,");
            sw.WriteLine("品名,数量,単位,単価,金額,備考");

            foreach (DataGridViewRow row in data.DataContent)
            {
                string dRow = "";
                for (int i = 0; i < 6;i++ )
                {
                    string sSub = "";
                    if(i!=5){
                        sSub = ",";
                    }
                    if (row.Cells[i].Value != null)
                    {
                        string line = row.Cells[i].Value.ToString();
                        line = line.Replace("\r\n", "\n");
                        line = line.Replace("\n", @"\n");
                        dRow += line + sSub;
                    }
                    else
                    {
                        dRow += sSub;
                    }
                }
                sw.WriteLine(dRow);
            }
        }
Beispiel #3
0
        //
        public static void saveDetailData(DetailData data)
        {
            string fullPath = path+@"\" + DateTime.Now.ToString("yyyyMMdd-HHmmss")+".csv";
            StreamWriter sw=null;
            try
            {
                sw = new StreamWriter(fullPath, true, Encoding.UTF8);
                createFile(sw, data);
            }
            catch(DirectoryNotFoundException e){
                try
                {
                    Directory.CreateDirectory(path);
                    sw = new StreamWriter(fullPath, true, Encoding.UTF8);
                    createFile(sw,data);
                }catch(Exception){

                }
            }finally{
                if(sw!=null){
                    sw.Close();
                }
            }
        }
Beispiel #4
0
 //
 private static void loadDetailData(out DetailData data)
 {
     data = new DetailData();
 }
Beispiel #5
0
 public void setDetailData(DetailData d)
 {
     this.data = d;
 }
 public formPreviews(DetailData data)
 {
     InitializeComponent();
     datas = data;
 }