Esempio n. 1
0
        public bool insertqrcode(string ReelID, string lotNo, string PartNo, string DateCode, int Qty, string VendorCode, string remark, string username, out string message)
        {
            message = null;
            bool flag = true;

            try
            {
                string cmd = string.Empty;
                cmd = @"SELECT REEL_ID,PART_NO,DATE_CODE,QTY,LOTNO,VENDOR_CODE,PO FROM LCR_BASE_REEL  WHERE REEL_ID=:REELID";

                DataTable dt = repository.FindTable(cmd, new { REELID = ReelID });

                if (dt.Rows.Count > 0)//已有数据,存入历史表
                {
                    cmd = "delete  from  lcr.lcr_base_reel where  reel_id=:reelid";
                    repository.ExecuteBySql(cmd, new
                    {
                        reelid = ReelID
                    });
                }


                cmd = "insert into lcr.LCR_BASE_REEL(reel_id,part_no,DATE_CODE,QTY,LOTNO,VENDOR_CODE,remark1,createuserid,createdate) values " +
                      "(:reelid,:partno,:datecode,:qty,:lotno,:vendorcode,:lotno1,:userid,:createdate)";

                repository.ExecuteBySql(cmd, new
                {
                    reelid     = ReelID,
                    partno     = PartNo,
                    datecode   = DateCode,
                    qty        = Qty,
                    lotno      = lotNo,
                    lotno1     = remark,////由于标签规格不标准,批次存在两个栏位
                    vendorcode = VendorCode,
                    userid     = username,
                    createdate = DateTime.Now
                });

                message = "REEL ID 注册成功";
            }
            catch (Exception ex)
            {
                message = ex.Message;
                flag    = false;
            }
            return(flag);
        }
Esempio n. 2
0
        private bool InsertTestResult(string reelid, string partno, string testvalue, string unit, string userid)
        {
            bool flag = true;

            try
            {
                string cmd = string.Empty;
                cmd = @"select reel_id from lcr.LCR_REEL lt where lt.reel_id=:reelid";

                DataTable dt = repository.FindTable(cmd, new { reelid = reelid });

                if (dt.Rows.Count > 0)//已有数据,存入历史表
                {
                    cmd = " insert into LCR_REEL_DETAIL( reel_id,part_no,result,value,unit,createdate,createuserid) select t.reel_id,t.part_no," +
                          "t.result,t.value,t.unit,t.createdate,t.createuserid from LCR_REEL t  where t.reel_id= :reelid ";
                    repository.ExecuteBySql(cmd, new { reelid = reelid });

                    cmd = "delete from lcr.LCR_REEL lt where lt.reel_id=:reelid";
                    repository.ExecuteBySql(cmd, new { reelid = reelid });
                }

                cmd = "insert into lcr.LCR_REEL(reel_id,part_no,result,value,unit,createuserid,createdate) values " +
                      "(:reelid,:partno,:result,:value,:unit,:userid,:createdate)";

                repository.ExecuteBySql(cmd, new
                {
                    reelid     = reelid,
                    partno     = partno,
                    result     = "PASS",
                    value      = testvalue,
                    unit       = unit,
                    userid     = userid,
                    createdate = DateTime.Now
                });

                ///AddRow(txtCPN.Text.Trim(), txtReelNo.Text.Trim(), testvalue, "PASS");
            }
            catch (Exception ex)
            {
                ///setMessage(MessageType.Error, ex.Message);
                flag = false;
            }
            return(flag);
        }
Esempio n. 3
0
        public static bool oraclelog(string terminal_id, string work_order, string log_detail, string log_status)
        {
            var    dbSearch = new OracleRepository(oracleConnectionStr);
            string sql      = "insert into vsky.tsc_log(terminal_id,time,work_order,logdetail,status) values(:terminal_id,SYSDATE,:work_order,:log_detail,:log_status)";
            var    td       = dbSearch.ExecuteBySql(sql, new { terminal_id = terminal_id, work_order = work_order, log_detail = log_detail, log_status = log_status });

            //int num = td.Rows.Count;
            if (td == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }