Beispiel #1
0
        /// <summary>
        /// 修改CCD零件的屏蔽时间
        /// </summary>
        /// <param name="workBench">工位</param>
        /// <param name="goodsCode">图号型号</param>
        /// <param name="goodsName">物品名称</param>
        /// <param name="spec">规格</param>
        /// <param name="starTime">屏蔽开始时间</param>
        /// <param name="endTime">屏蔽终止时间</param>
        /// <param name="error">错误信息</param>
        /// <returns>修改成功返回true,失败返回False</returns>
        public bool UpdateCCDConfigTime(string workBench, string goodsCode, string goodsName,
                                        string spec, DateTime starTime, DateTime endTime, out string error)
        {
            error = "";

            try
            {
                PlatformServiceDataContext dataContxt = ParameterFactory.PlatformDataContext;

                var result = from a in dataContxt.ZPX_CCDConfig
                             where a.工位 == workBench && a.零件图号 == goodsCode &&
                             a.零件名称 == goodsName && a.零件规格 == spec
                             select a;

                if (result.Count() == 1)
                {
                    ZPX_CCDConfig CCDConfig = result.Single();

                    CCDConfig.屏蔽开始时间 = starTime;
                    CCDConfig.屏蔽终止时间 = endTime;
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 添加CCD拍照防错的信息
        /// </summary>
        /// <param name="config">装配顺序防错数据对象</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回true 失败返回false</returns>
        public bool InsertCCDConfig(ZPX_CCDConfig config, out string error)
        {
            error = "";

            PlatformServiceDataContext dataContxt = ParameterFactory.PlatformDataContext;

            try
            {
                var result = from a in dataContxt.ZPX_CCDConfig
                             where a.工位 == config.工位 &&
                             a.零件图号 == config.零件图号 && a.零件名称 == config.零件名称 &&
                             a.零件规格 == config.零件规格
                             select a;

                if (result.Count() == 0)
                {
                    dataContxt.ZPX_CCDConfig.InsertOnSubmit(config);
                }
                else
                {
                    error = "数据重复,请检查!";
                    return(false);
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 修改CCD拍照防错的信息
        /// </summary>
        /// <param name="config">CCD拍照防错数据对象</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回true 失败返回false</returns>
        public bool UpdateCCDConfig(ZPX_CCDConfig config, out string error)
        {
            error = "";

            PlatformServiceDataContext dataContxt = ParameterFactory.PlatformDataContext;

            try
            {
                var result = from a in dataContxt.ZPX_CCDConfig
                             where a.工位 == config.工位 &&
                             a.零件图号 == config.零件图号 && a.零件名称 == config.零件名称 &&
                             a.零件规格 == config.零件规格
                             select a;

                if (result.Count() != 1)
                {
                    error = "数据错误,请检查!";
                    return(false);
                }
                else
                {
                    ZPX_CCDConfig lnqCCD = result.Single();

                    lnqCCD.测点号    = config.测点号;
                    lnqCCD.适用产品类型 = config.适用产品类型;
                }

                dataContxt.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }