Example #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            String chk = sC.mHisDB.ssdDB.selectIDByYearMonth(cboYear.Text, cboMonth.SelectedValue.ToString());

            if (!chk.Equals(""))
            {
                MessageBox.Show("พบข้อมูล ได้มีการนำเข้า เรียบร้อยแล้ว\n ถ้าต้องการนำเข้าใหม่ ต้องยกเลิก รายการเดิมก่อน ", "พบข้อมูล ได้มีการนำเข้า เรียบร้อยแล้ว");
            }
            else
            {
                sC.lSplit.Clear();
                for (int i = 0; i < grdView.Sheets[0].Rows.Count; i++)
                {
                    TSsdataSplit sp = new TSsdataSplit();
                    sp.split_no              = grdView.Sheets[0].Cells[i, colsplitno].Value.ToString();
                    sp.date_time_start       = grdView.Sheets[0].Cells[i, coldatestart].Value.ToString();
                    sp.date_time_end         = grdView.Sheets[0].Cells[i, coldateend].Value.ToString();
                    sp.status_process        = grdView.Sheets[0].Cells[i, colstatusprocess].Value.ToString();
                    sp.split_start_date_time = txtAutoStart.Text;
                    sC.lSplit.Add(sp);
                }
                sC.mHisDB.createTSSData(sC.iniC.HCODE, sC.iniC.branchId, cboYear.Text, cboMonth.SelectedValue.ToString(), sC.lSplit);
                //sC.mHisDB.insertTSSSplit(sC.lSplit);
                //foreach (TSsdataSplit sp in sC.lSplit)
                //{
                //    //sp.ssdata_id = ssd.ssdata_id;
                //    spDB.insert(sp);
                //}
                //sC.mHisDB.insertTSSData(sC.iniC.HCODE, sC.iniC.branchId, cboYear.Text, cboMonth.SelectedValue.ToString(), pB1, label12, label13, this, sC.lSplit, "new");
            }
        }
Example #2
0
        public String insert(TSsdataSplit p)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            sql = "Insert Into " + ssP.table + "(" + ssP.active + "," + ssP.date_time_end + "," +
                  ssP.date_time_start + "," + ssP.split_no + "," + ssP.split_start_date_time + "," +
                  ssP.ssdata_id + "," + ssP.status_process + ") " +
                  "Values ('" + p.active + "','" + p.date_time_end + "','" +
                  p.date_time_start + "','" + p.split_no + "','" + p.split_start_date_time + "','" +
                  p.ssdata_id + "','" + p.status_process + "'  " +
                  ")";
            re = conn.ExecuteNonQuery1(conn.connSSData, sql);

            return(re);
        }
Example #3
0
        private void initConfig()
        {
            ssP                       = new TSsdataSplit();
            ssP.active                = "active";
            ssP.date_time_end         = "date_time_end";
            ssP.date_time_start       = "date_time_start";
            ssP.split_no              = "split_no";
            ssP.split_start_date_time = "split_start_date_time";
            ssP.ssdata_id             = "ssdata_id";
            ssP.ssdata_split_id       = "ssdata_split_id";
            ssP.status_process        = "status_process";
            ssP.date_start            = "date_start";
            ssP.date_end              = "date_end";
            ssP.cnt_visit_start       = "cnt_visit_start";
            ssP.cnt_visit_end         = "cnt_visit_end";

            ssP.table   = "t_ssdata_split";
            ssP.pkField = "ssdata_split_id";
        }