예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            SealInforNew sealInforNew = await db.SealInforNews.FindAsync(id);

            db.SealInforNews.Remove(sealInforNew);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,SealInforNum,SealUseUnitInfor_Id_UnitNumber,SealCategory_Id_Code,SealContent,ForeignLanguageContent,SealMaterial,RegistrationCategory,SealShape,EngravingType,EngravingLevel,SealState,MakeWay,TheProducer,Note,CreateTime,IsRemoved")] SealInforNew sealInforNew)
        {
            if (ModelState.IsValid)
            {
                db.Entry(sealInforNew).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.SealCategory_Id_Code           = new SelectList(db.SealCategorys, "Id", "Name", sealInforNew.SealCategory_Id_Code);
            ViewBag.SealUseUnitInfor_Id_UnitNumber = new SelectList(db.SealUseUnitInfors, "Id", "UnitNumber", sealInforNew.SealUseUnitInfor_Id_UnitNumber);
            return(View(sealInforNew));
        }
예제 #3
0
        // GET: SealInforNews/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SealInforNew sealInforNew = await db.SealInforNews.FindAsync(id);

            if (sealInforNew == null)
            {
                return(HttpNotFound());
            }
            return(View(sealInforNew));
        }
예제 #4
0
        // GET: SealInforNews/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SealInforNew sealInforNew = await db.SealInforNews.FindAsync(id);

            if (sealInforNew == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SealCategory_Id_Code           = new SelectList(db.SealCategorys, "Id", "Name", sealInforNew.SealCategory_Id_Code);
            ViewBag.SealUseUnitInfor_Id_UnitNumber = new SelectList(db.SealUseUnitInfors, "Id", "UnitNumber", sealInforNew.SealUseUnitInfor_Id_UnitNumber);
            return(View(sealInforNew));
        }
예제 #5
0
        /// <summary>
        /// 向数据库插入印章信息
        /// </summary>
        /// <param name="seal">印章信息表</param>
        /// <param name="ars">TheOrder订单表</param>
        /// <returns></returns>
        public async Task <int> CreateSealList(string seal, string ars)
        {
            string guid = Guid.NewGuid().ToString();
            int    id   = await BLL.SealInforNewBLL.GetMaxId();

            List <Models.SealInforNew1> s1 = JsonConvert.DeserializeObject <List <Models.SealInforNew1> >(seal);

            Models.SealInforNew2 s2 = JsonConvert.DeserializeObject <Models.SealInforNew2>(ars);

            SealSystem.Models.SealInforNew list   = new SealInforNew();
            SealSystem.Models.TheOrder     listss = new TheOrder();//订单
            foreach (Models.SealInforNew1 item in s1)
            {
                try
                {
                    list.EngravingLevel                 = item.EngravingLevel;
                    list.EngravingType                  = item.EngravingType;
                    list.Note                           = item.Note;
                    list.RegistrationCategory           = item.RegistrationCategory;
                    list.SealCategory_Id_Code           = BLL.SealCategoriesBLL.GetSelected(item.SealCategory_Id_Code, item.SealSpecification);
                    list.SealContent                    = item.SealContent;
                    list.SealInforNum                   = (1201160000000 + id++).ToString(); /*item.SealInforNum;*///印章编码
                    list.SealMaterial                   = item.SealMaterial;
                    list.SealShape                      = item.SealShape;
                    list.SealState                      = "已录入";
                    list.TheOrders_TheOrderCode         = guid;
                    list.SealUseUnitInfor_Id_UnitNumber = await BLL.SealUseUnitInforBLL.GetOneForId(s2.SealUseUnitInfor_Id_UnitNumber);

                    await BLL.SealInforNewBLL.AddAsync(list);//增加一条印章信息
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            //添加订单信息
            listss.ForTheRecordType = s2.ForTheRecordType;
            //listss.SealInforNum = item.SealInforNum;
            listss.SealMakingUnitInfor_Name = s2.SealMakingUnitInfor_Name;
            listss.TheRegistrationArea      = s2.TheRegistrationArea;
            listss.TheOrderCode             = guid;
            listss.SealState = "待交付";
            await BLL.TheOrderBLL.Add(listss);

            return(listss.Id);
        }