Ejemplo n.º 1
0
        public ActionResult CheckYzm()
        {
            string code = DoRequest.GetFormString("code");

            string msg   = "系统错误";
            bool   error = true;

            if (string.IsNullOrEmpty(code))
            {
                return(Json(new { error = error, message = "验证码不能为空" }));
            }

            int           returnVal = -1;
            CheckCodeInfo info      = new CheckCodeInfo();
            var           res       = CheckManagerVerifyCode.Do(code);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnVal = Utils.StrToInt(res.Header.Result.Code, -1);
                msg       = res.Header.Result.Msg;
                info      = res.Body;
            }

            string url = _config.UrlManager + "/Home/index";

            if (returnVal == 0)
            {
                Cookies.SaveLoginInfo(info.mobile_no, info.last_login_ip, info.last_login_time);
            }
            return(Json(new { error = returnVal == 0 ? false : true, message = msg, url = url }));
        }
Ejemplo n.º 2
0
        public bool AddCheckItem(CheckCodeInfo info)
        {
            string sql = @"INSERT INTO CheckCodeInfo (FGWID,FAssemblyID,FBarCodeRule,FDate) VALUES(@gwID,@assemblyID,@codeRule,GETDATE()) ";

            using (var conn = new DbHelperSQL(config).GetConnection())
            {
                return(conn.Execute(sql, new { gwID = info.FGWID, assemblyID = info.FAssemblyID, codeRule = info.FBarCodeRule, }) > 0);
            }
        }
Ejemplo n.º 3
0
        public bool UpdateCheckItem(CheckCodeInfo info)
        {
            string sql = @"UPDATE CheckCodeInfo SET FBarCodeRule = @rule WHERE FInterID = @Id ";

            using (var conn = new DbHelperSQL(config).GetConnection())
            {
                return(conn.Execute(sql, new { rule = info.FBarCodeRule, Id = info.FInterID }) > 0);
            }
        }
Ejemplo n.º 4
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            CheckCodeInfo info = new CheckCodeInfo();
            var           item = TypeItems.SelectedItem.ToString();

            if (TypeItems.HasItems && !string.IsNullOrEmpty(item))
            {
                var type = AssemblyList.Find(f => f.FAssemblyName == item);
                info.FAssemblyID = type.FInterID;
            }
            var gwItem = GwItems.SelectedItem.ToString();

            if (!string.IsNullOrEmpty(gwItem))
            {
                info.FGWID = (GwType)Enum.Parse(typeof(GwType), gwItem);
            }

            var code = codeRule.Text.Trim();

            if (string.IsNullOrEmpty(code))
            {
                Info.Text = "装配校验码不能为空!";
                return;
            }
            info.FBarCodeRule = code;

            if (dal.GetExistsCheckCode(info.FGWID, info.FAssemblyID))
            {
                Info.Text = "已存在此工位的装配类型数据!";
                return;
            }

            if (dal.AddCheckItem(info))
            {
                addCheckHandler(this, true);
                this.Close();
            }
            else
            {
                Info.Text = "新增失败";
            }
        }
Ejemplo n.º 5
0
        private void StartType(AssemblyType type)
        {
            this.assemblyType = type;

            typeName.Text = type.FAssemblyName;

            DefaultText1();
            DefaultText2();
            DefaultText3();
            DefaultText4();
            checkMark = false;
            var mark = false;
            // Init 各工位检验码
            var list = dal.GetCheckCodeInfo(string.Empty, type.FInterID);

            if (list.Any())
            {
                list.ForEach(f =>
                {
                    f.entries = dal.GetCheckCodeInfoEntry(f.FInterID);
                });
            }

            codeInfo1 = list.Find(f => f.FGWID == GwType.OP01);
            if (codeInfo1 == null)
            {
                remark1.Text = $"该工位没有配置{type.FAssemblyName}的检验码";
                mark         = true;
            }
            else
            {
                entry1 = codeInfo1.entries;
                if (!entry1.Any())
                {
                    remark1.Text = $"该工位没有配置{type.FAssemblyName}的零件检验码";
                    mark         = true;
                }
            }
            codeInfo2 = list.Find(f => f.FGWID == GwType.OP40);
            if (codeInfo2 == null)
            {
                remark2.Text = $"该工位没有配置{type.FAssemblyName}的检验码";
                mark         = true;
            }
            else
            {
                entry2 = codeInfo2.entries;
                if (!entry2.Any())
                {
                    remark2.Text = $"该工位没有配置{type.FAssemblyName}的零件检验码";
                    mark         = true;
                }
            }
            codeInfo3 = list.Find(f => f.FGWID == GwType.OP70);
            if (codeInfo3 == null)
            {
                remark3.Text = $"该工位没有配置{type.FAssemblyName}的检验码";
                mark         = true;
            }
            else
            {
                entry3 = codeInfo3.entries;
                if (!entry3.Any())
                {
                    remark3.Text = $"该工位没有配置{type.FAssemblyName}的零件检验码";
                    mark         = true;
                }
            }
            //codeInfo4 = list.Find(f => f.FGWID == GwType.OP80);
            //if (codeInfo4 == null)
            //{
            //    remark4.Text = $"该工位没有配置{type.FAssemblyName}的检验码";
            //    mark = true;
            //}

            checkMark = mark;
            //log.Info(checkMark);

            list1.ItemsSource = barlist1;
            list2.ItemsSource = barlist2;
            list3.ItemsSource = barlist3;
            list4.ItemsSource = valuelist;
        }