Ejemplo n.º 1
0
        public void Add(DataPointHistoryData entity)
        {
            MySqlParameter[] mySqlPrarameters =
            {
                //new MySqlParameter("@DataPointHistoryDataId", entity.Id),
                new MySqlParameter("@DataPointHistoryDataId", Guid.NewGuid().ToString("D")),
                new MySqlParameter("@DataPointId",            entity.DataPoint.Id),
                new MySqlParameter("@DateTime",               entity.DateTime),
                new MySqlParameter("@Value",                  entity.Value)
            };

            string sqlString = "insert into numericalcontrolsystem.datapointhistorydata(DataPointHistoryDataId,DataPointId,DateTime,Value) " +
                               "values(@DataPointHistoryDataId,@DataPointId,@DateTime,@Value);";

            try
            {
                dbUtility.ExecuteNonQuery(sqlString, CommandType.Text, mySqlPrarameters);
            }
            catch (Exception ex)
            {
                string message = "添加失败!" + ex.Message;
                LoggingFactory.GetLogger().WriteDebugLogger(message);

                throw new Exception(message);
            }
        }
Ejemplo n.º 2
0
        public void Add(DataPoint entity)
        {
            MySqlParameter[] mySqlPrarameters =
            {
                new MySqlParameter("@Number",               entity.Number),
                new MySqlParameter("@Name",                 entity.Name),
                new MySqlParameter("@DeviceAddress",        entity.DeviceAddress),
                new MySqlParameter("@StartRegisterAddress", entity.StartRegisterAddress),
                new MySqlParameter("@DataType",             entity.DataType),
                new MySqlParameter("@DataPointType",        entity.DataPointType),
                new MySqlParameter("@Description",          entity.Description),
                new MySqlParameter("@ModuleId",             entity.ModuleBelongTo.Id)
            };

            string sqlString = "insert into numericalcontrolsystem.datapoint(Number,Name,DeviceAddress,StartRegisterAddress,DataType,DataPointType,Description,ModuleId) " +
                               "values(@Number,@Name,@DeviceAddress,@StartRegisterAddress,@DataType,@DataPointType,@Description,@ModuleId);";

            try
            {
                dbUtility.ExecuteNonQuery(sqlString, CommandType.Text, mySqlPrarameters);
            }
            catch (Exception ex)
            {
                string message = "添加失败!" + ex.Message;
                LoggingFactory.GetLogger().WriteDebugLogger(message);
            }
        }
Ejemplo n.º 3
0
    public static string GritCheckIn(string lot, string eqp, string workshopid, string worksiteid, string userid)
    {
        string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial      = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        string sql            = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid,type,lotcount)"
                                + " values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "','CheckIn'," + lotUseQuantity + ");";

        //更新checkOut 时间
        sql = sql + "update tlotbasis set checkouttime = now() where lotid = '" + lot + "';";


        //插入镀层厚度
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //  + " values('" + lotserial + "','" + worksiteid + "','DCThinkness','" + DCThinkness + "','" + userid + "',now());";

        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 4
0
    //添加用户权限
    public static int addUsergroup(string userid, string groupid)
    {
        string sql = "insert tusergroup select '" + userid + "','" + groupid + "';";
        int    n   = dbhelp.ExecuteNonQuery(sql, null);

        return(n);
    }
