Ejemplo n.º 1
0
        protected string GetSpecialTestTime(int companyID, int courseID)
        {
            StringBuilder   resultHtml  = new StringBuilder();
            TestSettingInfo testSetting = TestSettingBLL.ReadCompanyTestSetting(int.Parse(Eval("CompanyID").ToString()), int.Parse(Eval("ID").ToString()));

            if (testSetting != null)
            {
                resultHtml.AppendLine("<br>");
                resultHtml.AppendLine("<span style=\"margin-left:10px;\">" + testSetting.TestStartTime + "—" + testSetting.TestEndTime + "</span>");
            }
            return(resultHtml.ToString());
        }
Ejemplo n.º 2
0
        protected void BindTestSetting(ProductInfo product)
        {
            TestSettingInfo systemTestSetting = TestSettingBLL.ReadCompanyTestSetting(product.CompanyID, product.ID);

            if (systemTestSetting != null)
            {
                TestStartTime.Text  = systemTestSetting.TestStartTime.ToString().Replace('/', '-');
                TestEndTime.Text    = systemTestSetting.TestEndTime.ToString().Replace('/', '-');
                PaperScore.Text     = systemTestSetting.PaperScore.ToString();
                TestTimeLength.Text = systemTestSetting.TestTimeLength.ToString();
                QuestionsNum.Text   = systemTestSetting.TestQuestionsCount.ToString();
                LowScore.Text       = systemTestSetting.LowScore.ToString();
                TestInterval.Text   = systemTestSetting.TestInterval.ToString();
            }
        }
Ejemplo n.º 3
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            ProductInfo product = new ProductInfo();

            product.ID        = RequestHelper.GetQueryString <int>("ID");
            product.CompanyID = companyID;
            product.Name      = this.Name.Text;
            product.Spelling  = ChineseCharacterHelper.GetFirstLetter(this.Name.Text);
            product.Color     = RequestHelper.GetForm <string>("ProductColor");
            //product.FontStyle = this.FontStyle.Text;
            product.ProductNumber = this.ProductNumber.Text;
            product.ClassID       = this.ProductClass.ClassIDList;
            product.Keywords      = this.Keywords.Text;
            if (string.IsNullOrEmpty(RequestHelper.GetForm <string>("AllBrandID")))
            {
                product.BrandID = RequestHelper.GetIntsForm("BrandID");
            }
            else
            {
                product.BrandID = RequestHelper.GetIntsForm("AllBrandID");
            }
            product.MarketPrice      = Convert.ToDecimal(this.MarketPrice.Text);
            product.Photo            = this.Photo.Text;
            product.Summary          = this.Summary.Text;
            product.Introduction     = this.Introduction.Value;
            product.IsSpecial        = Convert.ToInt32(this.IsSpecial.Text);
            product.IsNew            = Convert.ToInt32(this.IsNew.Text);
            product.IsHot            = Convert.ToInt32(this.IsHot.Text);
            product.IsSale           = Convert.ToInt32(this.IsSale.Text);
            product.IsTop            = Convert.ToInt32(this.IsTop.Text);
            product.Remark           = this.Remark.Text;
            product.Accessory        = RequestHelper.GetForm <string>("RelationAccessoryID");
            product.RelationProduct  = RequestHelper.GetForm <string>("RelationProductID");
            product.RelationArticle  = RequestHelper.GetForm <string>("RelationArticleID");
            product.AllowComment     = Convert.ToInt32(this.AllowComment.Text);
            product.AttributeClassID = Convert.ToInt32(this.AttributeClassID.Text);
            product.StandardType     = Convert.ToInt32(this.StandardType.Text);
            product.AddDate          = RequestHelper.DateNow;
            product.Sort             = Convert.ToInt32(Sort.Text);
            product.Editor           = Editor.Text;
            int    productID    = 0;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (product.ID == -2147483648)
            {
                base.CheckAdminPower("AddProduct", PowerCheckType.Single);
                productID = ProductBLL.AddProduct(product);
                this.AddProductPhoto(productID);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Product"), productID);
            }
            else
            {
                base.CheckAdminPower("UpdateProduct", PowerCheckType.Single);
                //公司发生变化,删除旧的考试设置
                ProductInfo oldProduct = ProductBLL.ReadProduct(product.ID);
                if (product.CompanyID != ProductBLL.ReadProduct(product.ID).CompanyID)
                {
                    try
                    {
                        TestSettingBLL.DeleteTestSetting(TestSettingBLL.ReadCompanyTestSetting(oldProduct.CompanyID, product.ID).Id);
                    }
                    catch (Exception ex)
                    { }
                }
                ProductBLL.UpdateProduct(product);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Product"), product.ID);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            this.HanderAttribute(product);
            //this.HanderMemberPrice(product.ID);
            this.HanderProductStandard(product);
            if (product.ID == int.MinValue)
            {
                product.ID = productID;
            }
            this.HanderTestSetting(product);
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }