示例#1
0
        // POST api/<controller>
        public string Post([FromBody] object value)
        {
            var      jd     = JObject.Parse(value.ToString());
            string   result = string.Empty;
            string   nt     = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            DateTime cd     = Convert.ToDateTime((string)jd["chk_date"]);
            string   cdStr  = cd.ToString("yyyy-MM-dd");

            try
            {
                if ((string)jd["updMode"] == "s")//開始
                {
                    //5
                    cc1.connectionofc008_modify(string.Format(@"  update chkList set 
starttime='{0}' where sno='{1}' and hand_order='{2}' and coordsID='{3}' and chk_date='{4}'
", nt, (string)jd["sno"], (string)jd["hand_order"], (string)jd["coordsID"], cdStr));
                }
                else//完成
                {
                    //7
                    cc1.connectionofc008_modify(string.Format(@"  update chkList set
endtime='{0}',totaltime='{1}',comstatus='{2}' 
where sno='{3}' and hand_order='{4}' and coordsID='{5}' and chk_date='{6}'
", nt, (string)jd["totaltime"], "1", (string)jd["sno"], (string)jd["hand_order"], (string)jd["coordsID"], cdStr));
                }
            }
            catch (Exception ex)
            {
                result = ex.ToString();
            }
            return(result);
        }
示例#2
0
        // POST api/<controller>
        public string Post([FromBody] object value)
        {
            string upStr   = "";
            var    updatas = JObject.Parse(value.ToString());

            foreach (var n in updatas["upds"])
            {
                upStr += "update ecsfc932_ud set errdsca='" + (string)n["errdsca"] + "',type='" + (string)n["kindval"] + "',lostno='" + (string)n["lostno"] + "' where errno='" + (string)n["errno"] + "';";
            }
            cc1.connectionofc008_modify(upStr);
            return(upStr);
        }
示例#3
0
        protected void InsertBtn_Click(object sender, EventArgs e)
        {
            Button       ibtn    = (Button)sender;
            DetailsView  d2      = (DetailsView)ibtn.FindControl("DetailsView1");
            Label        llll    = (Label)d2.FindControl("Label_errno");
            TextBox      tbx1    = (TextBox)d2.FindControl("TextBox1");
            DropDownList ddlist2 = (DropDownList)d2.FindControl("DropDownList2");

            //IconNum:6 positive、5 negative
            try
            {
                if (llll.Text == "" || tbx1.Text == "")
                {
                    throw new ArgumentNullException();
                }
                cc1.connectionofc008_modify("insert into ecsfc932_ud(errno,errdsca,type) values('" + llll.Text + "','" + tbx1.Text + "','" + ddlist2.SelectedValue + "')");
                GridView2.DataSourceID = "SqlDataSource1";
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "nulltip2", "nulltip2('新增成功!!',6)", true);
            }
            catch (ArgumentNullException ex)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "nulltip2", "nulltip2('欄位不可有空!!',5)", true);
            }
            catch (SqlException sqlexcp)
            {
                //用replace替換掉exception陳述式中出現的換行符號\r\n
                //以避免javascript因判斷不出字元而導致function出錯
                string SqlExcpStr = sqlexcp.Message.Replace(Environment.NewLine, "");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "nulltip2", "nulltip2('" + SqlExcpStr + "',5)", true);
            }
        }
示例#4
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int         index       = Convert.ToInt32(e.CommandArgument);
            GridViewRow row         = GridView1.Rows[index];
            string      ddj         = Convert.ToDateTime(cc1.time_now).ToString("yyyy-MM-dd HH:mm");
            string      pristr1     = cc1.getcolumnindexbyname(row, "cprj");
            string      pristr2     = cc1.getcolumnindexbyname(row, "line");
            string      pristr3     = cc1.getcolumnindexbyname(row, "nopr");
            string      pristr4     = cc1.getcolumnindexbyname(row, "puid");
            string      stop_status = cc1.getcolumnindexbyname(row, "workstop");
            string      position    = cc1.getcolumnindexbyname(row, "position");
            string      usdtimstr   = Convert.ToDateTime(cc1.connectionofc008_select("select usdtim from ecsfc930_pud where cprj='" + pristr1 + "' and line='" + pristr2 + "' and nopr='" + pristr3 + "' and puid='" + pristr4 + "'", "usdtim")).ToString("yyy-MM-dd HH:mm");

            Button      ssb1  = (Button)e.CommandSource;
            GridViewRow myrow = (GridViewRow)ssb1.NamingContainer;
            TextBox     tb    = (TextBox)GridView1.Rows[myrow.RowIndex].Cells[9].FindControl("tbpdsca");
            Button      upd   = (Button)GridView1.Rows[myrow.RowIndex].Cells[10].FindControl("End_exception");

            if (e.CommandName == "End_exception")
            {
                //if (tb.Text != "")
                //{
                string ssStatus = "1";    //1進行中 0休停中
                if (stop_status == "是")
                {
                    cc1.connectionofc008_modify("update ecsfc929_memb set code=NULL,statuscode='5' where cprj='" + pristr1 + "' and line='" + pristr2 + "' and nopr='" + pristr3 + "'");
                    ssStatus = "0";
                }
                else
                {
                    cc1.connectionofc008_modify("update ecsfc929_memb set statuscode='1' where cprj='" + pristr1 + "' and line='" + pristr2 + "' and nopr='" + pristr3 + "'");
                }
                cc1.connectionofc008_modify(@"update ecsfc930_pud set [workstop]='0',uclose='是',uedtim='" + ddj + "',eutm='" + cc1.calculate_time(usdtimstr, ddj) + "',pdsca='" + tb.Text + "' where cprj='" + pristr1 + "' and line='" + pristr2 + "' and nopr='" + pristr3 + "' and puid='" + pristr4 + "';");
                string uCt = cc1.connectionofc008_select("  select count(*) as uCt from ecsfc930_pud where line='" + pristr2 + "' and uclose='否'", "uCt");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "sendMsgtoKanban", "ssStatus = '" + ssStatus + "';position='" + position + "';eClose='" + uCt + "';$('#msgBtn').click();", true);
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "layer_close222", "parent.location.reload();", true);
                //}
                //else
                //{
                //    //upd.Attributes.Add("onclick", "nulltip2();");
                //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "nulltip2", "nulltip2();", true);
                //    //System.Threading.Thread.Sleep(5000);
                //    //Response.Redirect(Request.Url.ToString());
                //}
            }
        }
示例#5
0
        // POST api/<controller>
        public string Post([FromBody] object value)
        {
            var    jd     = JObject.Parse(value.ToString());
            int    status = Convert.ToInt32((string)jd["status"]);
            string cprj   = (string)jd["cprj"];
            string line   = (string)jd["line"];
            string nopr   = (string)jd["nopr"];
            string errno  = (string)jd["errno"];

            //dt、workstop
            switch (status)
            {
            //不停工異常
            case 4:
                cc1.connectionofc008_modify(string.Format("insert into ecsfc930_pud(cprj,line,nopr,usdtim,errno,WorkStop) values('{0}','{1}','{2}','{3}','{4}','0')", cprj, line, nopr, DateTime.Now.ToString("yyyy-MM-dd HH:mm"), errno));
                cc1.connectionofc008_modify(string.Format("update ecsfc929_memb set statuscode='4' where cprj='{0}' and line= '{1}' and nopr='{2}'", cprj, line, nopr));
                break;

            //停工異常(進行中)
            case 3:
                cc1.connectionofc008_modify(string.Format("insert into ecsfc930_pud(cprj,line,nopr,usdtim,errno,WorkStop) values('{0}','{1}','{2}','{3}','{4}','1')", cprj, line, nopr, DateTime.Now.ToString("yyyy-MM-dd HH:mm"), errno));
                string msfid = cc1.connectionofc008_select(string.Format("select top 1 msfid from ecsfc933_mdt where cprj='{0}' and line='{1}' and nopr='{2}' order by msfid desc", cprj, line, nopr), "msfid");
                this.cc1.connectionofc008_modify(string.Format(@"update ecsfc933_mdt set edate='{0}',edtim='{1}' where msfid='{2}'", DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("HHmm"), msfid));
                int countofgroup933 = Convert.ToInt32(cc1.connectionofc008_select(string.Format("select count(*) as cot from ecsfc933_mdt where cprj='{0}' and line='{1}' and nopr='{2}'", cprj, line, nopr), "cot"));
                int totalm          = connectionofc008_selectarray(string.Format("select sdate,stuff(right('0000'+cast(sdtim as nvarchar),4),3,0,':') as sdt,edate,stuff(right('0000'+cast(edtim as nvarchar),4),3,0,':') as edt from ecsfc933_mdt where cprj='{0}' and line='{1}' and nopr='{2}'", cprj, line, nopr), countofgroup933);
                this.cc1.connectionofc008_modify(string.Format("update ecsfc929_memb set autm='" + totalm + "',statuscode='3' where cprj='{0}' and line='{1}' and nopr='{2}'", cprj, line, nopr));
                break;

            //停工異常(休停中)
            default:
                cc1.connectionofc008_modify(string.Format("insert into ecsfc930_pud(cprj,line,nopr,usdtim,errno,WorkStop) values('{0}','{1}','{2}','{3}','{4}','1')", cprj, line, nopr, DateTime.Now.ToString("yyyy-MM-dd HH:mm"), errno));
                this.cc1.connectionofc008_modify(string.Format("update ecsfc929_memb set statuscode='3' where cprj='{0}' and line='{1}' and nopr='{2}'", cprj, line, nopr));
                break;
            }

            return("");
        }
示例#6
0
        // POST api/<controller>
        public string Post([FromBody] object value)
        {
            StringBuilder upStr   = new StringBuilder();
            var           updatas = JObject.Parse(value.ToString());

            foreach (var n in updatas["upds"])
            {
                //upStr.Append(@"update rp3440.baan.baan.tecsfc915230 set t_dsca='" + (string)n["t_dsca"] + "' where t_cprj='" + (string)n["t_cprj"] + "';");
                upStr.Append(string.Format(@"
IF NOT EXISTS (SELECT * FROM ecsfc004_sinData 
                   WHERE cprj='{0}' and line='{2}')
       INSERT INTO ecsfc004_sinData (cprj,line,t_dsca)
       VALUES ('{0}','{2}', '{1}');
   else
       update ecsfc004_sinData set t_dsca='{1}' where cprj='{0}' and line='{2}';", (string)n["t_cprj"], (string)n["t_dsca"], updatas["line"].ToString()));
            }
            cc1.connectionofc008_modify(upStr.ToString());
            return(upStr.ToString());
        }
示例#7
0
        public string Post([FromBody] object value)
        {
            //須注意來源格式的宣告要正確
            //此處因來源為使用json 而此處定義為object(如此才能收到資料)
            int      kd = 5682;
            var      jd = JObject.Parse(value.ToString());
            string   wt = (string)jd["time"] ?? DateTime.Now.ToString();
            DateTime dt = Convert.ToDateTime(wt);
            //var jData = (JObject)JsonConvert.DeserializeObject(value.ToString());
            int    ti   = Convert.ToInt32((string)jd["status"]);
            string cprj = (string)jd["cprj"];
            string line = (string)jd["line"];
            string nopr = (string)jd["nopr"];
            string empl = (string)jd["empl"];
            //mode用以判斷是否為協作
            //mode=1為協作專案
            string mode      = (string)jd["mode"];
            int    autmTotal = 0;

            switch (ti)
            {
            case 1:    //未開  此處status數字代表意義與前端不同
                       //此處為欲變更為之狀態代號
                this.cc1.connectionofc008_modify(@"insert into ecsfc933_mdt(cprj,line,nopr,sdate,sdtim,emno) values('" + cprj + "','" + line + "','" + nopr + "','" + dt.ToString("yyyy-MM-dd") + "','" + dt.ToString("HHmm") + "','" + empl + "')");
                this.cc1.connectionofc008_modify(@"update ecsfc929_memb set sdate='" + dt.ToString("yyyy-MM-dd") + "',sdtim='" + dt.ToString("HHmm") + "',code='*',statuscode='1' where cprj='" + cprj + "'and line='" + line + "' and nopr='" + nopr + "'");
                try
                {
                    if (line.Trim() == "P722")
                    {
                        //Task.Run(() => cc1.RunCommandAsynchronously("update rp3440.baan.baan.tecsfc914230 set " + "t_adat_" + nopr + "='" + dt.ToString("yyyy-MM-dd") + "' where t_cprj='" + cprj + "' and t_line='" + line + "'"));
                        cc1.connectionofc008_modify("update rp3440.baan.baan.tecsfc914230 set " + "t_adat_" + nopr + "='" + dt.ToString("yyyy-MM-dd") + "' where t_cprj='" + cprj + "' and t_line='" + line + "'");
                    }
                    else if (nopr.Trim() == "1")
                    {
                        //Task.Run(() => cc1.RunCommandAsynchronously("update rp3440.baan.baan.tecsfc915230 set t_apdt='" + dt.ToString("yyyy-MM-dd") + "' where t_cprj='" + cprj + "' and t_line='" + line + "'"));
                        cc1.connectionofc008_modify("update rp3440.baan.baan.tecsfc915230 set t_apdt='" + dt.ToString("yyyy-MM-dd") + "' where t_cprj='" + cprj + "' and t_line='" + line + "'");
                    }
                }
                catch (Exception ex)
                {
                    smm.Mail_Send("*****@*****.**", "*****@*****.**", "ecsfc914、915更新失敗", "'" + cprj + "','" + nopr + "'更新失敗'" + ex.ToString() + "'!!!", true);
                }
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);

            case 2:    //轉至休停
                //autmTotal = autmCal(cprj, line, nopr);
                DateTime dk = Convert.ToDateTime(getLatestSdate(cprj, line, nopr));
                if (dk <= dt)
                {
                    if (mode == "1")
                    {
                        cc1.connectionofc008_modify(@"update ecsfc933_mdt set edate='" + dt.ToString("yyyy-MM-dd") + "',edtim='" + dt.ToString("HHmm") + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                    + "' and cooperation='1' and emno='" + empl + "' order by msfid desc);"
                                                    + "insert into ecsfc933_mdt (cprj,line,nopr,emno,cooperation) values('" + cprj + "','" + line + "','" + nopr + "','" + empl + "','1')"
                                                    );
                    }
                    else
                    {
                        cc1.connectionofc008_modify(@"update ecsfc933_mdt set edate='" + dt.ToString("yyyy-MM-dd") + "',edtim='" + dt.ToString("HHmm") + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                    + "' order by msfid desc);"
                                                    + "update ecsfc929_memb set statuscode='2',autm='" + autmCal(cprj, line, nopr) + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "'"
                                                    );
                    }
                    return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);
                }
                else
                {
                    return("1");
                }

            case 0:    //轉至開始
                if (mode == "1")
                {
                    cc1.connectionofc008_modify("update ecsfc933_mdt set sdate='" + dt.ToString("yyyy-MM-dd") + "',sdtim='" + dt.ToString("HHmm") + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                + "' and cooperation='1' and emno='" + empl + "' order by msfid desc);"
                                                );
                }
                else
                {
                    cc1.connectionofc008_modify("update ecsfc933_mdt set sdate='" + dt.ToString("yyyy-MM-dd") + "',sdtim='" + dt.ToString("HHmm") + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                + "' order by msfid desc);"
                                                + "update ecsfc929_memb set statuscode='1',code='*' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "'"
                                                );
                }
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);

            case 3:    //紅異
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);

            case 4:    //黃異
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);

            case 5:    //待復工 尚未完成
                if (mode == "1")
                {
                    cc1.connectionofc008_modify("update ecsfc933_mdt set sdate='',sdtim='' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and cooperation='1' and emno='" + empl + "' order by msfid desc)");
                }
                else
                {
                    cc1.connectionofc008_modify("update ecsfc933_mdt set sdate='',sdtim='' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' order by msfid desc)");
                    this.cc1.connectionofc008_modify(@"update ecsfc929_memb set code='*',statuscode='1' where cprj='" + cprj + "'and line='" + line + "' and nopr='" + nopr + "'");
                }
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);

            case 7:    //進行中完工 autm計算
                if (Convert.ToDateTime(getLatestSdate(cprj, line, nopr)) <= dt)
                {
                    if (mode == "1")
                    {
                        cc1.connectionofc008_modify(@"update ecsfc933_mdt set edate='" + dt.ToString("yyyy-MM-dd") + "',edtim='" + dt.ToString("HHmm") + "' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                    + "' and cooperation='1' and emno='" + empl + "' order by msfid desc);"
                                                    + "delete from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and (sdate is null and sdtim is null);"
                                                    );
                    }
                    else
                    {
                        autmTotal = autmCal(cprj, line, nopr);
                        cc1.connectionofc008_modify("update ecsfc929_memb set edate='" + dt.ToString("yyyy-MM-dd") + "',edtim='" + dt.ToString("HHmm") + "',autm='" + autmTotal + "',pfc='是',statuscode='6' where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "'");
                    }
                    return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);
                }
                else
                {
                    return("1");
                }

            case 8:    //休停中完工
                DateTime glt = Convert.ToDateTime(getLatestSdate(cprj, line, nopr, 0));
                if (Convert.ToDateTime(getLatestSdate(cprj, line, nopr, 0)) <= dt)
                {
                    if (mode == "1")
                    {
                        cc1.connectionofc008_modify("delete from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and (sdate is null and sdtim is null)");
                    }
                    else
                    {
                        string sdt = glt.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd") ? "750" : glt.ToString("HHmm");
                        cc1.connectionofc008_modify(@"
                                    update ecsfc933_mdt set sdate='" + DateTime.Now.ToString("yyyy-MM-dd") + "',sdtim='" + sdt + "',edate='',edtim='' where msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' order by msfid desc)"
                                                    + "update ecsfc929_memb set edate='" + dt.ToString("yyyy-MM-dd") + "',edtim='" + dt.ToString("HHmm") + "',pfc='是',statuscode='6',msfid=(select top 1 msfid from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and (sdate is not null and edate is not null) order by msfid desc) where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr
                                                    + "';"
                                                    + "delete from ecsfc933_mdt where cprj='" + cprj + "' and line='" + line + "' and nopr='" + nopr + "' and (sdate is null and sdtim is null)"
                                                    );
                    }
                    if (glt.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
                    {
                        return("");
                    }
                    else
                    {
                        return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);
                    }
                }
                else
                {
                    return("1");
                }

            default:
                return("test return: " + kd + ":" + wt + "=>" + ti + ":" + cprj);
            }
        }
示例#8
0
        // PUT api/<controller>/5
        public string Put(int id, [FromBody] string value)
        {
            var originalData = JObject.Parse(value.ToString());
            //抓取所有originalData["machs"]下的key name
            var            o2   = JObject.Parse(originalData["machs"].ToString());
            IList <string> keys = o2.Properties().Select(p => p.Name).ToList();
            string         tstr = "";
            Array          d    = keys.ToArray();

            try {
                for (int di = 0; di < d.Length; di++)//機台單位
                {
                    int    totalClean = 0; int totalChk = 0; int totalOil = 0;
                    string i = keys[di];
                    //insert 機台主資料
                    string machID     = (string)i;
                    string machName   = (string)o2[i]["imgName"];
                    string insertMain = string.Format("insert into ChkMachInfo(sno,mach_id,mach_name,mach_map)values('{0}','{1}','{2}','{3}');"
                                                      , machID
                                                      , machID
                                                      , machName
                                                      , machName);
                    string        insertCoords   = "insert into ChkPointCoords(sno,coordsID,coords,SubImg) values";
                    StringBuilder typeCleanInStr = new StringBuilder("insert into ChkItem(sno,[6s_type],coordsID ,hand_order, part, standard ,method ,tool ,time , cycle, nextchk_date, sortNo) values ");
                    StringBuilder typeChkInStr   = new StringBuilder("insert into ChkItem(sno,[6s_type],coordsID ,hand_order, part, position, standard, method, process, time, cycle, nextchk_date, sortNo) values ");
                    StringBuilder typeOilInStr   = new StringBuilder("insert into ChkItem(sno,[6s_type],coordsID ,hand_order, position, standard, method, oil, tool, time, cycle, nextchk_date, sortNo) values ");
                    StringBuilder insertChkList  = new StringBuilder("insert into chkList(sno,hand_order,coordsID,chk_date) values");
                    //string insertChkItem = "insert into chkItem(sno,handorder,part,standard,['6s_type'],cycle,nextchk_date) values ";

                    StringBuilder inCICombine = new StringBuilder();
                    int           coordsCt    = 0;
                    tstr += o2[i]["imgName"];
                    //抓取所有originalData["machs"][mid]下的point key name
                    IList <string> locas    = JObject.Parse(o2[i]["chkData"].ToString()).Properties().Select(p => p.Name).ToList();
                    int            t        = 0;
                    Array          locasAry = locas.ToArray();
                    for (int locA = 0; locA < locasAry.Length; locA++)//點檢位置單位
                    {
                        string locaObj = locas[locA];
                        string dot     = "";
                        //insert coord datas
                        string coordX = o2[i]["chkData"][locaObj]["coords"]["x"].ToString();
                        string coordY = o2[i]["chkData"][locaObj]["coords"]["y"].ToString();
                        dot           = coordsCt != 0 ? "," : "";
                        insertCoords += dot + "('" + machID + "','" + locas[locA] + "','" + coordX + "," + coordY + "','" + o2[i]["chkData"][locaObj]["subImgName"]["s1"].ToString() + "')";
                        coordsCt++;
                        //chkitem 各個欄位
                        //get items key name
                        IList <string> items    = JObject.Parse(o2[i]["chkData"][locaObj]["items"].ToString()).Properties().Select(p => p.Name).ToList();
                        var            dkj      = JObject.Parse(o2[i]["chkData"][locaObj]["items"].ToString());
                        string         dot2     = "";
                        Array          itemsAry = items.ToArray();
                        for (int iat = 0; iat < itemsAry.Length; iat++)//依點檢、給油、清掃資料格式區分
                        {
                            StringBuilder  insertChkItem = new StringBuilder();
                            IList <string> typeItems     = JObject.Parse(o2[i]["chkData"][locaObj]["items"][items[iat]].ToString()).Properties().Select(p => p.Name).ToList();
                            Array          typeItems_ary = typeItems.ToArray();
                            for (int tya = 0; tya < typeItems_ary.Length; tya++)//跑該分類之所有資料
                            {
                                StringBuilder  icol     = new StringBuilder();
                                IList <string> ItemsCol = JObject.Parse(o2[i]["chkData"][locaObj]["items"][items[iat]][typeItems[tya]].ToString()).Properties().Select(p => p.Name).ToList();
                                Array          icl      = ItemsCol.ToArray();
                                icol.Append("'" + machID + "'," + "'" + items[iat] + "','" + locas[locA] + "'");
                                StringBuilder InChkD = new StringBuilder("('" + machID + "','" + o2[i]["chkData"][locaObj]["items"][items[iat]][typeItems[tya]]["hand_order"].ToString() + "','" + locas[locA] + "','" + o2[i]["chkData"][locaObj]["items"][items[iat]][typeItems[tya]]["nextchk_date"].ToString() + "'),");
                                insertChkList.Append(InChkD);
                                for (int ict = 0; ict < icl.Length; ict++)//該資料列下的資料欄位(依分類不同所含欄位也相異)
                                {
                                    //string iidf = ItemsCol.ToArray()[ict].ToString();
                                    //string dot3 = ict != 0 ? "," : "";
                                    string dot3 = ",";
                                    icol.Append(dot3 + "'" + o2[i]["chkData"][locaObj]["items"][items[iat]][typeItems[tya]][ItemsCol[ict]].ToString() + "'");
                                }
                                string dot4 = tya != 0 ? "," : "";
                                insertChkItem.Append(dot4 + "(" + icol + ")");
                            }
                            t++;
                            switch (items[iat])
                            {
                            case "clean":
                                string dot5 = totalClean != 0 ? "," : "";
                                typeCleanInStr.Append(dot5 + insertChkItem);//此處insertChkItem為該點下對應分類所有行資料,此處動作為整併所有點chkPoint中對應分類的資料彙總。e.g. p0_clean+p1_clean...
                                totalClean++;
                                break;

                            case "chk":
                                string dot51 = totalChk != 0 ? "," : "";
                                typeChkInStr.Append(dot51 + insertChkItem);
                                totalChk++;
                                break;

                            default:
                                string dot52 = totalOil != 0 ? "," : "";
                                typeOilInStr.Append(dot52 + insertChkItem);
                                totalOil++;
                                break;
                            }
                            //inCICombine.Append(insertChkItem.Append(";"));
                        }
                    }
                    inCICombine.Append(typeCleanInStr.ToString() + ";" + typeChkInStr.ToString() + ";" + typeOilInStr + ";");
                    insertCoords += ";";
                    insertChkList = insertChkList.Remove(insertChkList.Length - 1, 1).Append(";");
                    tstr          = insertMain + insertCoords + inCICombine + insertChkList;
                    //insert chkItems
                    cc1.connectionofc008_modify(tstr);
                }
                return(tstr);
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }
        }