Beispiel #1
0
        /// <summary>
        /// 修改表中的数据
        /// </summary>
        /// <param name="Certification"></param>
        public void UpdateCertification(FieldCertification certification)
        {
            FieldCertification CName = context.FieldCertification.FindById <FieldCertification>(certification.Id);

            CName.EnterpriseHonor = certification.EnterpriseHonor ?? CName.EnterpriseHonor;
            CName.ProductDetails  = certification.ProductDetails ?? CName.ProductDetails;
            DateTime?applicationDate = certification.ApplicationDate;

            CName.ApplicationDate = (applicationDate.HasValue ? new DateTime?(applicationDate.GetValueOrDefault()) : CName.ApplicationDate);
            CName.Status          = certification.Status == 0 ? CName.Status : certification.Status;
            DateTime?toAcceptTheDate = certification.ToAcceptTheDate;

            CName.ToAcceptTheDate = (toAcceptTheDate.HasValue ? new DateTime?(toAcceptTheDate.GetValueOrDefault()) : CName.ToAcceptTheDate);
            DateTime?certificationDate = certification.CertificationDate;

            CName.CertificationDate = (certificationDate.HasValue ? new DateTime?(certificationDate.GetValueOrDefault()) : CName.CertificationDate);
            DateTime?feedbackDate = certification.FeedbackDate;

            CName.FeedbackDate          = (feedbackDate.HasValue ? new DateTime?(feedbackDate.GetValueOrDefault()) : CName.FeedbackDate);
            CName.RefuseReason          = certification.RefuseReason ?? CName.RefuseReason;
            CName.Certificationcost     = (certification.Certificationcost == new decimal(0) ? CName.Certificationcost : certification.Certificationcost);
            CName.AnnualSales           = (certification.AnnualSales == new decimal(0) ? CName.AnnualSales : certification.AnnualSales);
            CName.Certification         = certification.Certification ?? CName.Certification;
            CName.EnterpriseHonor       = certification.EnterpriseHonor ?? CName.EnterpriseHonor;
            CName.ProductDetails        = certification.ProductDetails ?? CName.ProductDetails;
            CName.TelegraphicMoneyOrder = certification.TelegraphicMoneyOrder ?? CName.TelegraphicMoneyOrder;
            context.SaveChanges();
        }
        public ActionResult Management()
        {
            FieldCertification.CertificationStatus fcstatus = FieldCertification.CertificationStatus.Unusable;
            FieldCertification fcf = ServiceHelper.Create <ICertification>().GetCertification(base.CurrentSellerManager.CertificationId);

            if (fcf != null)
            {
                fcstatus = fcf.Status;
            }
            else
            {
                fcf = new FieldCertification();
            }

            ViewBag.Status = fcstatus;

            /*供应商信息*/
            ShopInfo shop = ServiceHelper.Create <IShopService>().GetShop(base.CurrentSellerManager.ShopId, false);

            ViewBag.ShopStatus = shop.ShopStatus;
            ViewBag.ShopId     = shop.Id;

            /*自定义支付单号*/
            ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO();
            ViewBag.OrderId = _orderBO.GenerateOrderNumber();

            return(View(fcf));
        }
        public ActionResult Auditing(long id)
        {
            FieldCertificationQuery FieldCertificationQuery = new FieldCertificationQuery();
            FieldCertification      Certification           = ServiceHelper.Create <ICertification>().GetCertification(id);
            FieldCertificationModel FieldCertificationModel = new FieldCertificationModel(Certification);

            return(View(FieldCertificationModel));
        }
        public ActionResult Receing(long id)
        {
            FieldCertificationQuery FieldCertificationQuery = new FieldCertificationQuery();
            FieldCertification      Certification           = ServiceHelper.Create <ICertification>().GetCertification(id);
            FieldCertificationModel FieldCertificationModel = new FieldCertificationModel(Certification);

            ViewBag.Id     = id;
            ViewBag.Status = Certification.Status;
            return(View(FieldCertificationModel));
        }
        public ActionResult Details(long id)
        {
            FieldCertificationQuery FieldCertificationQuery = new FieldCertificationQuery();
            FieldCertification      Certification           = ServiceHelper.Create <ICertification>().GetCertification(id);
            FieldCertificationModel FieldCertificationModel = new FieldCertificationModel(Certification);

            ViewBag.PassStr = Certification.Status.ToDescription();
            ViewBag.Status  = Certification.Status.ToDescription();
            return(View(FieldCertificationModel));
        }
Beispiel #6
0
        public bool ExistCertification(string CompanyName, long Id = 0L)
        {
            FieldCertification FieldCertificationInfo = (
                from p in context.FieldCertification
                where p.CompanyName.Equals(CompanyName) && p.Id != Id
                select p).FirstOrDefault();

            if (FieldCertificationInfo != null && FieldCertificationInfo.Status != FieldCertification.CertificationStatus.Refuse)
            {
                return(true);
            }
            return(false);
        }
        public JsonResult EditCertificationPay(string telegraphicMoneyOrder)
        {
            FieldCertification fieldfertification = new FieldCertification()
            {
                Id = base.CurrentSellerManager.CertificationId,
                TelegraphicMoneyOrder = telegraphicMoneyOrder,
                Status       = FieldCertification.CertificationStatus.PayandWaitAudit,
                FeedbackDate = DateTime.Now
            };

            ServiceHelper.Create <ICertification>().UpdateCertification(fieldfertification);
            return(Json(new { success = true }));
        }
        public JsonResult EditCertification(FieldCertification certification)
        {
            FieldCertification fieldfertification = new FieldCertification()
            {
                Id = base.CurrentSellerManager.CertificationId,
                EnterpriseHonor = certification.EnterpriseHonor,
                ProductDetails  = certification.ProductDetails,
                ApplicationDate = DateTime.Now,
                Status          = FieldCertification.CertificationStatus.Submit
            };

            ServiceHelper.Create <ICertification>().UpdateCertification(fieldfertification);
            return(Json(new { success = true }));
        }
Beispiel #9
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <param name="businessCategoryOn"></param>
        /// <returns></returns>
        public FieldCertification GetCertification(long Id)
        {
            FieldCertification nums        = context.FieldCertification.FindById <FieldCertification>(Id);
            ManagerInfo        managerInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.CertificationId.Equals(nums.Id));

            if (managerInfo != null)
            {
                ShopInfo shopInfo = context.ShopInfo.FirstOrDefault((ShopInfo m) => m.Id.Equals(managerInfo.ShopId));
                nums.CompanyName              = (shopInfo == null ? "" : shopInfo.CompanyName);
                nums.CompanyAddress           = (shopInfo == null ? "" : shopInfo.CompanyAddress);
                nums.LegalPerson              = (shopInfo == null ? "" : shopInfo.legalPerson);
                nums.CompanyRegisteredCapital = shopInfo.CompanyRegisteredCapital;
            }
            return(nums);
        }
Beispiel #10
0
        /// <summary>
        /// 在新增HiMall_Manager的时候给Shops表中加了一条数据,后面关于这条数据就都是修改(方法:CreateEmptyShop())
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <param name="salt"></param>
        /// <returns></returns>
        public ManagerInfo AddSellerManager(string username, string password, string salt = "")
        {
            ManagerInfo managerInfo;
            ManagerInfo managerInfo1 = context.ManagerInfo.FirstOrDefault((ManagerInfo p) => p.UserName == username);

            if (managerInfo1 != null)
            {
                return(new ManagerInfo()
                {
                    Id = managerInfo1.Id
                });
            }
            if (string.IsNullOrEmpty(salt))
            {
                Guid guid = Guid.NewGuid();
                salt = SecureHelper.MD5(guid.ToString("N"));
            }
            using (TransactionScope transactionScope = new TransactionScope())
            {
                ShopInfo shopInfo = Instance <IShopService> .Create.CreateEmptyShop();

                FieldCertification fieldfertification = Instance <ICertification> .Create.CreateFieldModulep();

                ManagerInfo managerInfo2 = new ManagerInfo()
                {
                    CreateDate   = DateTime.Now,
                    UserName     = username,
                    Password     = password,
                    PasswordSalt = salt,
                    ShopId       = shopInfo.Id,

                    CertificationId  = fieldfertification.Id,
                    SellerPrivileges = new List <SellerPrivilege>()
                    {
                        0
                    },
                    AdminPrivileges = new List <AdminPrivilege>(),
                    RoleId          = 0
                };

                managerInfo = managerInfo2;
                context.ManagerInfo.Add(managerInfo);
                context.SaveChanges();
                transactionScope.Complete();
            }
            return(managerInfo);
        }