Ejemplo n.º 5
0
    //模具流转次数
    public static string UpdateMouldLotCount(string lot)
    {
        string sql    = "update jh_mes.tlotbasis set lotcount = lotcount+1 where lotid = '" + lot + "';";
        int    result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 6
0
    //增加PECVD类型 modify by lei.xue on 2016-12-5
    public static string Add(string paratype, string paraid, string paraname, string user)
    {
        string sql    = "INSERT INTO jh_mes.tparaconfig VALUES ('" + paratype + "', '" + paraid + "', '" + paraname + "',sysdate(), '" + user + "');";
        int    result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 7
0
    public static string DelShipmentInfo(string ShipmentID, string lotid)
    {
        string sql    = "delete from jh_mes.tshipmentinfo where shipmentid = '" + ShipmentID + "' and lotid = '" + lotid + "' ;";
        int    result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 8
0
    public static string Delete(string wo)
    {
        string sql = "delete from jh_mes.tworkorderinfo where workorderid='" + wo + "' ";
        int    rs  = dbhelp.ExecuteNonQuery(sql, null);

        if (rs > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 9
0
    //增加PECVD类型 modify by lei.xue on 2016-12-5
    public static string Add(string eqpid, string eqpname, string worksite, string workshop, string status, string createuser, string remark)
    {
        string sql = "INSERT INTO jh_mes.teqpinfo VALUES ('" + eqpid + "', '" + workshop + "', '" + eqpname + "','" + status + "', '" + worksite + "'," +
                     "'" + remark + "','" + createuser + "',sysdate(),null,null);";
        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 10
0
    public static string OutWardCheckOut(string lot, string outwardlotid, string eqp, string workshopid, string worksiteid, string userid, string DKWidth, string MouldStructure, string MouldPitch)
    {
        string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial      = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        string sql            = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid,type,lotcount)"
                                + "values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "','CheckOut'," + lotUseQuantity + ");";

        //更新checkOut 时间
        sql = sql + "update tlotbasis set checkouttime = now(),flowidno = flowidno+1,outwardlotid = '" + outwardlotid + "' where lotid = '" + lot + "';";

        //插入雕刻幅宽
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','DKWidth','" + DKWidth + "','" + userid + "',now());";
        //插入模具结构
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldStructure','" + MouldStructure + "','" + userid + "',now());";

        //插入模具Pitch
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldPitch','" + MouldPitch + "','" + userid + "',now());";


        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
 /// <summary>
 /// 插入员工
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BT_AddEmp_Click(object sender, EventArgs e)
 {
     try
     {
         String str     = "INSERT INTO XH_EMP_T VALUES(" + Convert.ToInt32(TB_EmpNo.Text) + ",'" + TB_EmpName.Text + "'," + Convert.ToInt32(CB_EmpStation.SelectedValue) + ",GETDATE(),'0',NULL)";
         Object objLock = new Object();
         lock (objLock)
         {
             db.ExecuteNonQuery(str);
         }
         DialogResult dr = MessageBox.Show("添加成功!是否继续添加?", "提示", MessageBoxButtons.OKCancel);
         if (dr == DialogResult.OK)
         {
             TB_EmpNo.Text               = "";
             TB_EmpName.Text             = "";
             CB_EmpStation.SelectedIndex = -1;
         }
         else
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("添加员工失败!");
     }
 }
Ejemplo n.º 12
0
    public static string CheckInfo(string lotid, string eqpid, string worksiteid, string result, string userid, string mouldlevel, AGCoatingQCDatalist datalist)
    {
        string lotserial = lotid + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        //检验结果
        string sql = "insert into jh_mes.tqclog(lotid,lotserial,worksiteid,eqpid,createtime,createuser,result,mouldlevel)"
                     + " values "
                     + " ('" + lotid + "',"
                     + " '" + lotserial + "',"
                     + " '" + worksiteid + "',"
                     + " '" + eqpid + "',"
                     + " now(),"
                     + " '" + userid + "',"
                     + " '" + result + "',"
                     + " '" + mouldlevel + "');";
        //检验项目
        //1、外观
        //a、左
        string sqldetail = "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";

        sqldetail += " values('" + lotserial + "','" + worksiteid + "','外观','左','" + datalist.appearanceleft + "','" + datalist.appearanceresult + "','" + userid + "',now());";
        //b、右
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','外观','右','" + datalist.appearanceright + "','" + datalist.appearanceresult + "','" + userid + "',now());";

        int intResult = dbhelp.ExecuteNonQuery(sql + sqldetail, null);

        if (intResult > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 13
0
    public static string CreateWO(string workorderid, string bomid, string flowid, string workshopid, string createuser,
                                  string MouldPinMin, string MouldLength, string MouldThinkness, string MouldWidth, string MouldType, string MouldPETType, string workordertype)
    {
        string sql = "insert into jh_mes.tworkorderinfo(workorderid,bomid,flowid,workshopid,createtime,createuser,mouldpinmin,mouldthinkness,mouldlength,mouldwidth,mouldtype,mouldpettype,workordertype)"
                     + " values('" + workorderid + "', "
                     + " '" + bomid + "',"
                     + " '" + flowid + "',"
                     + " '" + workshopid + "',"
                     + " now(),"
                     + " '" + createuser + "',"
                     + " '" + MouldPinMin + "',"
                     + " '" + MouldThinkness + "',"
                     + " '" + MouldLength + "',"
                     + " '" + MouldWidth + "',"
                     + " '" + MouldType + "',"
                     + " '" + MouldPETType + "',"
                     + " '" + workordertype + "')";


        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 14
0
    public static string ShipmentInfo(string lotid, string shipmentID)
    {
        string SQL = "update jh_mes.twarehouseinfo set shipmentid = '" + shipmentID + "' where lotid = '" + lotid + "' ;";

        //更新批次出货状态
        SQL += " update jh_mes.tlotbasis set shipment='Y' where lotid = '" + lotid + "'; ";
        int result = dbhelp.ExecuteNonQuery(SQL, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 15
0
    /// <summary>
    /// UV成型出站,绑定精雕站点的模具及其过站参数
    /// 取消胶水数量 modify by lei.xue on 2017-3-23
    /// </summary>
    /// <param name="lot"></param>
    /// <param name="labellot"></param>
    /// <param name="eqp"></param>
    /// <param name="workshopid"></param>
    /// <param name="worksiteid"></param>
    /// <param name="userid"></param>
    /// <param name="prelength"></param>
    /// <param name="prewidth"></param>
    /// <param name="length"></param>
    /// <param name="width"></param>
    /// <param name="MouldLot"></param>
    /// <param name="DKWidth"></param>
    /// <param name="MouldStructure"></param>
    /// <param name="MouldPitch"></param>
    /// <param name="GlueType"></param>
    /// <param name="GlueQty"></param>
    /// <returns></returns>
    public static string FilmCheckOut(string lot, string labellot, string eqp, string workshopid, string worksiteid, string userid,
                                      string MouldLot, string DKWidth, string MouldStructure, string MouldPitch,
                                      string GlueType)
    {
        string columnname = "UVCompletelotid";//字段名默认值
        //string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        string sql       = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid," + columnname + ")"
                           + " values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "', '" + labellot + "');";

        ////更新checkOut 时间
        //sql = sql + "update tlotbasis set checkouttime = now(),flowidno = flowidno+1," + columnname + " = '" + labellot + "',mouldlength = '" + length + "',mouldwidth= '" + width + "',restlength = '" + length + "',restwidth = '" + width + "' where lotid = '" + lot + "';";
        ////模具等级变为合格
        ////sql += " update jh_mes.tlotbasis set mouldlevel = '合格' where lotid = '" + lot + "';";
        ////插入前站卷材长度
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','PreMouldLength','" + prelength + "','" + userid + "',now());";
        ////插入前站幅宽规格
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','PreMouldWidth','" + prewidth + "','" + userid + "',now());";
        ////插入当站卷材长度
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','MouldLength','" + length + "','" + userid + "',now());";
        ////插入当站幅宽规格
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','MouldWidth','" + width + "','" + userid + "',now());";
        //插入模具编号
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldLot','" + MouldLot + "','" + userid + "',now());";
        //插入雕刻幅宽
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','DKWidth','" + DKWidth + "','" + userid + "',now());";
        //插入模具结构
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldStructure','" + MouldStructure + "','" + userid + "',now());";
        //插入模具Pitch
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldPitch','" + MouldPitch + "','" + userid + "',now());";
        //插入胶水规格
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','UVCompleteGlueType','" + GlueType + "','" + userid + "',now());";
        //插入胶水数量
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','GlueQty','" + GlueQty + "','" + userid + "',now());";

        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 16
0
    public static string WIPCheckOut(string lot, string labellot, string eqp, string workshopid, string worksiteid, string userid)
    {
        string type       = "";
        string sql        = "";
        string ColumnName = "";

        type = labellot.Substring(3, 1).ToString();

        string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial      = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");

        if (type == "Z")
        {
            ColumnName = "carvelotid";
        }
        else
        {
            ColumnName = "outwardlotid";
        }
        sql = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid,type,lotcount," + ColumnName + ")"
              + " values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "','CheckOut'," + lotUseQuantity + ",'" + labellot + "');";

        //更新checkOut 时间
        sql = sql + "update tlotbasis set checkouttime = now(),flowidno = flowidno+1," + ColumnName + " = '" + labellot + "' where lotid = '" + lot + "';";

        ////插入镀层材料
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //          + " values('" + lotserial + "','" + worksiteid + "','DCMaterial','" + DCMaterial + "','" + userid + "',now());";
        ////插入镀层厚度
        //sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
        //  + " values('" + lotserial + "','" + worksiteid + "','DCThinkness','" + DCThinkness + "','" + userid + "',now());";

        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 17
0
    //精雕进站模具参数改为出站填写 modify by lei.xue on 2017-4-13 ==========================
    //增加剩余厚度、钻石刀号、雕刻次数 modify by lei.xue on 2017-4-13=========================
    public static string CarveCheckOut(string lot, string carvelot, string eqp, string workshopid, string worksiteid, string userid, string DKWidth, string MouldStructure, string MouldPitch,
                                       string restthinkness, string diamondcutterno, string dkqty)
    {
        string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial      = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        string sql            = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid,type,lotcount,carvelotid)"
                                + " values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "','CheckOut'," + lotUseQuantity + ",'" + carvelot + "');";

        //更新checkOut 时间
        sql = sql + "update tlotbasis set checkouttime = now(),flowidno = flowidno+1,carvelotid = '" + carvelot + "' where lotid = '" + lot + "';";
        //模具等级变为合格
        sql += " update jh_mes.tlotbasis set mouldlevel = '合格' where lotid = '" + lot + "';";
        //插入雕刻幅宽
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','DKWidth','" + DKWidth + "','" + userid + "',now());";
        //插入模具结构
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldStructure','" + MouldStructure + "','" + userid + "',now());";

        //插入模具Pitch
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','MouldPitch','" + MouldPitch + "','" + userid + "',now());";
        //增加剩余厚度 add by lei.xue on 2017-4-13==================================================
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','RestThinkness','" + restthinkness + "','" + userid + "',now());";
        //增加钻石刀号 add by lei.xue on 2017-4-13==================================================
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','DiamondCutterNo','" + diamondcutterno + "','" + userid + "',now());";
        //增加雕刻次数 add by lei.xue on 2017-4-13==================================================
        sql = sql + "insert into jh_mes.twiplotdetail(lotserial,worksiteid,paratype,paraid,createuser,createtime)"
              + " values('" + lotserial + "','" + worksiteid + "','DKQty','" + dkqty + "','" + userid + "',now());";

        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 18
0
        /// <summary>
        /// 删除配置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BT_Cancel_Click(object sender, EventArgs e)
        {
            int row = Convert.ToInt32(dataGridView1.CurrentCell.RowIndex);

            //   String aaa = dataGridView1.SelectedRows[0].Cells["INTELLIGENTRACK_DATAIL_ID"].Value.ToString();

            if (MessageBox.Show("确定要删除?", "安全提示",
                                System.Windows.Forms.MessageBoxButtons.YesNo,
                                System.Windows.Forms.MessageBoxIcon.Warning)
                == System.Windows.Forms.DialogResult.Yes)
            {
                if (dataGridView1.DataSource == null)
                {
                    this.dataGridView1.Rows.RemoveAt(row);
                }
                else
                {
                    String sql = "UPDATE XH_INTELLIGENTRACK_DETAIL_T SET DELETE_FLAG='1'WHERE INTELLIGENTRACK_DETAIL_ID=" + Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["INTELLIGENTRACK_DATAIL_ID"].Value.ToString());
                    db.ExecuteNonQuery(sql);
                    this.dataGridView1.Rows.RemoveAt(row);
                }
            }
        }
Ejemplo n.º 19
0
    public static string CheckInfo(string lotid, string eqpid, string worksiteid, string result, string userid, string mouldlevel, AGCoatingQCDatalist datalist)
    {
        string lotserial = lotid + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
        //检验结果
        string sql = "insert into jh_mes.tqclog(lotid,lotserial,worksiteid,eqpid,createtime,createuser,result,mouldlevel)"
                     + " values "
                     + " ('" + lotid + "',"
                     + " '" + lotserial + "',"
                     + " '" + worksiteid + "',"
                     + " '" + eqpid + "',"
                     + " now(),"
                     + " '" + userid + "',"
                     + " '" + result + "',"
                     + " '" + mouldlevel + "');";
        //检验项目
        //1、外观
        //a、左
        string sqldetail = "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";

        sqldetail += " values('" + lotserial + "','" + worksiteid + "','外观','左','" + datalist.appearanceleft + "','" + datalist.appearanceresult + "','" + userid + "',now());";
        //b、右
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','外观','右','" + datalist.appearanceright + "','" + datalist.appearanceresult + "','" + userid + "',now());";
        //2、可用宽幅
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','可用宽幅','','" + datalist.availablewidth + "','" + datalist.availablewidthresult + "','" + userid + "',now());";
        //3、纹路
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','纹路','','" + datalist.lines + "','" + datalist.linesresult + "','" + userid + "',now());";
        //4、点线
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','点线','','" + datalist.dotline + "','" + datalist.dotlineResult + "','" + userid + "',now());";
        //5、正面保护膜张力
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','正面保护膜张力','','" + datalist.FrontTension + "','" + datalist.FrontTensionResult + "','" + userid + "',now());";
        //6、背面保护膜张力
        sqldetail += "insert into jh_mes.tqcdetail(lotserial,worksiteid,paratype,parasubtype,paraid,result,createuser,createtime) ";
        sqldetail += " values('" + lotserial + "','" + worksiteid + "','背面保护膜张力','','" + datalist.BackTension + "','" + datalist.BackTensionResult + "','" + userid + "',now());";

        int intResult = dbhelp.ExecuteNonQuery(sql + sqldetail, null);

        if (intResult > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 20
0
    // 更改工单状态 add by lei.xue on 2017-6-23
    public static string ChangWOStatus(string WO, string status)
    {
        string sql    = " update tworkorderinfo set status ='" + status + "' where workorderid = '" + WO + "' ; ";
        int    result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 21
0
    public static string MouldCompleteCheckIn(string lot, string labellot, string eqp, string workshopid, string worksiteid, string userid)
    {
        string type       = "";
        string sql        = "";
        string ColumnName = "";

        if (labellot.Length > 3)
        {
            type = labellot.Substring(3, 1).ToString();
        }
        string lotUseQuantity = CRUD.GetUseQuantityOfLot(lot);
        string lotserial      = lot + System.DateTime.Now.ToString("yyyyMMddHHmmssfff");

        if (type == "Z")
        {
            ColumnName = "carvelotid";
        }
        else
        {
            ColumnName = "outwardlotid";
        }
        sql = "insert into jh_mes.twiplotlog(lotid,lotserial,eqpid,createtime,createuser,workshopid,worksiteid,type,lotcount," + ColumnName + ")"
              + "values('" + lot + "','" + lotserial + "','" + eqp + "',now(),'" + userid + "','" + workshopid + "','" + worksiteid + "','CheckIn'," + lotUseQuantity + ",'" + labellot + "');";

        //更新checkin 时间
        sql = sql + "update tlotbasis set checkintime = now() where lotid = '" + lot + "';";
        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 22
0
        public void Add(Module entity)
        {
            MySqlParameter[] mySqlPrarameters =
            {
                new MySqlParameter("@Number",      entity.Number),
                new MySqlParameter("@Name",        entity.Name),
                new MySqlParameter("@Description", entity.Description)
            };

            string sqlString = "insert into numericalcontrolsystem.module(Number,Name,Description) " +
                               "values(@Number,@Name,@Description);";

            try
            {
                dbUtility.ExecuteNonQuery(sqlString, CommandType.Text, mySqlPrarameters);
            }
            catch (Exception ex)
            {
                string message = "添加失败!" + ex.Message;
                LoggingFactory.GetLogger().WriteDebugLogger(message);

                throw new Exception(message);
            }
        }
Ejemplo n.º 23
0
    //增加装箱前净重和装箱后毛重信息
    public static string InsertPacking(string lot, string PinHao, string productType, string user, string beforeweight, string afterweight)
    {
        string sql = "insert into jh_mes.tpackinginfo(lotid,PinHao,Producttype,createtime,createuser,BeforePackageWeight,AfterPackageWeight "
                     + ")values ("
                     + "'" + lot + "',"
                     + "'" + PinHao + "',"
                     + "'" + productType + "',"
                     + " sysdate(),"
                     + "'" + user + "',"
                     + "'" + beforeweight + "',"
                     + "'" + afterweight + "');"
                     + " update jh_mes.tlotbasis set processcomplete = 'Y',package = 'Y',packagetime = now(),packageuser = '******' where lotid = '" + lot + "' ;";

        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 24
0
    public static string InsertSplitLot(LotBasisDatalist list)
    {
        string sql = "insert into jh_mes.tlotsplit(lotid,sublotid,status,factoryid,workshopid,"
                     + " flowidno,worksitename,checkintime,checkouttime,createtime,createuser,"
                     + " flowid,lottype,filmlevel,filmlength,restfilmlength,filmwidth,restfilmwidth"
                     + ")values ("
                     + "'" + list.lotid + "',"
                     + "'" + list.sublotid + "',"
                     + "'" + list.status + "',"
                     + "'" + list.factoryid + "',"
                     + "'" + list.workshopid + "',"
                     + "'" + list.currentflowidno + "',"
                     + "Null,"      //worksitename
                     + "Null,"      //checkintime
                     + "Null,"      //checkouttime
                     + "sysdate()," //createtime
                     + "'" + list.createuser + "',"
                     + "'" + list.flowid + "',"
                     + "'" + list.lottype + "',"
                     + "'" + list.Filmlevel + "',"
                     + "'" + list.length + "',"
                     + "'" + list.restlength + "',"
                     + "'" + list.width + "',"
                     + "'" + list.restwidth + "'"
                     + ") ;";
        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 25
0
 /// <summary>
 /// 在DATAGRIDVIEW和数据库中同时删除记录,但是在数据库中是逻辑删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BT_Canel_Click(object sender, EventArgs e)
 {
     try
     {
         int    r     = this.dataGridView1.CurrentRow.Index;
         String empId = this.dataGridView1.Rows[r].Cells[4].Value.ToString();
         //删除DATAGRIDVIEW1的选中行
         this.dataGridView1.Rows.Remove(this.dataGridView1.Rows[r]);
         String str = "UPDATE XH_EMP_T SET XH_EMP_T.DELETE_FLAG='1' WHERE XH_EMP_T.EMP_ID=" + Convert.ToInt32(empId);
         db.ExecuteNonQuery(str);
     }
     catch (Exception ex)
     {
         MessageBox.Show("删除员工失败!");
     }
 }
Ejemplo n.º 26
0
 private int Add()
 {
     DbUtility dbUtility = new DbUtility("Server=.;uid=sa;pwd=landa;database=ORMTest", DbProviderType.SqlServer);
     SqlParameter[] parms = new SqlParameter[]{
         new SqlParameter("@Name",SqlDbType.VarChar,50),
         new SqlParameter("@Sex",SqlDbType.VarChar,10),
         new SqlParameter("@ClassId",SqlDbType.VarChar,50),
         new SqlParameter("@StudentNo",SqlDbType.VarChar,50)
     };
     parms[0].Value = "SimpleTest";
     parms[1].Value = "男";
     parms[2].Value = "09461";
     parms[3].Value = "0946101";
     int result = dbUtility.ExecuteNonQuery("insert into Student(Name,Sex,ClassId,StudentNo)values(@Name,@Sex,@ClassId,@StudentNo)", parms);
     return result;
 }
Ejemplo n.º 27
0
            /// <summary>
            /// 删除一条数据
            /// </summary>
            public bool Delete(int buildId)
            {
                var strSql = new StringBuilder();

                strSql.Append("delete from [centabldg] ");
                strSql.Append(" where CentaBuildId=@buildId ");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@buildId", SqlDbType.Int, 4)
                };
                parameters[0].Value = buildId;

                int rows = DbUtility.ExecuteNonQuery(strSql.ToString(), AppSettings.DbConn, parameters);

                return(rows > 0);
            }
Ejemplo n.º 28
0
    public static string InsertLot(LotBasisDatalist list)
    {
        //批次是否已经创建 add by lei.xue on 2017-6-2
        if (CreateMouldLot.LotExist(list.lotid) == "success")
        {
            return("批次已存在!");
        }
        string sql = "insert into jh_mes.tlotbasis(lotid,workorder,reworkorder,status,factoryid,workshopid,"
                     + " flowidno,worksitename,checkintime,checkouttime,createtime,createuser,flowid,lottype,lotcount,filmlevel,uvcompletelotid,pastefilmlotid,mouldlength,restlength,mouldwidth,restwidth,eqpid,validwidth,validlength"
                     + ")values ("
                     + "'" + list.lotid + "',"
                     + "'" + list.workorder + "',"
                     + "'" + list.reworkorder + "',"
                     + "'" + list.status + "',"
                     + "'" + list.factoryid + "',"
                     + "'" + list.workshopid + "',"
                     + "'" + list.currentflowidno + "',"
                     + "Null,"      //worksitename
                     + "Null,"      //checkintime
                     + "Null,"      //checkouttime
                     + "sysdate()," //createtime
                     + "'" + list.createuser + "',"
                     + "'" + list.flowid + "',"
                     + "'" + list.lottype + "',"
                     + list.lotcount + ","
                     + "'" + list.Filmlevel + "',"
                     + "'" + list.UVCompleteLotid + "',"
                     + "'" + list.PasteFilmLotid + "',"
                     + "'" + list.length + "',"
                     + "'" + list.restlength + "',"
                     + "'" + list.width + "',"
                     + "'" + list.restwidth + "',"
                     + "'" + list.eqpid + "',"
                     + "'" + list.validwidth + "',"
                     + "'" + list.validlength + "'"
                     + ") ;";
        int result = dbhelp.ExecuteNonQuery(sql, null);

        if (result > 0)
        {
            return("success");
        }
        else
        {
            return("批次创建失败!");
        }
    }
Ejemplo n.º 29
0
        private int Add()
        {
            DbUtility dbUtility = new DbUtility("Server=.;uid=sa;pwd=landa;database=ORMTest", DbProviderType.SqlServer);

            SqlParameter[] parms = new SqlParameter[] {
                new SqlParameter("@Name", SqlDbType.VarChar, 50),
                new SqlParameter("@Sex", SqlDbType.VarChar, 10),
                new SqlParameter("@ClassId", SqlDbType.VarChar, 50),
                new SqlParameter("@StudentNo", SqlDbType.VarChar, 50)
            };
            parms[0].Value = "SimpleTest";
            parms[1].Value = "男";
            parms[2].Value = "09461";
            parms[3].Value = "0946101";
            int result = dbUtility.ExecuteNonQuery("insert into Student(Name,Sex,ClassId,StudentNo)values(@Name,@Sex,@ClassId,@StudentNo)", parms);

            return(result);
        }
Ejemplo n.º 30
0
    public static string InsertWarehouseInfo(string warehouseid,
                                             string lotid,
                                             string warehousecode,
                                             string warehousetype,
                                             string workorderid,
                                             string workordertype,
                                             string workshopid,
                                             string userid,
                                             string pinmin,
                                             string thinkness,
                                             string length,
                                             string width,
                                             string type,
                                             string pettype)
    {
        string sql = " insert into jh_mes.twarehouseinfo(warehouseid,lotid,warehousecode,warehousetype,workorderid,workordertype,workshopid,warehouseuser,warehousetime,pinmin,thinkness,length,width,type,pettype)"
                     + " values('" + warehouseid
                     + "','" + lotid
                     + "','" + warehousecode
                     + "','" + warehousetype
                     + "','" + workorderid
                     + "','" + workordertype
                     + "','" + workshopid
                     + "','" + userid
                     + "',now(),'" + pinmin
                     + "','" + thinkness
                     + "','" + length
                     + "','" + width
                     + "','" + type
                     + "','" + pettype + "');";

        sql = sql + " update jh_mes.tlotbasis set warehouse = 'Y' where lotid = '" + lotid + "';";
        int res = dbhelp.ExecuteNonQuery(sql, null);

        if (res > 0)
        {
            return("success");
        }
        else
        {
            return("fail");
        }
    }
Ejemplo n.º 31
0
        public static bool UpdateOrder(OrderItem item)
        {
            var sql = "update " + AppSettings.TableSearch + " set status=@Status,createdate=getdate(),machine=@Machine where prn=@prn";

            var param = new List <SqlParameter>()
            {
                new SqlParameter {
                    ParameterName = "@prn", Value = item.Prn
                },
                new SqlParameter {
                    ParameterName = "@Machine", Value = item.Machine
                },
                new SqlParameter {
                    ParameterName = "@Status", Value = ConvertUtility.ToInt(item.Status)
                }
            };

            return(DbUtility.ExecuteNonQuery(sql, AppSettings.ConnStr, param.ToArray()) > 0);
        }
Ejemplo n.º 32
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            DialogResult dr;
            string order_sn = null;
            dr = MessageBox.Show("是否删除", "标题", MessageBoxButtons.OKCancel);
            if (dr == DialogResult.OK)
            {
                //MessageBox.Show("是");
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (dataGridView1.Rows[i].Cells[0].Value != null)
                    {
                        order_sn = order_sn + dataGridView1.Rows[i].Cells["order_sn"].Value + ",";
                    }
                }
                sql = string.Format("delete from cisdb_yyy.dbo.general_order where order_sn in ({0})",order_sn.Substring(0,order_sn.Length-1));
                DbUtility db = new DbUtility(DbProviderType.SqlServer);
                if (db.ExecuteNonQuery(sql, null) > 0)
                {
                    MessageBox.Show("删除成功!");
                    dataGridView1.DataSource = DbHelper.getOrderByPatientId(hd_patientId, tb_admissTimes.Text);
                    rb_all.Checked = true;
                }

            }
        }