Beispiel #11
0
        /// <summary>
        /// 更新认证状态
        /// </summary>
        /// <param name="shopId"></param>
        /// <param name="status"></param>
        /// <param name="comments"></param>
        public void UpdateStatus(long Id, FieldCertification.CertificationStatus status, DateTime Date, string comments = "")
        {
            FieldCertification nullable = context.FieldCertification.FindById <FieldCertification>(Id);

            nullable.Status = status;
            if (!string.IsNullOrWhiteSpace(comments))
            {
                nullable.RefuseReason = comments;
            }
            /*审核通过*/
            if (status == FieldCertification.CertificationStatus.Open)
            {
                nullable.CertificationDate = Date;

                ManagerInfo _ManagerInfo = context.ManagerInfo.Where(q => q.CertificationId == Id).FirstOrDefault();
                if (_ManagerInfo != null)
                {
                    ShopInfo _ShopInfo = context.ShopInfo.FindById <ShopInfo>(_ManagerInfo.ShopId);
                    if (_ShopInfo != null)
                    {
                        _ShopInfo.SortType = 2; //0默认/1审核后/2实地/3付费;
                        context.SaveChanges();
                    }
                }
            }
            /*接受申请*/
            if (status == FieldCertification.CertificationStatus.Receive)
            {
                nullable.Status          = FieldCertification.CertificationStatus.Receive;
                nullable.ToAcceptTheDate = Date;
            }
            /*支付待审核*/
            if (status == FieldCertification.CertificationStatus.PayandWaitAudit)
            {
                nullable.Status       = FieldCertification.CertificationStatus.PayandWaitAudit;
                nullable.FeedbackDate = Date;
            }
            /*拒绝*/
            if (status == FieldCertification.CertificationStatus.Refuse)
            {
                nullable.Status            = FieldCertification.CertificationStatus.Refuse;
                nullable.RefuseReason      = comments;
                nullable.CertificationDate = Date;
            }
            context.SaveChanges();
        }
Beispiel #12
0
        /// <summary>
        /// 新增一条数据
        /// </summary>
        /// <returns></returns>
        public FieldCertification CreateFieldModulep()
        {
            FieldCertification fcf = new FieldCertification()
            {
                Status                = FieldCertification.CertificationStatus.Unusable,
                Certificationcost     = new decimal(0),
                AnnualSales           = new decimal(0),
                Certification         = "",
                EnterpriseHonor       = "",
                ProductDetails        = "",
                TelegraphicMoneyOrder = ""
            };
            FieldCertification fc = fcf;

            context.FieldCertification.Add(fc);
            context.SaveChanges();
            return(fc);
        }
Beispiel #13
0
 public FieldCertificationModel(FieldCertification m) : this()
 {
     Id                       = m.Id;
     Status                   = m.Status.ToDescription();
     ApplicationDate          = m.ApplicationDate;
     ToAcceptTheDate          = m.ToAcceptTheDate;
     CertificationDate        = m.CertificationDate;
     FeedbackDate             = m.FeedbackDate;
     Certificationcost        = m.Certificationcost;
     AnnualSales              = m.AnnualSales;
     Certification            = m.Certification;
     EnterpriseHonor          = m.EnterpriseHonor;
     ProductDetails           = m.ProductDetails;
     TelegraphicMoneyOrder    = m.TelegraphicMoneyOrder;
     CompanyName              = m.CompanyName;
     LegalPerson              = m.LegalPerson;
     CompanyAddress           = m.CompanyAddress;
     CompanyRegisteredCapital = m.CompanyRegisteredCapital;
     RefuseReason             = m.RefuseReason;
 }