public PageContextWrapper(PageContext pageContext)
        {
            if (pageContext == null) 
                throw new ArgumentNullException("pageContext");

            _pageContext = pageContext;
        }
 public PlaceHolderMarker(PlaceholderContext placeholderContext, PageContext pageContext)
 {
     _placeholderContext = placeholderContext;
     _pageContext = pageContext;
     Assert.IsNotNull((object)placeholderContext, "placeholderContext");
     Assert.ArgumentNotNull((object)pageContext, "pageContext");
 }
Exemple #3
0
        public ResultPage(PageContext context)
        {
            InitializeComponent();

            this.context = context;

            // this wizard page is always ready
            this.ready = true;
        }
Exemple #4
0
        /// <summary>
        /// Does the first run.
        /// </summary>
        /// <param name="pageContext">The page context.</param>
        public void DoFirstRun(PageContext pageContext)
        {
            //this.PageContext = pageContext;
            this.Page = pageContext.MarkdownPage;
            this.RenderHtml = pageContext.RenderHtml;
            this.ScopeArgs = pageContext.ScopeArgs;

            OnFirstRun();
        }
Exemple #5
0
        public void ExportJson()
        {
            var guid = Guid.NewGuid();
            var pageContext = new PageContext
            {
                Guid = guid
            };

            var result = pageContext.ToJson();
            var key = string.Format( "\"Guid\": \"{0}\"", guid );
            Assert.NotEqual( result.IndexOf( key ), -1 );
        }
Exemple #6
0
 public void Render(TextWriter writer, PageContext context)
 {
     _writer = writer;
     try
     {
         Execute();
     }
     finally
     {
         _writer = null;
     }
 }
            public void ShouldExportAsJson()
            {
                var guid = Guid.NewGuid();
                var pageContext = new PageContext
                    {
                        Guid = guid
                    };

                var result = pageContext.ToJson();
                var key = string.Format( "\"Guid\": \"{0}\"", guid );
                Assert.Greater( result.IndexOf( key ), -1, string.Format( "'{0}' was not found in '{1}'.", key, result ) );
            }
Exemple #8
0
        public void ImportJson()
        {
            var obj = new PageContext
            {
                Guid = Guid.NewGuid(),
                IsSystem = false
            };

            var json = obj.ToJson();
            var pageContext = PageContext.FromJson( json );
            Assert.Equal( obj.Guid, pageContext.Guid );
            Assert.Equal( obj.IsSystem, pageContext.IsSystem );
        }
            public void ShouldCopyPropertiesToEntity()
            {
                var obj = new PageContext
                {
                    Guid = Guid.NewGuid(),
                    IsSystem = false
                };

                var json = obj.ToJson();
                var pageContext = PageContext.FromJson( json );
                Assert.AreEqual( obj.Guid, pageContext.Guid );
                Assert.AreEqual( obj.IsSystem, pageContext.IsSystem );
            }
Exemple #10
0
        protected void btnPHClose_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(tbxPH1.Text) || string.IsNullOrWhiteSpace(lstRQ_SC1.Text) || string.IsNullOrWhiteSpace(lstYXQZ1.Text))
            {
                Alert.Show("请把信息填写完整在提交");
                return;
            }
            else if (lstRQ_SC1.SelectedDate >= DateTime.Now)
            {
                Alert.Show("【生产日期】应小于当前日期,请重新填写");
                return;
            }
            else if (lstYXQZ1.SelectedDate <= DateTime.Now)
            {
                Alert.Show("【有效期至】应大于当前日期,请重新填写");
                return;
            }
            else if (lstRQ_SC1.SelectedDate > lstYXQZ1.SelectedDate)
            {
                Alert.Show("【生产日期】大于【有效期至】,请重新输入!");
                return;
            }

            string[] strCell = GridGoods.SelectedCell;
            Dictionary <string, object> newDict = GridGoods.GetNewAddedList()[Convert.ToInt32(strCell[0])];

            newDict["PH"]      = tbxPH1.Text;
            newDict["PHID"]    = tbxPH1.Text;
            newDict["PZWH"]    = tbxPZWH1.Text;
            newDict["RQ_SC"]   = lstRQ_SC1.Text;
            newDict["YXQZ"]    = lstYXQZ1.Text;
            newDict["KCSL"]    = "0";
            newDict["PDSL"]    = nbxSL.Text;
            newDict["BZSL"]    = nbxSL.Text;
            newDict["HSJE"]    = decimal.Parse(newDict["HSJJ"].ToString()) * decimal.Parse(nbxSL.Text);
            newDict["CYHSJE"]  = decimal.Parse(newDict["HSJJ"].ToString()) * decimal.Parse(nbxSL.Text);
            newDict["BHSJE"]   = decimal.Parse(newDict["BHSJJ"].ToString()) * decimal.Parse(nbxSL.Text);
            newDict["CYBHSJE"] = decimal.Parse(newDict["BHSJJ"].ToString()) * decimal.Parse(nbxSL.Text);
            newDict["LSJE"]    = "0";
            newDict["KCHSJE"]  = "0";
            newDict["KCBHSJE"] = "0";

            //string cell = string.Format("[{0},{1}]", intCell[0], intCell[1]);
            //PageContext.RegisterStartupScript(GridGoods.GetAddNewRecordReference(GetJObject(newDict), false));
            PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(strCell[0], strCell[1], GetJObject(newDict).ToString()));
            //增加合计
            decimal bzslTotal = 0, feeTotal = 0, ddslTotal = 0, je1 = 0, je2 = 0, je3 = 0, je4 = 0;
            List <Dictionary <string, object> > goodsData = GridGoods.GetNewAddedList();

            for (int i = 0; i < goodsData.Count; i++)
            {
                Dictionary <string, object> row = goodsData[i];
                ddslTotal += Convert.ToDecimal(row["KCSL"]);
                bzslTotal += Convert.ToDecimal(row["PDSL"]);
                feeTotal  += Convert.ToDecimal(row["BZSL"]);
                je1       += Convert.ToDecimal(row["HSJE"]);
                je2       += Convert.ToDecimal(row["BHSJE"]);
                je3       += Convert.ToDecimal(row["CYHSJE"]);
                je4       += Convert.ToDecimal(row["CYBHSJE"]);
            }
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("KCSL", ddslTotal.ToString());
            summary.Add("PDSL", bzslTotal.ToString());
            summary.Add("BZSL", feeTotal.ToString());
            summary.Add("HSJE", je1.ToString("F2"));
            summary.Add("BHSJE", je2.ToString("F2"));
            summary.Add("CYHSJE", je3.ToString("F2"));
            summary.Add("CYBHSJE", je4.ToString("F2"));
            GridGoods.SummaryData = summary;

            PubFunc.FormDataClear(Form3);
            tbxPH1.Text            = "";
            nbxSL.Text             = "";
            lstRQ_SC1.SelectedDate = DateTime.Now;
            lstYXQZ1.SelectedDate  = DateTime.Now;
            tbxPZWH1.Text          = "";
            WindowPH.Hidden        = true;
        }
Exemple #11
0
        /// <summary>
        /// Handles the OnSave event of the masterPage control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void masterPage_OnSave( object sender, EventArgs e )
        {
            Page.Validate( BlockValidationGroup );
            if ( Page.IsValid && _pageId.HasValue )
            {
                var rockContext = new RockContext();
                var pageService = new PageService( rockContext );
                var routeService = new PageRouteService( rockContext );
                var contextService = new PageContextService( rockContext );

                var page = pageService.Get( _pageId.Value );

                int parentPageId = ppParentPage.SelectedValueAsInt() ?? 0;
                if ( page.ParentPageId != parentPageId )
                {
                    if ( page.ParentPageId.HasValue )
                    {
                        PageCache.Flush( page.ParentPageId.Value );
                    }

                    if ( parentPageId != 0 )
                    {
                        PageCache.Flush( parentPageId );
                    }
                }

                page.InternalName = tbPageName.Text;
                page.PageTitle = tbPageTitle.Text;
                page.BrowserTitle = tbBrowserTitle.Text;
                if ( parentPageId != 0 )
                {
                    page.ParentPageId = parentPageId;
                }
                else
                {
                    page.ParentPageId = null;
                }

                page.LayoutId = ddlLayout.SelectedValueAsInt().Value;

                int? orphanedIconFileId = null;

                page.IconCssClass = tbIconCssClass.Text;

                page.PageDisplayTitle = cbPageTitle.Checked;
                page.PageDisplayBreadCrumb = cbPageBreadCrumb.Checked;
                page.PageDisplayIcon = cbPageIcon.Checked;
                page.PageDisplayDescription = cbPageDescription.Checked;

                page.DisplayInNavWhen = (DisplayInNavWhen)Enum.Parse( typeof( DisplayInNavWhen ), ddlMenuWhen.SelectedValue );
                page.MenuDisplayDescription = cbMenuDescription.Checked;
                page.MenuDisplayIcon = cbMenuIcon.Checked;
                page.MenuDisplayChildPages = cbMenuChildPages.Checked;

                page.BreadCrumbDisplayName = cbBreadCrumbName.Checked;
                page.BreadCrumbDisplayIcon = cbBreadCrumbIcon.Checked;

                page.RequiresEncryption = cbRequiresEncryption.Checked;
                page.EnableViewState = cbEnableViewState.Checked;
                page.IncludeAdminFooter = cbIncludeAdminFooter.Checked;
                page.OutputCacheDuration = int.Parse( tbCacheDuration.Text );
                page.Description = tbDescription.Text;
                page.HeaderContent = ceHeaderContent.Text;

                // new or updated route
                foreach ( var pageRoute in page.PageRoutes.ToList() )
                {
                    var existingRoute = RouteTable.Routes.OfType<Route>().FirstOrDefault( a => a.RouteId() == pageRoute.Id );
                    if ( existingRoute != null )
                    {
                        RouteTable.Routes.Remove( existingRoute );
                    }

                    routeService.Delete( pageRoute );
                }

                page.PageRoutes.Clear();

                foreach ( string route in tbPageRoute.Text.SplitDelimitedValues() )
                {
                    var pageRoute = new PageRoute();
                    pageRoute.Route = route.TrimStart( new char[] { '/' } );
                    pageRoute.Guid = Guid.NewGuid();
                    page.PageRoutes.Add( pageRoute );
                }

                foreach ( var pageContext in page.PageContexts.ToList() )
                {
                    contextService.Delete( pageContext );
                }

                page.PageContexts.Clear();
                foreach ( var control in phContext.Controls )
                {
                    if ( control is RockTextBox )
                    {
                        var tbContext = control as RockTextBox;
                        if ( !string.IsNullOrWhiteSpace( tbContext.Text ) )
                        {
                            var pageContext = new PageContext();
                            pageContext.Entity = tbContext.ID.Substring( 8 ).Replace( '_', '.' );
                            pageContext.IdParameter = tbContext.Text;
                            page.PageContexts.Add( pageContext );
                        }
                    }
                }

                if ( page.IsValid )
                {
                    rockContext.SaveChanges();

                    foreach ( var pageRoute in new PageRouteService( rockContext ).GetByPageId( page.Id ) )
                    {
                        RouteTable.Routes.AddPageRoute( pageRoute );
                    }

                    if ( orphanedIconFileId.HasValue )
                    {
                        BinaryFileService binaryFileService = new BinaryFileService( rockContext );
                        var binaryFile = binaryFileService.Get( orphanedIconFileId.Value );
                        if ( binaryFile != null )
                        {
                            // marked the old images as IsTemporary so they will get cleaned up later
                            binaryFile.IsTemporary = true;
                            rockContext.SaveChanges();
                        }
                    }

                    Rock.Web.Cache.PageCache.Flush( page.Id );

                    string script = "if (typeof window.parent.Rock.controls.modal.close === 'function') window.parent.Rock.controls.modal.close('PAGE_UPDATED');";
                    ScriptManager.RegisterStartupScript( this.Page, this.GetType(), "close-modal", script, true );
                }

            }
        }
Exemple #12
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtPactNum.Text.Trim() == "")
                {
                    Alert.ShowInTop("合同编号不能为空!");
                    txtPactNum.Reset();
                    return;
                }
                if (txtPactType.Text.Trim() == "")
                {
                    Alert.ShowInTop("合同类别不能为空!");
                    txtPactType.Reset();
                    return;
                }
                if (DatePicker_StartTime.SelectedDate > DatePicker_EndTime.SelectedDate)
                {
                    Alert.ShowInTop("结束日期应该大于开始日期!");
                    return;
                }
                NewPact.EndTime        = DatePicker_EndTime.SelectedDate;
                NewPact.EntryPerson    = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                NewPact.PactNum        = txtPactNum.Text;
                NewPact.PactType       = txtPactType.Text;
                NewPact.ProjectID      = BLLProject.SelectProjectID(DropDownList_Project.SelectedText);
                NewPact.SecrecyLevel   = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue);
                NewPact.StartTime      = DatePicker_StartTime.SelectedDate;
                NewPact.PactName       = txtPactName.Text;
                NewPact.ChargePerson   = txtChargePerson.Text;
                NewPact.PactMoney      = txtPactMoney.Text;
                NewPact.RealMoney      = txtRealMoney.Text;
                NewPact.PactCompletion = txtPactCompletion.Text;
                NewPact.IsExistingFile = txtIsExistingFile.Text;
                NewPact.FileNum        = txtFileNum.Text;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    NewPact.IsPass = true;
                }
                else
                {
                    NewPact.IsPass = false;
                }
                int AttachID = pm.UpLoadFile(fileupload).Attachid;
                switch (AttachID)
                {
                case -1:
                    Alert.ShowInTop("文件类型不符,请重新选择!");
                    return;

                case 0:
                    Alert.ShowInTop("文件名已经存在!");
                    return;

                case -2:
                    Alert.ShowInTop("文件不能大于150M");
                    return;

                case -3:
                    NewPact.AttachmentID = null;
                    break;

                //Alert.ShowInTop("请上传附件");
                //return;
                default:
                    NewPact.AttachmentID = AttachID;
                    break;
                }

                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    NewPact.IsPass = false;
                }
                else
                {
                    NewPact.IsPass = true;
                }

                //向合同档案表中插入数据
                BLLPact.Insert(NewPact);

                //向操作日志表中插入数据
                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    operationLog.LoginIP          = " ";
                    operationLog.LoginName        = Session["LoginName"].ToString();
                    operationLog.OperationType    = "添加";
                    operationLog.OperationContent = "Pact";
                    operationLog.OperationTime    = DateTime.Now;
                    operationLog.OperationDataID  = NewPact.PactID;
                    BLLOp.Insert(operationLog);
                    Alert.ShowInTop("您的数据已提交,请等待确认!");
                }
                else
                {
                    Alert.ShowInTop("保存成功!");
                }
                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
            }
            catch (Exception ex)
            {
                int PactID = Convert.ToInt32(NewPact.AttachmentID);
                //删除资料附件
                int    AttactID = BLLPact.FindAttachmentID(PactID);
                string strPath;
                if (AttactID != 0)
                {
                    strPath = BLLattachment.FindPath(AttactID);
                    if (strPath != "")
                    {
                        //在附件表中删除附件数据
                        BLLattachment.Delete(AttactID);
                        //删除附件文件
                        pm.DeleteFile(AttactID, strPath);
                    }
                }
                //BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Exemple #13
0
        protected void ForumRegister_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                string newEmail    = Email.Text.Trim();
                string newUsername = UserName.Text.Trim();

                if (!General.IsValidEmail(newEmail))
                {
                    PageContext.AddLoadMessage("You have entered an illegal e-mail address.");
                    return;
                }

                if (UserMembershipHelper.UserExists(UserName.Text.Trim(), newEmail))
                {
                    PageContext.AddLoadMessage("Username or email are already registered.");
                    return;
                }

                string hashinput = DateTime.Now.ToString() + newEmail + Security.CreatePassword(20);
                string hash      = FormsAuthentication.HashPasswordForStoringInConfigFile(hashinput, "md5");

                MembershipCreateStatus status;
                MembershipUser         user = Membership.CreateUser(newUsername, Password.Text.Trim(), newEmail, Question.Text.Trim(), Answer.Text.Trim(), !PageContext.BoardSettings.EmailVerification, out status);

                if (status != MembershipCreateStatus.Success)
                {
                    // error of some kind
                    PageContext.AddLoadMessage("Membership Error Creating User: "******"VERIFYEMAIL");

                    verifyEmail.TemplateParams ["{link}"]      = String.Format("{1}{0}", YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.approve, "k={0}", hash), YAF.Classes.Utils.YafForumInfo.ServerURL);
                    verifyEmail.TemplateParams ["{key}"]       = hash;
                    verifyEmail.TemplateParams ["{forumname}"] = PageContext.BoardSettings.Name;
                    verifyEmail.TemplateParams ["{forumlink}"] = String.Format("{0}", ForumURL);

                    string subject = String.Format(PageContext.Localization.GetText("COMMON", "EMAILVERIFICATION_SUBJECT"), PageContext.BoardSettings.Name);

                    verifyEmail.SendEmail(new System.Net.Mail.MailAddress(newEmail, newUsername), subject, true);
                }

                // success
                PageContext.AddLoadMessage(string.Format("User {0} Created Successfully.", UserName.Text.Trim()));
                YAF.Classes.Utils.YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.admin_reguser);
            }
        }
Exemple #14
0
        private static Hash CreatePageData(SiteContext context, PageContext pageContext)
        {
            var title = string.IsNullOrWhiteSpace(pageContext.Title) ? context.Title : pageContext.Title;

            return Hash.FromAnonymousObject(new { page = new { title }, content = pageContext.Content });
        }
 protected void btnRemoveCnblogs2_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(TabStrip1.GetRemoveTabReference("dynamic_tab_Cnblogs2"));
 }
Exemple #16
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (UserInfoName.Text.Trim() != "")
         {
             if (bllUser.IsUser(UserInfoName.Text.Trim()) != null)
             {
                 if (bllUser.IsUser(UserInfoName.Text.Trim()).IsPass == true)
                 {
                     if (TitleName.Text.Trim() == "")
                     {
                         Alert.ShowInTop("称号名称不能为空!");
                         TitleName.Text = "";
                         return;
                     }
                     if (GivDivision.Text.Trim() == "")
                     {
                         Alert.ShowInTop("授予部门不能为空!");
                         GivDivision.Text = "";
                         return;
                     }
                     Common.Entities.Honor honor = new Common.Entities.Honor();
                     honor.UserInfoID   = bllUser.FindID(UserInfoName.Text.Trim());
                     honor.TitleName    = TitleName.Text.Trim();
                     honor.Sort         = DropDownListSort.SelectedItem.Text;
                     honor.Remark       = Remark.Text.Trim();
                     honor.GiveTime     = DatePickerGiveTime.SelectedDate;
                     honor.GivDivision  = GivDivision.Text.Trim();
                     honor.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1;
                     honor.EntryPerson  = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                     if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                     {
                         honor.IsPass = false;
                         bllHonor.InsertForPeople(honor);//插入荣誉称号表
                         OperationLog operate = new OperationLog();
                         operate.LoginName        = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                         operate.LoginIP          = "";
                         operate.OperationType    = "添加";
                         operate.OperationContent = "Honor";
                         operate.OperationDataID  = honor.HonorID;
                         operate.OperationTime    = System.DateTime.Now;
                         operate.Remark           = "";
                         bllOperate.Insert(operate);//插入操作表
                         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员荣誉称号信息已提交审核!"));
                     }
                     else
                     {
                         honor.IsPass = true;
                         bllHonor.InsertForPeople(honor);//插入荣誉称号表
                         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员荣誉称号信息已添加完成!"));
                     }
                 }
                 else
                 {
                     Alert.ShowInTop("该人员正在审核中!");
                 }
             }
             else
             {
                 Alert.ShowInTop("人员不存在!");
                 UserInfoName.Text = "";
             }
         }
         else
         {
             Alert.ShowInTop("人员名称不能为空!");
             UserInfoName.Text = "";
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
    /// <summary>
    /// Creates a menu item for the specified insight, and returns it.
    /// </summary>
    /// <param name="insight">The insight details.</param>
    /// <param name="context">Information that this page requires to display content.</param>
    /// <returns>A menu item for the specified insight.</returns>
    private TreeNode CreateMenuItem(Insight insight, PageContext context)
    {
        TreeNode node = new TreeNode
        {
            Text = String.Format("<span id='node_{0}' class='ContentTreeItem' name='treeNode'>{2}<span class='Name'>{1}</span></span>", insight.CodeName.Replace('.', '_'), HTMLHelper.HTMLEncode(insight.DisplayName), UIHelper.GetAccessibleIconTag("icon-piechart", size: FontIconSizeEnum.Standard)),
            NavigateUrl = String.Format("~/CMSModules/SocialMarketing/Pages/InsightsReport.aspx?reportCodeNames={0}&periodType={1}&externalId={2}", URLHelper.URLEncode(GetReportCodeNames(insight, context)), insight.PeriodType, context.ExternalId),
            Target = treeElem.TargetFrame
        };

        return node;
    }
Exemple #18
0
 protected void btn_return_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
 }
Exemple #19
0
        protected internal virtual IHtmlString RenderView(ViewPosition viewPosition)
        {
            Func <IHtmlString> renderView = () => this.RenderView(viewPosition.ViewName, PageContext.GetPositionViewData(viewPosition.PagePositionId), viewPosition.ToParameterDictionary(), false);

            if (viewPosition.EnabledCache)
            {
                var cacheKey = string.Format("View OutputCache - Full page name:{0};Raw request url:{1};PagePositionId:{2};ViewName:{3};LayoutPositionId:{4}"
                                             , PageContext.PageRequestContext.Page.FullName, PageContext.ControllerContext.HttpContext.Request.RawUrl, viewPosition.PagePositionId, viewPosition.ViewName, viewPosition.LayoutPositionId);
                var cacheItemPolicy = viewPosition.OutputCache.ToCachePolicy();
                return(this.PageContext.PageRequestContext.Site.ObjectCache().GetCache <IHtmlString>(cacheKey,
                                                                                                     renderView,
                                                                                                     cacheItemPolicy));
            }

            else
            {
                return(renderView());
            }
        }
Exemple #20
0
        protected void btn_confirm_Click(object sender, EventArgs e)
        {
            try
            {
                if (Grid3.Rows.Count > 0 || Grid1.SelectedRowIndexArray.Length > 0)
                {
                    //插入自定义流程主表
                    string sqlCmd = "insert into OA_sys_flow (flowFounder,createTime,isUsed) values ";
                    sqlCmd += " ('" + GetUser() + "','" + DateTime.Now + "','2')";
                    string flowId = "";
                    if (SqlSel.ExeSql(sqlCmd) == 1)
                    {
                        StringBuilder flowInfo = new StringBuilder();
                        sqlCmd = "select max(id) from OA_sys_flow";
                        flowId = SqlSel.GetSqlScale(sqlCmd).ToString();

                        if (Grid3.Rows.Count > 0)
                        {
                            if (rdbtn_flowType.SelectedValue == "1")
                            {
                                flowInfo.Append("[串行]");
                                for (int i = 0; i < Grid3.Rows.Count; i++)
                                {
                                    sqlCmd = "insert into OA_Sys_Flow_Step (flowId,stepOrderNo) values('" + flowId + "','" + (i + 1) + "')";
                                    SqlSel.ExeSql(sqlCmd);
                                    sqlCmd = "select max(id) from OA_Sys_Flow_Step";
                                    string    stepId   = SqlSel.GetSqlScale(sqlCmd).ToString();
                                    string    userId   = Grid3.DataKeys[i][0].ToString();
                                    DataTable userInfo = getUserInfo(userId);
                                    sqlCmd = "insert into OA_Sys_Step_Emp (stepId,deptId,dutyId) values ('" + stepId + "','" + userInfo.Rows[0]["deptId"].ToString() + "','" + userInfo.Rows[0]["dutyId"].ToString() + "')";
                                    SqlSel.ExeSql(sqlCmd);
                                    flowInfo.AppendFormat("{0};", Grid3.Rows[i].Values[0].ToString());
                                }
                            }
                            if (rdbtn_flowType.SelectedValue == "2")
                            {
                                flowInfo.Append("[并行]");
                                sqlCmd = "insert into OA_Sys_Flow_Step (flowId,stepOrderNo) values('" + flowId + "','1')";
                                SqlSel.ExeSql(sqlCmd);
                                sqlCmd = "select max(id) from OA_Sys_Flow_Step";
                                string stepId = SqlSel.GetSqlScale(sqlCmd).ToString();
                                for (int i = 0; i < Grid3.Rows.Count; i++)
                                {
                                    string    userId   = Grid3.DataKeys[i][0].ToString();
                                    DataTable userInfo = getUserInfo(userId);
                                    sqlCmd = "insert into OA_Sys_Step_Emp (stepId,deptId,dutyId) values ('" + stepId + "','" + userInfo.Rows[0]["deptId"].ToString() + "','" + userInfo.Rows[0]["dutyId"].ToString() + "')";
                                    SqlSel.ExeSql(sqlCmd);
                                    flowInfo.AppendFormat("{0};", Grid3.Rows[i].Values[0].ToString());
                                }
                            }
                        }
                        else
                        {
                            if (Grid1.SelectedRowIndexArray.Length > 0)
                            {
                                if (rdbtn_flowType.SelectedValue == "1")
                                {
                                    flowInfo.Append("[串行]");
                                    int[] selections = Grid1.SelectedRowIndexArray;
                                    foreach (int rowIndex in selections)
                                    {
                                        sqlCmd = "insert into OA_Sys_Flow_Step (flowId,stepOrderNo) values('" + flowId + "','" + (rowIndex + 1) + "')";
                                        SqlSel.ExeSql(sqlCmd);
                                        sqlCmd = "select max(id) from OA_Sys_Flow_Step";
                                        string    stepId   = SqlSel.GetSqlScale(sqlCmd).ToString();
                                        string    userId   = Grid1.DataKeys[rowIndex][0].ToString();
                                        DataTable userInfo = getUserInfo(userId);
                                        sqlCmd = "insert into OA_Sys_Step_Emp (stepId,deptId,dutyId) values ('" + stepId + "','" + userInfo.Rows[0]["deptId"].ToString() + "','" + userInfo.Rows[0]["dutyId"].ToString() + "')";
                                        SqlSel.ExeSql(sqlCmd);
                                        flowInfo.AppendFormat("{0};", Grid1.Rows[rowIndex].Values[1].ToString());
                                    }
                                }
                                if (rdbtn_flowType.SelectedValue == "2")
                                {
                                    flowInfo.Append("[并行]");
                                    sqlCmd = "insert into OA_Sys_Flow_Step (flowId,stepOrderNo) values('" + flowId + "','1')";
                                    SqlSel.ExeSql(sqlCmd);
                                    sqlCmd = "select max(id) from OA_Sys_Flow_Step";
                                    string stepId     = SqlSel.GetSqlScale(sqlCmd).ToString();
                                    int[]  selections = Grid1.SelectedRowIndexArray;
                                    foreach (int rowIndex in selections)
                                    {
                                        string    userId   = Grid1.DataKeys[rowIndex][0].ToString();
                                        DataTable userInfo = getUserInfo(userId);
                                        sqlCmd = "insert into OA_Sys_Step_Emp (stepId,deptId,dutyId) values ('" + stepId + "','" + userInfo.Rows[0]["deptId"].ToString() + "','" + userInfo.Rows[0]["dutyId"].ToString() + "')";
                                        SqlSel.ExeSql(sqlCmd);
                                        flowInfo.AppendFormat("{0};", Grid1.Rows[rowIndex].Values[1].ToString());
                                    }
                                }
                            }
                        }
                        Alert.Show("流程添加成功!");
                        PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(flowInfo.ToString(), flowId) + ActiveWindow.GetHideReference());
                    }
                }
                else
                {
                    Alert.ShowInTop("未添加任何审批人员!");
                    return;
                }
            }
            catch (Exception ex)
            {
                Alert.ShowInTop(ex.Message);
            }
        }
Exemple #21
0
        /// <summary>
        /// 将Dataset的数据导入数据库
        /// </summary>
        /// <param name="pds">数据集</param>
        /// <param name="Cols">数据集列数</param>
        /// <returns></returns>
        private bool AddDatasetToSQL(DataTable pds, int Cols)
        {
            int ic, ir;

            reports.Clear();
            ic = pds.Columns.Count;
            if (ic < Cols)
            {
                ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
            }

            ir = pds.Rows.Count;
            if (pds != null && ir > 0)
            {
                var units = from x in Funs.DB.Base_Unit where x.IsHide == false || !x.IsHide.HasValue select x;
                for (int i = 0; i < ir; i++)
                {
                    Model.View_Information_DrillPlanHalfYearReportItem report = new Model.View_Information_DrillPlanHalfYearReportItem();
                    string row1 = pds.Rows[i][0].ToString().Trim();
                    string row2 = pds.Rows[i][1].ToString().Trim();
                    string row3 = pds.Rows[i][2].ToString().Trim();
                    string row4 = pds.Rows[i][3].ToString().Trim();
                    string row5 = pds.Rows[i][4].ToString().Trim();
                    string row6 = pds.Rows[i][5].ToString().Trim();
                    string row7 = pds.Rows[i][6].ToString().Trim();
                    string row8 = pds.Rows[i][7].ToString().Trim();
                    string row9 = pds.Rows[i][8].ToString().Trim();

                    if (!string.IsNullOrEmpty(row1))
                    {
                        var unit = units.FirstOrDefault(x => x.UnitName == row1.Trim());
                        if (unit != null)
                        {
                            report.UnitId = unit.UnitId;
                        }
                    }

                    if (!string.IsNullOrEmpty(row2))
                    {
                        report.YearId = Convert.ToInt32(row2);
                    }
                    if (!string.IsNullOrEmpty(row3))
                    {
                        report.HalfYearId = Convert.ToInt32(row3);
                    }
                    report.Telephone        = row4;
                    report.DrillPlanName    = row5;
                    report.OrganizationUnit = row6;
                    report.DrillPlanDate    = row7;
                    report.AccidentScene    = row8;
                    report.ExerciseWay      = row9;

                    if (reports.Where(e => e.DrillPlanHalfYearReportItemId == report.DrillPlanHalfYearReportItemId).FirstOrDefault() == null)
                    {
                        report.DrillPlanHalfYearReportItemId = SQLHelper.GetNewID(typeof(Model.View_Information_DrillPlanHalfYearReportItem));
                        reports.Add(report);
                    }
                }
                Session["reports"] = reports;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
            }
            return(true);
        }
 /// <summary>
 /// 下载模板按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnDownLoad_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
 }
 protected void btnSaveClose_Click(object sender, EventArgs e)
 {
     SaveItem();
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            string          Mode = Request.QueryString["Mode"].ToString();
            OperationResult objOperationResult = new OperationResult();

            if (Mode == "New")
            {
                // Create the entity
                groupoccupationDto objEntity = new groupoccupationDto();

                // Populate the entity
                objEntity.v_LocationId = ddlLocation.SelectedValue.ToString();
                objEntity.v_Name       = txtSede.Text;

                // Save the data
                oOrganizationBL.AddGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());

                if (txtSede2.Text.Trim() != "")
                {
                    objEntity = new groupoccupationDto();

                    // Populate the entity
                    objEntity.v_LocationId = ddlLocation.SelectedValue.ToString();
                    objEntity.v_Name       = txtSede2.Text;

                    // Save the data
                    oOrganizationBL.AddGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }

                if (txtSede3.Text.Trim() != "")
                {
                    objEntity = new groupoccupationDto();

                    // Populate the entity
                    objEntity.v_LocationId = ddlLocation.SelectedValue.ToString();
                    objEntity.v_Name       = txtSede3.Text;

                    // Save the data
                    oOrganizationBL.AddGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }

                if (txtSede4.Text.Trim() != "")
                {
                    objEntity = new groupoccupationDto();

                    // Populate the entity
                    objEntity.v_LocationId = ddlLocation.SelectedValue.ToString();
                    objEntity.v_Name       = txtSede4.Text;

                    // Save the data
                    oOrganizationBL.AddGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }

                if (txtSede5.Text.Trim() != "")
                {
                    objEntity = new groupoccupationDto();

                    // Populate the entity
                    objEntity.v_LocationId = ddlLocation.SelectedValue.ToString();
                    objEntity.v_Name       = txtSede5.Text;

                    // Save the data
                    oOrganizationBL.AddGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
                }
            }
            else if (Mode == "Edit")
            {
                groupoccupationDto objEntity = new groupoccupationDto();

                // Populate the entity
                objEntity.v_GroupOccupationId = Session["v_GroupOccupationId"].ToString();
                objEntity.v_LocationId        = Session["v_LocationId"].ToString();
                objEntity.v_Name = txtSede.Text;
                oOrganizationBL.UpdateGroupOccupation(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList());
            }

            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
        private void ParsePollContext(PageContext context)
        {
            var pollId = context.GetTokenValue("PollId");

            ContextItem contextItem = null;
            if (pollId != null)
            {
                var id = Guid.Parse(pollId.ToString());
                var poll = PublicApi.Polls.Get(id);
                if (poll != null && !poll.HasErrors())
                    contextItem = BuildPollContextItem(poll);
            }

            if (contextItem != null)
                context.ContextItems.Put(contextItem);
        }
Exemple #26
0
        private async Task RenderLayoutAsync(
            PageContext context,
            ViewBufferTextWriter bodyWriter)
        {
            // A layout page can specify another layout page. We'll need to continue
            // looking for layout pages until they're no longer specified.
            var previousPage    = razorPage;
            var renderedLayouts = new List <TemplatePage>();

            // This loop will execute Layout pages from the inside to the outside. With each
            // iteration, bodyWriter is replaced with the aggregate of all the "body" content
            // (including the layout page we just rendered).
            while (!string.IsNullOrEmpty(previousPage.Layout))
            {
                if (!bodyWriter.IsBuffering)
                {
                    // Once a call to RazorPage.FlushAsync is made, we can no longer render Layout pages - content has
                    // already been written to the client and the layout content would be appended rather than surround
                    // the body content. Throwing this exception wouldn't return a 500 (since content has already been
                    // written), but a diagnostic component should be able to capture it.

                    throw new InvalidOperationException("Layout cannot be rendered");
                }

                TemplatePage layoutPage = GetLayoutPage(previousPage.Layout);

                if (renderedLayouts.Count > 0 &&
                    renderedLayouts.Any(l => string.Equals(l.Path, layoutPage.Path, StringComparison.Ordinal)))
                {
                    // If the layout has been previously rendered as part of this view, we're potentially in a layout
                    // rendering cycle.
                    throw new InvalidOperationException("Layout has circular reference");
                }

                // Notify the previous page that any writes that are performed on it are part of sections being written
                // in the layout.
                previousPage.IsLayoutBeingRendered = true;
                layoutPage.PreviousSectionWriters  = previousPage.SectionWriters;
                layoutPage.BodyContent             = bodyWriter.Buffer;
                bodyWriter = await RenderPageAsync(layoutPage, context, invokeViewStarts : false);

                renderedLayouts.Add(layoutPage);
                previousPage = layoutPage;
            }

            // Now we've reached and rendered the outer-most layout page. Nothing left to execute.

            // Ensure all defined sections were rendered or RenderBody was invoked for page without defined sections.
            foreach (var layoutPage in renderedLayouts)
            {
                layoutPage.EnsureRenderedBodyOrSections();
            }

            if (bodyWriter.IsBuffering)
            {
                // If IsBuffering - then we've got a bunch of content in the view buffer. How to best deal with it
                // really depends on whether or not we're writing directly to the output or if we're writing to
                // another buffer.
                var viewBufferTextWriter = context.Writer as ViewBufferTextWriter;
                if (viewBufferTextWriter == null || !viewBufferTextWriter.IsBuffering)
                {
                    // This means we're writing to a 'real' writer, probably to the actual output stream.
                    // We're using PagedBufferedTextWriter here to 'smooth' synchronous writes of IHtmlContent values.
                    using (var writer = _bufferScope.CreateWriter(context.Writer))
                    {
                        await bodyWriter.Buffer.WriteToAsync(writer, _htmlEncoder);
                    }
                }
                else
                {
                    // This means we're writing to another buffer. Use MoveTo to combine them.
                    bodyWriter.Buffer.MoveTo(viewBufferTextWriter.Buffer);
                    return;
                }
            }
        }
    /// <summary>
    /// Creates a list of report code names for the specified insight that is compatible with the Web analytics module, and returns it.
    /// </summary>
    /// <param name="insight">The insight details.</param>
    /// <param name="context">Information that this page requires to display content.</param>
    /// <returns>A list of report code names for the specified insight that is compatible with the Web analytics module.</returns>
    private string GetReportCodeNames(Insight insight, PageContext context)
    {
        StringBuilder builder = new StringBuilder();
        foreach (string reportType in mReportTypes)
        {
            if (builder.Length > 0)
            {
                builder.Append(';');
            }
            builder.AppendFormat(context.ReportNameFormat, insight.CodeName, insight.PeriodType, reportType);
        }

        return builder.ToString();
    }
Exemple #28
0
 private Task RenderPageCoreAsync(TemplatePage page, PageContext context)
 {
     page.PageContext = context;
     page.PageLookup  = this.pageLookup;
     return(page.ExecuteAsync());
 }
        /// <summary>
        /// 将Dataset的数据导入数据库
        /// </summary>
        /// <param name="pds">数据集</param>
        /// <param name="Cols">数据集行数</param>
        /// <returns></returns>
        private bool AddDatasetToSQL(DataTable pds)
        {
            string results = string.Empty;
            int    ir      = pds.Rows.Count;

            if (pds != null && ir > 0)
            {
                var getCheckWork = BLL.Check_CheckWorkService.GetCheckWorkByCheckWorkId(this.CheckWorkId);
                if (getCheckWork != null)
                {
                    var units     = from x in Funs.DB.Base_Unit select x;
                    var sysConsts = from x in Funs.DB.Sys_Const
                                    where x.GroupId == BLL.ConstValue.Group_HandleStep
                                    select x;
                    var supCheckSets = from x in Funs.DB.Check_ProjectCheckItemSet
                                       where x.ProjectId == this.CurrUser.LoginProjectId && x.SupCheckItem == "0" && x.CheckType == "4"
                                       select x;
                    for (int i = 0; i < ir; i++)
                    {
                        string result = string.Empty;
                        string col0   = pds.Rows[i][0].ToString().Trim();
                        string col1   = pds.Rows[i][1].ToString().Trim();
                        string col2   = pds.Rows[i][2].ToString().Trim();
                        string col3   = pds.Rows[i][3].ToString().Trim();
                        string col4   = pds.Rows[i][4].ToString().Trim();
                        string col5   = pds.Rows[i][5].ToString().Trim();

                        if (!string.IsNullOrEmpty(col0) || !string.IsNullOrEmpty(col1))
                        {
                            Model.View_Check_CheckWorkDetail newViewDetail = new Model.View_Check_CheckWorkDetail
                            {
                                CheckWorkDetailId = SQLHelper.GetNewID(typeof(Model.View_EduTrain_TrainRecordDetail)),
                                CheckWorkId       = getCheckWork.CheckWorkId,
                                CheckContent      = col1,
                                CheckResult       = col2,
                                CheckOpinion      = col3,
                                HandleResult      = col4,
                                CheckStation      = col5,
                            };

                            var checkName = supCheckSets.FirstOrDefault(x => x.CheckItemName == col0);
                            if (checkName != null)
                            {
                                newViewDetail.CheckItem    = checkName.CheckItemSetId;
                                newViewDetail.CheckItemStr = checkName.CheckItemName;
                            }
                            else
                            {
                                result += "第" + (i + 2).ToString() + "行," + "项目检查项中不存在!" + "|";
                            }

                            ///判断是否已存在
                            var addItem = Funs.DB.Check_CheckWorkDetail.FirstOrDefault(x => x.CheckWorkId == newViewDetail.CheckWorkId && x.CheckContent == newViewDetail.CheckContent &&
                                                                                       x.CheckItem == newViewDetail.CheckItem);
                            if (addItem == null)
                            {
                                if (string.IsNullOrEmpty(result))
                                {
                                    Model.Check_CheckWorkDetail newDetail = new Model.Check_CheckWorkDetail
                                    {
                                        CheckWorkDetailId = newViewDetail.CheckWorkDetailId,
                                        CheckWorkId       = newViewDetail.CheckWorkId,
                                        CheckItem         = newViewDetail.CheckItem,
                                        CheckContent      = newViewDetail.CheckContent,
                                        CheckResult       = newViewDetail.CheckResult,

                                        CheckOpinion = newViewDetail.CheckOpinion,
                                        CheckStation = newViewDetail.CheckStation,
                                        HandleResult = newViewDetail.HandleResult,
                                    };

                                    BLL.Check_CheckWorkDetailService.AddCheckWorkDetail(newDetail);
                                    ///加入
                                    viewDetails.Add(newViewDetail);
                                }
                            }
                            else
                            {
                                result += "第" + (i + 2).ToString() + "行," + "导入数据重复" + "|";
                            }


                            if (!string.IsNullOrEmpty(result))
                            {
                                results += result;
                            }
                        }
                    }
                    if (viewDetails.Count > 0)
                    {
                        viewDetails           = viewDetails.Distinct().ToList();
                        this.Grid1.Hidden     = false;
                        this.Grid1.DataSource = viewDetails;
                        this.Grid1.DataBind();
                    }

                    if (!string.IsNullOrEmpty(results))
                    {
                        viewDetails.Clear();
                        results    = "数据导入完成,未成功数据:" + results.Substring(0, results.LastIndexOf("|"));
                        errorInfos = results;
                        Alert alert = new Alert
                        {
                            Message = results,
                            Target  = Target.Self
                        };
                        alert.Show();
                    }
                    else
                    {
                        errorInfos = string.Empty;
                        ShowNotify("导入成功!", MessageBoxIcon.Success);
                        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    }
                }
                else
                {
                    Alert.ShowInTop("培训数据为空!", MessageBoxIcon.Warning);
                }
            }
            else
            {
                Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
            }

            BLL.UploadFileService.DeleteFile(Funs.RootPath, initPath + this.hdFileName.Text);
            return(true);
        }
 public void btnReturn_Click(object sender, EventArgs e)
 {
     PageContext.Redirect("~/Inventory/WHOutBoundOrderManage.aspx");
 }
Exemple #31
0
 //取消
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
 /// <summary>
 /// 返回订单列表页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btnReturn_Click(object sender, EventArgs e)
 {
     //返回订单列表页面
     PageContext.Redirect("~/Contract/FH/ContractOrderManage.aspx");
 }
Exemple #33
0
 private static ValueTask SyncDisposeAsync(PageContext context, object page)
 {
     Dispose(context, page);
     return(default);
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.JobKindListModel jobKindListModel = new zlzw.Model.JobKindListModel();
                jobKindListModel.JobKindName     = txbNJobKindName.Text;
                jobKindListModel.JobKindGUID     = new Guid(ViewState["JobKindGUID"].ToString());
                jobKindListModel.JobCategoryGUID = new Guid(drpJobCategory.SelectedValue);
                jobKindListModel.IsEnable        = 1;
                if (ckbIsHot.Checked)
                {
                    jobKindListModel.IsHot = 1;
                }
                else
                {
                    jobKindListModel.IsHot = 0;
                }
                if (ckbIsShowDefaultPage.Checked)
                {
                    jobKindListModel.IsShowDefaultPage = 1;
                }
                else
                {
                    jobKindListModel.IsShowDefaultPage = 0;
                }
                jobKindListModel.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString());
                jobKindListModel.JobKindID   = int.Parse(Get_JobKindID(Request.QueryString["value"]));
                zlzw.BLL.JobKindListBLL jobKindListBLL = new zlzw.BLL.JobKindListBLL();
                jobKindListBLL.Update(jobKindListModel);
            }
            else
            {
                //添加保存

                zlzw.Model.JobKindListModel jobKindListModel = new zlzw.Model.JobKindListModel();
                jobKindListModel.JobKindName     = txbNJobKindName.Text;
                jobKindListModel.JobKindGUID     = Guid.NewGuid();
                jobKindListModel.JobCategoryGUID = new Guid(drpJobCategory.SelectedValue);
                jobKindListModel.IsEnable        = 1;
                if (ckbIsHot.Checked)
                {
                    jobKindListModel.IsHot = 1;
                }
                else
                {
                    jobKindListModel.IsHot = 0;
                }
                if (ckbIsShowDefaultPage.Checked)
                {
                    jobKindListModel.IsShowDefaultPage = 1;
                }
                else
                {
                    jobKindListModel.IsShowDefaultPage = 0;
                }
                jobKindListModel.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

                zlzw.BLL.JobKindListBLL jobKindListBLL = new zlzw.BLL.JobKindListBLL();
                jobKindListBLL.Add(jobKindListModel);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }
        private void ParseUserContext(PageContext context)
        {
            var userName = context.GetTokenValue("UserName");
            ContextItem contextItem = null;

            if (userName != null)
            {
                var user = TEApi.Users.Get(new UsersGetOptions() { Username = userName.ToString() });
                if (user != null)
                    contextItem = BuildUserContextItem(user);
                else
                    Globals.RedirectToLoginOrThrowException(Telligent.Evolution.Components.CSExceptionType.UserNotFound);
            }

            if (contextItem != null)
                context.ContextItems.Put(contextItem);
        }
Exemple #36
0
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (ItemSelectedList.Count() > 0)
     {
         foreach (var item in ItemSelectedList)
         {
             Model.Law_ManageRule rule = BLL.ManageRuleService.GetManageRuleById(item);
             if (rule != null)
             {
                 string newKeyID = SQLHelper.GetNewID(typeof(Model.ActionPlan_ManagerRule));
                 Model.ActionPlan_ManagerRule newManagerRule = new Model.ActionPlan_ManagerRule
                 {
                     ManagerRuleId    = newKeyID,
                     OldManageRuleId  = rule.ManageRuleId,
                     ProjectId        = this.CurrUser.LoginProjectId,
                     ManageRuleName   = rule.ManageRuleName,
                     ManageRuleTypeId = rule.ManageRuleTypeId,
                     CompileDate      = DateTime.Now,
                     Remark           = rule.Remark,
                     CompileMan       = this.CurrUser.UserId,
                     IsIssue          = false,
                     Flag             = true,
                     State            = BLL.Const.State_0,
                     AttachUrl        = rule.AttachUrl,
                     SeeFile          = rule.SeeFile
                 };
                 BLL.ActionPlan_ManagerRuleService.AddManageRule(newManagerRule);
                 ////保存流程审核数据
                 this.ctlAuditFlow.btnSaveData(this.CurrUser.LoginProjectId, BLL.Const.ActionPlan_ManagerRuleMenuId, newManagerRule.ManagerRuleId, true, newManagerRule.ManageRuleName, "../ActionPlan/ManagerRuleView.aspx?ManagerRuleId={0}");
                 Model.SUBHSSEDB  db         = Funs.DB;
                 Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(x => x.ToKeyId == item);
                 if (attachFile != null)
                 {
                     Model.AttachFile newAttachFile = new Model.AttachFile
                     {
                         AttachFileId = SQLHelper.GetNewID(typeof(Model.AttachFile)),
                         ToKeyId      = newKeyID
                     };
                     string[] urls = attachFile.AttachUrl.Split(',');
                     foreach (string url in urls)
                     {
                         string urlStr = BLL.Funs.RootPath + url;
                         if (File.Exists(urlStr))
                         {
                             string newUrl = urlStr.Replace("ManageRule", "ActionPlanManagerRule");
                             if (!Directory.Exists(newUrl.Substring(0, newUrl.LastIndexOf("\\"))))
                             {
                                 Directory.CreateDirectory(newUrl.Substring(0, newUrl.LastIndexOf("\\")));
                             }
                             if (!File.Exists(newUrl))
                             {
                                 File.Copy(urlStr, newUrl);
                             }
                         }
                     }
                     newAttachFile.AttachSource = attachFile.AttachSource.Replace("ManageRule", "ActionPlanManagerRule");
                     newAttachFile.AttachUrl    = attachFile.AttachUrl.Replace("ManageRule", "ActionPlanManagerRule");
                     newAttachFile.MenuId       = BLL.Const.ActionPlan_ManagerRuleMenuId;
                     db.AttachFile.InsertOnSubmit(newAttachFile);
                     db.SubmitChanges();
                 }
             }
         }
         PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
     }
     else
     {
         Alert.ShowInParent("请至少选择一条记录!");
         return;
     }
 }
        // GET: Snippet
        public ActionResult CompositeComponent()
        {
            var renderingContext = RenderingContext.CurrentOrNull;
            if (renderingContext == null)
                throw new ApplicationException("Could not find current rendering context, aborting");
            var hasDataSource = !string.IsNullOrWhiteSpace(renderingContext.Rendering.DataSource);
            var pageContext = new PageContext()
            {
                RequestContext = this.ControllerContext.RequestContext,
                Item = !hasDataSource ? null : renderingContext.Rendering.Item
            };
            var oldDisplayMode = global::Sitecore.Context.Site != null ? global::Sitecore.Context.Site.DisplayMode : DisplayMode.Normal;
            try
            {
                if (oldDisplayMode == DisplayMode.Edit && global::Sitecore.Context.Site != null)
                {
                    //disable the editing of the nested component
                    global::Sitecore.Context.Site.SetDisplayMode(DisplayMode.Preview, DisplayModeDuration.Temporary);
                }
                using (PlaceholderContext.Enter(new PlaceholderContext("/")))
                using (ContextService.Get().Push<PageContext>(pageContext))
                {
                    var stringWriter = new StringWriter();
                    if (oldDisplayMode == DisplayMode.Edit)
                    {
                        if (hasDataSource)
                        {
                            UrlString webSiteUrl = SiteContext.GetWebSiteUrl(global::Sitecore.Context.ContentDatabase ?? global::Sitecore.Context.Database);
                            webSiteUrl.Add("sc_mode", "edit");
                            webSiteUrl.Add("sc_itemid", pageContext.Item.ID.ToString());
                            webSiteUrl.Add("sc_lang", pageContext.Item.Language.ToString());

                            //copied style from bootstrap alert
                            stringWriter.Write("<div role=\"alert\" class=\"alert alert-warning\" style=\"box-sizing: border-box; margin-bottom: 20px; border-top: rgb(250,235,204) 1px solid; border-right: rgb(250,235,204) 1px solid; white-space: normal; word-spacing: 0px; border-bottom: rgb(250,235,204) 1px solid; text-transform: none; color: rgb(138,109,59); padding-bottom: 15px; padding-top: 15px; font: 14px/20px 'Helvetica Neue', helvetica, arial, sans-serif; padding-left: 15px; border-left: rgb(250,235,204) 1px solid; widows: 1; letter-spacing: normal; padding-right: 15px; background-color: rgb(252,248,227); text-indent: 0px; border-radius: 4px; -webkit-text-stroke-width: 0px\">");
                            stringWriter.Write("<a class=\"alert-link\" style=\"box-sizing: border-box; text-decoration: none; font-weight: 700; color: rgb(102,81,44); background-color: transparent\" href=\"");
                            stringWriter.Write(webSiteUrl);
                            stringWriter.Write("\" target=\"_blank\" onmousedown=\"window.open(this.href)\">&quot;");
                            stringWriter.Write(pageContext.Item.DisplayName);
                            stringWriter.Write("&quot; is a 'composite component'. Click here to open it's editor</a><br /></div>");
                        }
                        else
                        {
                            //copied style from bootstrap alert
                            stringWriter.Write("<div role=\"alert\" class=\"alert alert-warning\" style=\"box-sizing: border-box; margin-bottom: 20px; border-top: rgb(250,235,204) 1px solid; border-right: rgb(250,235,204) 1px solid; white-space: normal; word-spacing: 0px; border-bottom: rgb(250,235,204) 1px solid; text-transform: none; color: rgb(138,109,59); padding-bottom: 15px; padding-top: 15px; font: 14px/20px 'Helvetica Neue', helvetica, arial, sans-serif; padding-left: 15px; border-left: rgb(250,235,204) 1px solid; widows: 1; letter-spacing: normal; padding-right: 15px; background-color: rgb(252,248,227); text-indent: 0px; border-radius: 4px; -webkit-text-stroke-width: 0px\">");
                            stringWriter.Write("<a class=\"alert-link\" style=\"box-sizing: border-box; text-decoration: none; font-weight: 700; color: rgb(102,81,44); background-color: transparent\" href=\"\" onmousedown=\"");
                            stringWriter.Write("Sitecore.PageModes.PageEditor.postRequest('webedit:setdatasource(referenceId=");
                            stringWriter.Write(renderingContext.Rendering.UniqueId.ToString("B").ToUpper());
                            stringWriter.Write(",renderingId=");
                            stringWriter.Write(renderingContext.Rendering.RenderingItem.ID);
                            stringWriter.Write(",id=");
                            stringWriter.Write(renderingContext.Rendering.Item.ID);
                            stringWriter.Write(")',null,false)");
                            stringWriter.Write("\" target=\"_blank\">This is a 'composite component' without a datasource. Click here to associate a composite component instance</a><br /></div>");

                        }
                    }
                    if (hasDataSource)
                        PipelineService.Get().RunPipeline<RenderPlaceholderArgs>("mvc.renderPlaceholder", new RenderPlaceholderArgs(pageContext.Item["PlaceholderName"] ?? "compositecontent", (TextWriter) stringWriter, new ContentRendering()));
                    return Content(stringWriter.ToString());
                }
            }
            finally
            {
                global::Sitecore.Context.Site.SetDisplayMode(oldDisplayMode, DisplayModeDuration.Temporary);
            }
        }
Exemple #38
0
 protected void Window_Close(object sender, WindowCloseEventArgs e)
 {
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
 public void ShouldCopyEntity()
 {
     var pageContext = new PageContext { Guid = Guid.NewGuid() };
     var result = pageContext.Clone( false );
     Assert.AreEqual( result.Guid, pageContext.Guid );
 }
 protected void btnPostBackClose_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());
 }
Exemple #41
0
        public void Write(TextWriter textWriter, PageContext pageContext)
        {
            if (textWriter == null)
                throw new ArgumentNullException("textWriter");

            if (pageContext == null)
                pageContext = new PageContext(this, new Dictionary<string, object>(), this.RenderHtml);

            var blocks = pageContext.RenderHtml ? this.HtmlBlocks : this.MarkdownBlocks;

            if (Interlocked.Increment(ref timesRun) == 1)
            {
                this.ExecutionContext.BaseType = Markdown.MarkdownBaseType;
                this.ExecutionContext.TypeProperties = Markdown.MarkdownGlobalHelpers;

                pageContext.MarkdownPage = this;
                blocks.ForEach(x => x.DoFirstRun(pageContext));

                this.evaluator = this.ExecutionContext.Build();

                blocks.ForEach(x => x.AfterFirstRun(evaluator));

                hasCompletedFirstRun = true;
            }

            if (!hasCompletedFirstRun) //TODO: Add lock/waits if it's a noticeable problem
                throw new InvalidOperationException("Page hasn't finished initializing yet");

            MarkdownViewBase instance = null;
            if (this.evaluator != null)
            {
                instance = (MarkdownViewBase)this.evaluator.CreateInstance();

                object model;
                pageContext.ScopeArgs.TryGetValue(ModelName, out model);

                instance.Init(this, model, this.RenderHtml);
            }

            foreach (var block in blocks)
            {
                block.Write(instance, textWriter, pageContext.ScopeArgs);
            }
        }
        protected void btn_save_Click(object sender, EventArgs e)
        {
            string sqlCmd    = "";
            int    execCount = 0;

            if (rdbl_status.SelectedValue == "1") //发车登记
            {
                if (string.IsNullOrEmpty(DatePicker1.Text) || string.IsNullOrEmpty(TimePicker1.Text) || string.IsNullOrEmpty(numbbox_actualMileage.Text))
                {
                    Alert.ShowInTop("发车信息不可为空!");
                    return;
                }
                else
                {
                    sqlCmd    = "update OA_Car_Main set actualMileage='" + numbbox_actualMileage.Text + "',actualUseTime='" + DatePicker1.Text + "'+' '+'" + TimePicker1.Text + "',";
                    sqlCmd   += "adminRegister='1' where id='" + label_tabId.Text + "'";
                    execCount = SqlSel.ExeSql(sqlCmd);
                }
            }
            if (rdbl_status.SelectedValue == "2")//返还登记
            {
                if (string.IsNullOrEmpty(DatePicker2.Text) || string.IsNullOrEmpty(TimePicker2.Text) || string.IsNullOrEmpty(numbbox_endMileage.Text))
                {
                    Alert.ShowInTop("返还信息不可为空!");
                    return;
                }
                else
                {
                    sqlCmd    = "update OA_Car_Main set endMileage='" + numbbox_endMileage.Text + "',actualBackTime='" + DatePicker2.Text + "'+' '+'" + TimePicker2.Text + "',";
                    sqlCmd   += "adminRegister='2' where id='" + label_tabId.Text + "'";
                    execCount = SqlSel.ExeSql(sqlCmd);

                    //关联车辆解除绑定
                    if (execCount == 1)
                    {
                        sqlCmd = "update OA_Car_Register set OnUsing='0' where id=(select deptCarId from OA_Car_Main where id='" + label_tabId.Text + "')";
                        SqlSel.ExeSql(sqlCmd);
                    }
                }
            }
            if (rdbl_status.SelectedValue == "-1")//取消申请
            {
                sqlCmd    = "update OA_Car_Main set adminRegister='-1' where id='" + label_tabId.Text + "'";
                execCount = SqlSel.ExeSql(sqlCmd);

                //关联车辆解除绑定
                if (execCount == 1)
                {
                    sqlCmd = "update OA_Car_Register set OnUsing='0' where id=(select deptCarId from OA_Car_Main where id='" + label_tabId.Text + "')";
                    SqlSel.ExeSql(sqlCmd);
                }
            }

            if (execCount == 1)
            {
                Alert.Show("登记成功!");
                PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
            }
            else
            {
                Alert.ShowInTop("登记失败!请联系管理员。");
                return;
            }
        }
Exemple #43
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="header">The TrueCrypt header of the volume.</param>
 public HeaderInfo(PageContext.Header header)
 {
     this.header = header;
 }
 public static string RenderToString(this MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml)
 {
     var sb = new StringBuilder();
     using (var writer = new StringWriter(sb))
     {
         var pageContext = new PageContext(markdownPage, scopeArgs, renderHtml);
         markdownPage.Write(writer, pageContext);
     }
     return sb.ToString();
 }
    /// <summary>
    /// Retrieves a collection of insights where reports are available, and returns it.
    /// </summary>
    /// <returns>A collection of insights where reports are available.</returns>
    private IEnumerable<Insight> GetInsights(PageContext context)
    {
        Dictionary<string, Insight> insights = new Dictionary<string, Insight>(StringComparer.InvariantCultureIgnoreCase);
        foreach (ReportInfo report in new ObjectQuery<ReportInfo>().Where(ReportInfo.TYPEINFO.CodeNameColumn, QueryOperator.Like, context.ReportNamePrefix + "%"))
        {
            string[] tokens = report.ReportName.Split('.');
            string codeName = tokens[1];
            if (!insights.ContainsKey(codeName))
            {
                string resourceName = String.Format(context.DisplayNameResourceNameFormat, codeName);
                Insight insight = new Insight
                {
                    CodeName = codeName,
                    PeriodType = tokens[2],
                    DisplayName = GetString(resourceName)
                };
                insights.Add(codeName, insight);
            }
        }

        return insights.Values.OrderBy(x => x.CodeName).ToArray();
    }
        /// <summary>
        /// Handles the OnSave event of the masterPage control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void masterPage_OnSave( object sender, EventArgs e )
        {
            Page.Validate( BlockValidationGroup );
            if ( Page.IsValid && _pageId.HasValue )
            {
                var rockContext = new RockContext();
                var pageService = new PageService( rockContext );
                var routeService = new PageRouteService( rockContext );
                var contextService = new PageContextService( rockContext );

                var page = pageService.Get( _pageId.Value );

                // validate/check for removed routes
                var editorRoutes = tbPageRoute.Text.SplitDelimitedValues().Distinct();
                var databasePageRoutes = page.PageRoutes.ToList();
                var deletedRouteIds = new List<int>();
                var addedRoutes = new List<string>();

                if ( editorRoutes.Any() )
                {
                    // validate for any duplicate routes
                    var duplicateRoutes = routeService.Queryable()
                        .Where( r => editorRoutes.Contains( r.Route ) && r.PageId != _pageId )
                        .Select( r => r.Route )
                        .Distinct()
                        .ToList();

                    if ( duplicateRoutes.Any() )
                    {
                        // Duplicate routes
                        nbPageRouteWarning.Title = "Duplicate Route(s)";
                        nbPageRouteWarning.Text = string.Format( "<p>The page route <strong>{0}</strong>, already exists for another page. Please choose a different route name.</p>", duplicateRoutes.AsDelimited( "</strong> and <strong>" ) );
                        nbPageRouteWarning.Dismissable = true;
                        nbPageRouteWarning.Visible = true;
                        CurrentTab = "Advanced Settings";

                        rptProperties.DataSource = _tabs;
                        rptProperties.DataBind();
                        ShowSelectedPane();
                        return;
                    }
                }

                // validate if removed routes can be deleted
                foreach ( var pageRoute in databasePageRoutes )
                {
                    if ( !editorRoutes.Contains( pageRoute.Route ) )
                    {
                        // make sure the route can be deleted
                        string errorMessage;
                        if ( !routeService.CanDelete( pageRoute, out errorMessage ) )
                        {
                            nbPageRouteWarning.Text = string.Format( "The page route <strong>{0}</strong>, cannot be removed. {1}", pageRoute.Route, errorMessage );
                            nbPageRouteWarning.NotificationBoxType = NotificationBoxType.Warning;
                            nbPageRouteWarning.Dismissable = true;
                            nbPageRouteWarning.Visible = true;
                            CurrentTab = "Advanced Settings";

                            rptProperties.DataSource = _tabs;
                            rptProperties.DataBind();
                            ShowSelectedPane();
                            return;
                        }
                    }
                }

                // take care of deleted routes
                foreach ( var pageRoute in databasePageRoutes )
                {
                    if ( !editorRoutes.Contains( pageRoute.Route ) )
                    {
                        // if they removed the Route, remove it from the database
                        page.PageRoutes.Remove( pageRoute );

                        routeService.Delete( pageRoute );
                        deletedRouteIds.Add( pageRoute.Id );
                    }
                }

                // take care of added routes
                foreach ( string route in editorRoutes )
                {
                    // if they added the Route, add it to the database
                    if ( !databasePageRoutes.Any( a => a.Route == route ) )
                    {
                        var pageRoute = new PageRoute();
                        pageRoute.Route = route.TrimStart( new char[] { '/' } );
                        pageRoute.Guid = Guid.NewGuid();
                        page.PageRoutes.Add( pageRoute );
                        addedRoutes.Add( route );
                    }
                }

                int parentPageId = ppParentPage.SelectedValueAsInt() ?? 0;
                if ( page.ParentPageId != parentPageId )
                {
                    if ( page.ParentPageId.HasValue )
                    {
                        PageCache.Flush( page.ParentPageId.Value );
                    }

                    if ( parentPageId != 0 )
                    {
                        PageCache.Flush( parentPageId );
                    }
                }

                page.InternalName = tbPageName.Text;
                page.PageTitle = tbPageTitle.Text;
                page.BrowserTitle = tbBrowserTitle.Text;
                if ( parentPageId != 0 )
                {
                    page.ParentPageId = parentPageId;
                }
                else
                {
                    page.ParentPageId = null;
                }

                page.LayoutId = ddlLayout.SelectedValueAsInt().Value;

                int? orphanedIconFileId = null;

                page.IconCssClass = tbIconCssClass.Text;

                page.PageDisplayTitle = cbPageTitle.Checked;
                page.PageDisplayBreadCrumb = cbPageBreadCrumb.Checked;
                page.PageDisplayIcon = cbPageIcon.Checked;
                page.PageDisplayDescription = cbPageDescription.Checked;

                page.DisplayInNavWhen = ddlMenuWhen.SelectedValue.ConvertToEnumOrNull<DisplayInNavWhen>() ?? DisplayInNavWhen.WhenAllowed;
                page.MenuDisplayDescription = cbMenuDescription.Checked;
                page.MenuDisplayIcon = cbMenuIcon.Checked;
                page.MenuDisplayChildPages = cbMenuChildPages.Checked;

                page.BreadCrumbDisplayName = cbBreadCrumbName.Checked;
                page.BreadCrumbDisplayIcon = cbBreadCrumbIcon.Checked;

                page.RequiresEncryption = cbRequiresEncryption.Checked;
                page.EnableViewState = cbEnableViewState.Checked;
                page.IncludeAdminFooter = cbIncludeAdminFooter.Checked;
                page.OutputCacheDuration = tbCacheDuration.Text.AsIntegerOrNull() ?? 0;
                page.Description = tbDescription.Text;
                page.HeaderContent = ceHeaderContent.Text;

                // update PageContexts
                foreach ( var pageContext in page.PageContexts.ToList() )
                {
                    contextService.Delete( pageContext );
                }

                page.PageContexts.Clear();
                foreach ( var control in phContext.Controls )
                {
                    if ( control is RockTextBox )
                    {
                        var tbContext = control as RockTextBox;
                        if ( !string.IsNullOrWhiteSpace( tbContext.Text ) )
                        {
                            var pageContext = new PageContext();
                            pageContext.Entity = tbContext.ID.Substring( 8 ).Replace( '_', '.' );
                            pageContext.IdParameter = tbContext.Text;
                            page.PageContexts.Add( pageContext );
                        }
                    }
                }

                // save page and it's routes
                if ( page.IsValid )
                {
                    rockContext.SaveChanges();

                    // remove any routes that were deleted
                    foreach (var deletedRouteId in deletedRouteIds )
                    {
                        var existingRoute = RouteTable.Routes.OfType<Route>().FirstOrDefault( a => a.RouteId() == deletedRouteId );
                        if ( existingRoute != null )
                        {
                            RouteTable.Routes.Remove( existingRoute );
                        }
                    }

                    // ensure that there aren't any other extra routes for this page in the RouteTable
                    foreach (var routeTableRoute in RouteTable.Routes.OfType<Route>().Where(a => a.PageId() == page.Id))
                    {
                        if ( !editorRoutes.Any( a => a == routeTableRoute.Url ) )
                        {
                            RouteTable.Routes.Remove( routeTableRoute );
                        }
                    }

                    // Add any routes that were added
                    foreach ( var pageRoute in new PageRouteService( rockContext ).GetByPageId( page.Id ) )
                    {
                        if ( addedRoutes.Contains( pageRoute.Route ) )
                        {
                            RouteTable.Routes.AddPageRoute( pageRoute );
                        }
                    }

                    if ( orphanedIconFileId.HasValue )
                    {
                        BinaryFileService binaryFileService = new BinaryFileService( rockContext );
                        var binaryFile = binaryFileService.Get( orphanedIconFileId.Value );
                        if ( binaryFile != null )
                        {
                            // marked the old images as IsTemporary so they will get cleaned up later
                            binaryFile.IsTemporary = true;
                            rockContext.SaveChanges();
                        }
                    }

                    Rock.Web.Cache.PageCache.Flush( page.Id );

                    string script = "if (typeof window.parent.Rock.controls.modal.close === 'function') window.parent.Rock.controls.modal.close('PAGE_UPDATED');";
                    ScriptManager.RegisterStartupScript( this.Page, this.GetType(), "close-modal", script, true );
                }
            }
        }
Exemple #47
0
        private IDictionary<string, object> ProcessTemplate(PageContext pageContext, string path)
        {
            var templateFile = fileSystem.File.ReadAllText(path);
            var metadata = templateFile.YamlHeader();
            var templateContent = templateFile.ExcludeHeader();

            var data = CreatePageData(context, pageContext);
            pageContext.Content = RenderTemplate(templateContent, data);
            return metadata;
        }
Exemple #48
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            BLHelper.BLLFurniture    blfurni = new BLHelper.BLLFurniture();
            BLHelper.BLLUser         user    = new BLHelper.BLLUser();
            BLHelper.BLLAgency       agency  = new BLHelper.BLLAgency();
            BLHelper.BLLOperationLog op      = new BLHelper.BLLOperationLog();

            Common.Entities.Furniture    furniture = new Common.Entities.Furniture();
            Common.Entities.OperationLog log       = new Common.Entities.OperationLog();
            try
            {
                if (string.IsNullOrEmpty(tb_FurnitureName.Text.Trim()))
                {
                    Alert.ShowInTop("请填写家具名称!");
                    return;
                }
                furniture.FurnitureName = tb_FurnitureName.Text.Trim();
                if (ddl_isgov.SelectedIndex == 0)
                {
                    furniture.IsGowerProcu = true;
                }
                else
                {
                    furniture.IsGowerProcu = false;
                }
                if (ddl_isshare.SelectedIndex == 0)
                {
                    furniture.IsShare = true;
                }
                else
                {
                    furniture.IsShare = false;
                }
                //furniture.AgencName = tb_Agency.Text.Trim();
                furniture.AgencName = ddl_Agency.SelectedText;

                furniture.CategoryName    = "无";
                furniture.CategoryName    = ddl_Category.SelectedText.Trim();
                furniture.ClassNum        = tb_ClassNum.Text.Trim();
                furniture.EquipNum        = tb_Equipnum.Text.Trim();
                furniture.Manufacturer    = tb_Manufacturer.Text.Trim();
                furniture.MeasurementUnit = tb_MeasurementUnit.Text.Trim();
                furniture.Model           = tb_Model.Text.Trim();
                furniture.Remarks         = tb_Remarks.Text.Trim();
                furniture.StorageLocation = tb_StorageLocation.Text.Trim();


                furniture.Price        = tb_price.Text.Trim();
                furniture.Purchase     = tb_Purchase.Text.Trim();
                furniture.PurchaseTime = dp_PurchaseTime.SelectedDate.Value;
                furniture.UsePerson    = tb_UsePerson.Text.Trim();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                furniture.EntryPerson  = username;
                furniture.SecrecyLevel = Convert.ToInt32(ddl_Level.SelectedIndex + 1);

                //furniture.AgencyID = agency.SelectAgencyID(ddl_agencyname.SelectedText.Trim());
                if (Convert.ToInt32(Session["SecrecyLevel"]) < 5)
                {
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "Furnitures";
                    log.OperationType    = "添加";
                    furniture.IsPass     = false;

                    blfurni.Insert(furniture);//插入家具表
                    log.OperationDataID = furniture.FurnitureID;
                    op.Insert(log);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待审核!"));
                }
                else
                {
                    furniture.IsPass = true;
                    blfurni.Insert(furniture);//插入家具表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功"));
                }
            }
            catch (Exception ex)
            {
                Alert.ShowInTop("保存出错,请联系管理员!");
                pm.SaveError(ex, this.Request);
            }
        }
Exemple #49
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (CommonAdapter.GetCurrentLoginType() == LoginTypes.RemisierEmployee)
            throw new SecurityLayerException();

        if (!IsPostBack)
        {
            ((TotalGiroClient)Master).HeaderText = "Remisier Logins";

            gvRemisierEmployees.Sort("ShortName", SortDirection.Ascending);

            ctlAccountFinder.Focus();
        }

        gvRemisierEmployees.Columns[0].ItemStyle.BackColor = gvRemisierEmployees.Columns[1].ItemStyle.BackColor;
        elbErrorMessage.Text = "";
        Utility.EnableScrollToBottom(this, hdnScrollToBottom);
        PageContext = new PageContext(gvRemisierEmployees, elbErrorMessage, hdnScrollToBottom);
    }
Exemple #50
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Mode == "New")
            {
                #region Validate



                #endregion

                // Datos de nodo / Empresa / Sede
                NodeOrganizationLoactionWarehouseList objNodeOrgLocaWarehouse = new NodeOrganizationLoactionWarehouseList();
                objNodeOrgLocaWarehouse.i_NodeId         = NodeId;
                objNodeOrgLocaWarehouse.v_OrganizationId = ddlOrganization.SelectedValue;
                objNodeOrgLocaWarehouse.v_LocationId     = ddlLocation.SelectedValue;

                // Datos de Almacén

                var objInsertWarehouseList = InsertWarehouse();

                OperationResult objOperationResult1 = new OperationResult();
                // Graba Nodo / Empresa / Sede / Almacén
                _objNodeBL.AddNodeOrganizationLoactionWarehouse(ref objOperationResult1, objNodeOrgLocaWarehouse, objInsertWarehouseList, ((ClientSession)Session["objClientSession"]).GetAsList());

                if (objOperationResult1.ErrorMessage != null)
                {
                    Alert.ShowInTop(objOperationResult1.ErrorMessage);
                    return;
                }

                if (objOperationResult1.Success != 1)
                {
                    Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult1.ExceptionMessage);
                }
            }
            else if (Mode == "Edit")
            {
                NodeOrganizationLoactionWarehouseList objNodeOrgLocaWarehouse = new NodeOrganizationLoactionWarehouseList();
                objNodeOrgLocaWarehouse.i_NodeId         = NodeId;
                objNodeOrgLocaWarehouse.v_OrganizationId = ddlOrganization.SelectedValue;
                objNodeOrgLocaWarehouse.v_LocationId     = ddlLocation.SelectedValue;

                OperationResult objOperationResult2    = new OperationResult();
                var             objAddWarehouseList    = UpdateWarehouse();
                var             objDeleteWarehouseList = DeleteWarehouse();

                _objNodeBL.UpdateNodeOrganizationLoactionWarehouse(ref objOperationResult2,
                                                                   objNodeOrgLocaWarehouse,
                                                                   objAddWarehouseList,
                                                                   objDeleteWarehouseList,
                                                                   ((ClientSession)Session["objClientSession"]).GetAsList());

                if (objOperationResult2.ErrorMessage != null)
                {
                    Alert.ShowInTop(objOperationResult2.ErrorMessage);
                    return;
                }
            }

            // Cerrar página actual y hacer postback en el padre para actualizar
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
		public static string RenderToString(this MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml)
		{
		    var writer = StringWriterCache.Allocate();
            var pageContext = new PageContext(markdownPage, scopeArgs, renderHtml);
            markdownPage.Write(writer, pageContext);
		    return StringWriterCache.ReturnAndFree(writer);
		}
Exemple #52
0
 public void ToJson()
 {
     var pageContext = new PageContext { Guid = Guid.NewGuid() };
     var result = pageContext.ToJson();
     Assert.NotEmpty( result );
 }
Exemple #53
0
        protected void DataMXSearch()
        {
            if (!string.IsNullOrEmpty(hdfsupid.Text))
            {
                ddlSUPPLIER.SelectedValue = hdfsupid.Text;
            }
            if (PubFunc.StrIsEmpty(lisDATE1.SelectedDate.ToString()) || PubFunc.StrIsEmpty(lisDATE2.SelectedDate.ToString()))
            {
                Alert.Show("【输入日期】不正确,请检查!", MessageBoxIcon.Warning);
                return;
            }
            if (lisDATE1.SelectedDate > lisDATE2.SelectedDate)
            {
                Alert.Show("【开始日期】不能大于【结束日期】!", MessageBoxIcon.Warning);
                return;
            }

            string strSql = string.Format(@" SELECT A.*,
                                               NVL(B.SLHBZ,0) SLHBZ,
                                               NVL(B.JEHBZ,0) JEHBZ,
                                               NVL(C.SLTBZ, 0) SLTBZ,
                                               NVL(C.JETBZ, 0) JETBZ
                                          FROM (SELECT GDSEQ,
                                                GDNAME,  GDSPEC,UNITNAME,PRODUCERNAME,PIZNO,                                      
                                              TSL SYSL,
                                               ROUND(ZJ, 2) SYJE
                                          FROM (SELECT DG.GDSEQ,DG.GDNAME,DG.GDSPEC,f_getunitname(DG.UNIT) UNITNAME,f_getproducername(DG.PRODUCER) PRODUCERNAME,
                                       DG.PIZNO,  NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
                                                  FROM DAT_GOODSJXC DGJ, DOC_GOODS DG,DOC_SUPPLIER DS
                                                 WHERE DGJ.GDSEQ = DG.GDSEQ(+) AND DGJ.SUPID=DS.SUPID(+)
                                                   AND TRUNC(DGJ.RQSJ, 'DD') >= TRUNC(TO_DATE('{0}','yyyy-MM-dd'), 'DD') 
                                                   AND TRUNC(DGJ.RQSJ, 'DD')<TRUNC(TO_DATE('{1}','yyyy-MM-dd'), 'DD')+1
                                                   AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
                                                  --AND DGJ.SL > 0
                                                   AND DG.ISGZ LIKE NVL('{2}','%')
                                                   AND DGJ.DEPTID LIKE NVL('{3}','%')
                                                   AND DGJ.SUPID LIKE NVL('{4}','%')
                                                   AND DGJ.KCADD = '-1'
                                                   GROUP BY DG.GDSEQ,DG.GDNAME,DG.GDSPEC,DG.UNIT,DG.PRODUCER,DG.PIZNO
                                                 )
                                        ) A,

                                         (SELECT GDSEQ,GDNAME, TSL SLHBZ, ROUND(ZJ, 2) JEHBZ
                                            FROM (SELECT DG.GDSEQ,DG.GDNAME,  NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
                                                    FROM DAT_GOODSJXC DGJ, DOC_GOODS DG
                                                   WHERE DGJ.GDSEQ = DG.GDSEQ(+)
                                                     AND TRUNC(DGJ.RQSJ, 'DD') >=TRUNC(TO_DATE('{0}','yyyy-MM-dd')-(TO_DATE('{1}','yyyy-MM-dd')-TO_DATE('{0}','yyyy-MM-dd')), 'DD')-1
                                                     AND TRUNC(DGJ.RQSJ, 'DD')<TRUNC(TO_DATE('{0}','yyyy-MM-dd'), 'DD')
                                                     AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
                                                    --AND DGJ.SL > 0
                                                   AND DG.ISGZ LIKE NVL('{2}','%')
                                                   AND DGJ.DEPTID LIKE NVL('{3}','%')
                                                   AND DGJ.SUPID LIKE NVL('{4}','%') AND DGJ.KCADD = '-1'
                                                      GROUP BY DG.GDSEQ,DG.GDNAME
                                                   )
                                           ) B,

                                         (SELECT GDSEQ,GDNAME, NVL(TSL, 0) SLTBZ, ROUND(NVL(ZJ, 0), 2) JETBZ
                                            FROM (SELECT DG.GDSEQ,DG.GDNAME,  NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
                                                    FROM DAT_GOODSJXC DGJ, DOC_GOODS DG
                                                   WHERE DGJ.GDSEQ = DG.GDSEQ(+)
                                                     AND TRUNC(DGJ.RQSJ, 'DD') >= TRUNC(ADD_MONTHS(TO_DATE('{0}', 'yyyy-MM-dd'), -12), 'DD') 
                                                     AND TRUNC(DGJ.RQSJ, 'DD')< TRUNC(ADD_MONTHS(TO_DATE('{0}', 'yyyy-MM-dd')+1, -12), 'DD')+1
                                                     AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
                                                    --AND DGJ.SL > 0
                                                   AND DG.ISGZ LIKE NVL('{2}','%')
                                                   AND DGJ.DEPTID LIKE NVL('{3}','%')
                                                   AND DGJ.SUPID LIKE NVL('{4}','%') AND DGJ.KCADD = '-1'
                                                      GROUP BY DG.GDSEQ,DG.GDNAME
                                                   )
                                           ) C
                                         WHERE A.GDSEQ = B.GDSEQ(+)
                                           AND A.GDSEQ = C.GDSEQ(+) AND SYSL<>0", lisDATE1.Text, lisDATE2.Text, lstISGZ.SelectedValue, ddlDEPTID.SelectedValue, ddlSUPPLIER.SelectedValue);



            int       total         = 0;
            string    sortField     = GridList.SortField;
            string    sortDirection = GridList.SortDirection;
            DataTable dtt           = DbHelperOra.QueryForTable(strSql);
            // DataTable dtData = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, string.Format(strSql)+" ORDER BY A.SYSL DESC ", ref total);
            //解决排序问题
            DataTable dtData = PubFunc.DbGetPage(GridList.PageIndex, GridList.PageSize, strSql + String.Format(" ORDER BY {0} {1}", sortField, sortDirection), ref total);

            GridList.RecordCount = total;
            GridList.DataSource  = dtData;
            GridList.DataBind();

            Decimal SL = 0, HSJE = 0, SL1 = 0, HSJE1 = 0;
            JObject summary = new JObject();

            foreach (DataRow dr in dtData.Rows)
            {
                SL   += Convert.ToDecimal(dr["SYSL"]);
                HSJE += Convert.ToDecimal(dr["SYJE"]);
            }
            foreach (DataRow dr in dtt.Rows)
            {
                SL1   += Convert.ToDecimal(dr["SYSL"]);
                HSJE1 += Convert.ToDecimal(dr["SYJE"]);
            }
            TotalslMX.Text = SL1.ToString();
            TotaljeMX.Text = HSJE1.ToString();
            summary.Add("SUPNAME", "本页合计");
            summary.Add("SYSL", SL.ToString("F2"));
            summary.Add("HSJE", HSJE.ToString("F2"));
            GridList.SummaryData = summary;
            PageContext.RegisterStartupScript("updateDateMX();");
        }
 /// <summary>
 /// 返回订单列表页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btnReturn_Click(object sender, EventArgs e)
 {
     PageContext.Redirect("~/Contract/SH/ContractSHManage.aspx");
 }
Exemple #55
0
 public void ShallowClone()
 {
     var pageContext = new PageContext { Guid = Guid.NewGuid() };
     var result = pageContext.Clone( false );
     Assert.Equal( result.Guid, pageContext.Guid );
 }
Exemple #56
0
        private void DataSearch()
        {
            string strsql        = "";
            string strwhere      = "";
            string sortField     = GridGoods.SortField;
            string sortDirection = GridGoods.SortDirection;

            if (PubFunc.StrIsEmpty(dpkDATE1.SelectedDate.ToString()) || PubFunc.StrIsEmpty(dpkDATE2.SelectedDate.ToString()))
            {
                Alert.Show("【输入日期】不正确,请检查!", MessageBoxIcon.Warning);
                return;
            }
            if (dpkDATE1.SelectedDate > dpkDATE2.SelectedDate)
            {
                Alert.Show("【开始日期】不能大于【结束日期】!", MessageBoxIcon.Warning);
                return;
            }
            DateTime begrq = Convert.ToDateTime(dpkDATE1.Text);
            DateTime endrq = Convert.ToDateTime(dpkDATE2.Text);

            strsql = string.Format(@"SELECT A.*,
       NVL(B.SLHBZ,0) SLHBZ,
       NVL(B.JEHBZ,0) JEHBZ,
       NVL(C.SLTBZ, 0) SLTBZ,
       NVL(C.JETBZ, 0) JETBZ
  FROM (SELECT SUPID,
        SUPNAME,
       SUM(NVL(TSL, 0)) SYSL,
       ROUND(NVL(SUM(ZJ), 0), 2) SYJE
  FROM (SELECT DGJ.SUPID,DS.SUPNAME, NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
          FROM DAT_GOODSJXC DGJ, DOC_GOODS DG,DOC_SUPPLIER DS
         WHERE DGJ.GDSEQ = DG.GDSEQ(+) AND DGJ.SUPID=DS.SUPID(+)
           AND TRUNC(DGJ.RQSJ, 'DD') >= TRUNC(TO_DATE('{0}','yyyy-MM-dd'), 'DD') 
           AND TRUNC(DGJ.RQSJ, 'DD') <TRUNC(TO_DATE('{1}','yyyy-MM-dd'), 'DD')+1
           AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
          -- AND DGJ.SL > 0            
           AND DG.ISGZ LIKE NVL('{2}','%')
           AND DGJ.DEPTID LIKE NVL('{3}','%')
           AND DGJ.KCADD='-1'
         GROUP BY DGJ.SUPID,DS.SUPNAME)
 GROUP BY SUPID,SUPNAME) A,

 (SELECT SUPID, SUM(NVL(TSL, 0)) SLHBZ, ROUND(NVL(SUM(ZJ), 0), 2) JEHBZ
    FROM (SELECT DGJ.SUPID, NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
            FROM DAT_GOODSJXC DGJ, DOC_GOODS DG
           WHERE DGJ.GDSEQ = DG.GDSEQ(+)
             AND TRUNC(DGJ.RQSJ, 'DD') >= TRUNC(TO_DATE('{0}','yyyy-MM-dd')-(TO_DATE('{1}','yyyy-MM-dd')-TO_DATE('{0}','yyyy-MM-dd')), 'DD')-1
              AND TRUNC(DGJ.RQSJ, 'DD')< TRUNC(TO_DATE('{0}','yyyy-MM-dd'), 'DD')
             AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
             --AND DGJ.SL > 0
           AND DG.ISGZ LIKE NVL('{2}','%')
           AND DGJ.DEPTID LIKE NVL('{3}','%')
           AND DGJ.KCADD='-1'
           GROUP BY SUPID)
   GROUP BY SUPID) B,

 (SELECT SUPID, SUM(NVL(TSL, 0)) SLTBZ, ROUND(NVL(SUM(ZJ), 0), 2) JETBZ
    FROM (SELECT DGJ.SUPID, NVL(SUM(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL)),0) TSL,
               SUM(DGJ.HSJJ * NVL(DECODE(DGJ.BILLTYPE,'XSD',ABS(SL),'XSG',ABS(SL),'DSH',ABS(SL),'XST',SL),0)) ZJ
            FROM DAT_GOODSJXC DGJ, DOC_GOODS DG
           WHERE DGJ.GDSEQ = DG.GDSEQ(+)
             AND TRUNC(DGJ.RQSJ, 'DD') >= TRUNC(ADD_MONTHS(TO_DATE('{0}', 'yyyy-MM-dd'), -12), 'DD') 
             AND TRUNC(DGJ.RQSJ, 'DD')< TRUNC(ADD_MONTHS(TO_DATE('{1}', 'yyyy-MM-dd')+1, -12), 'DD')
             AND DGJ.BILLTYPE  IN ('XSD', 'XSG', 'DSH', 'XST')
             --AND DGJ.SL > 0
           AND DG.ISGZ LIKE NVL('{2}','%')
           AND DGJ.DEPTID LIKE NVL('{3}','%')
           AND DGJ.KCADD='-1'
           GROUP BY SUPID)
   GROUP BY SUPID) C

 WHERE A.SUPID = B.SUPID(+)
   AND A.SUPID = C.SUPID(+) AND SYSL<>0", begrq.ToShortDateString(), endrq.ToShortDateString(), ddlISGZ.SelectedValue, lstDEPTID.SelectedValue);

            if (!string.IsNullOrEmpty(lstSUPPLIER.SelectedValue))
            {
                strwhere += " AND A.SUPID='" + lstSUPPLIER.SelectedValue + "' ";
            }

            int total1 = 0;

            strsql += strwhere;
            //strsql += "ORDER BY A.SYSL DESC";
            DataTable dtt = DbHelperOra.QueryForTable(strsql);
            //  DataTable dt = PubFunc.DbGetPage(GridGoods.PageIndex, GridGoods.PageSize, strsql, ref total1);
            //解决排序问题
            DataTable dt = PubFunc.DbGetPage(GridGoods.PageIndex, GridGoods.PageSize, strsql + String.Format(" ORDER BY {0} {1}", sortField, sortDirection), ref total1);

            GridGoods.RecordCount = total1;
            GridGoods.DataSource  = dt;
            GridGoods.DataBind();
            JObject summary = new JObject();

            hfdArrayVal.Text  = "";
            hfdArrayVal2.Text = "";
            int     i = 0;
            Decimal SL = 0, HSJE = 0, total = 0, totaltb = 0, totalhb = 0, sHSJE = 0, sSL = 0;

            if (dt.Rows.Count == 0)
            {
                hfdArrayVal.Text = "无数据" + "$" + "无数据" + ",";
            }
            else
            {
                foreach (DataRow dr in dt.Rows)
                {
                    SL   += Convert.ToDecimal(dr["SYSL"]);
                    HSJE += Convert.ToDecimal(dr["SYJE"]);

                    if (i > 8)
                    {
                        total += Convert.ToDecimal(dr["SYSL"].ToString());
                    }
                    else
                    {
                        hfdArray.Text    += dr["SUPNAME"] + ",";
                        hfdArrayVal.Text += dr["SYSL"] + "$" + dr["SUPNAME"] + ",";
                    }
                    i++;
                }
            }
            if (total > 0)
            {
                hfdArray.Text    += "其他,";
                hfdArrayVal.Text += total.ToString() + "$其他,";
            }
            foreach (DataRow dr in dtt.Rows)
            {
                sSL   += Convert.ToDecimal(dr["SYSL"]);
                sHSJE += Convert.ToDecimal(dr["SYJE"]);
            }
            Totalsl.Text      = sSL.ToString();
            Totalje.Text      = sHSJE.ToString();
            hfdArrayVal.Text  = hfdArrayVal.Text.TrimEnd(',');
            hfdArray.Text     = hfdArray.Text.TrimEnd(',');
            hfdArrayVal2.Text = HSJE.ToString() + "," + (Math.Round(totaltb, 2)).ToString() + "," + (Math.Round(totalhb, 2)).ToString();
            summary.Add("SUPNAME", "本页合计");
            summary.Add("SYSL", SL.ToString("F2"));
            summary.Add("SYJE", HSJE.ToString("F2"));
            GridGoods.SummaryData = summary;
            PageContext.RegisterStartupScript("showpie();updateDate()");
        }
Exemple #57
0
		public void Write(TextWriter textWriter, PageContext pageContext)
		{
			if (textWriter == null)
				throw new ArgumentNullException("textWriter");

			if (pageContext == null)
				pageContext = new PageContext(this, new Dictionary<string, object>(), true);

			var blocks = pageContext.RenderHtml ? this.HtmlBlocks : this.MarkdownBlocks;

			if (Interlocked.Increment(ref timesRun) == 1)
			{
				lock (readWriteLock)
				{
					try
					{
						isBusy = true;

						this.ExecutionContext.BaseType = Markdown.MarkdownBaseType;
						this.ExecutionContext.TypeProperties = Markdown.MarkdownGlobalHelpers;

						pageContext.MarkdownPage = this;
						var initHtmlContext = pageContext.Create(this, true);
						var initMarkdownContext = pageContext.Create(this, false);

						foreach (var block in this.HtmlBlocks)
						{
						    lastBlockProcessed = block;
                            block.DoFirstRun(initHtmlContext);
                        }
						foreach (var block in this.MarkdownBlocks)
						{
                            lastBlockProcessed = block;
                            block.DoFirstRun(initMarkdownContext);
						}

						this.evaluator = this.ExecutionContext.Build();

						foreach (var block in this.HtmlBlocks)
						{
                            lastBlockProcessed = block;
                            block.AfterFirstRun(evaluator);
						}
						foreach (var block in this.MarkdownBlocks)
						{
                            lastBlockProcessed = block;
                            block.AfterFirstRun(evaluator);
                        }

						AddDependentPages(blocks);

                        lastBlockProcessed = null;
                        initException = null;
						hasCompletedFirstRun = true;
					}
					catch (Exception ex)
					{
						initException = ex;
						throw;
					}
					finally
					{
						isBusy = false;
					}
				}
			}

			lock (readWriteLock)
			{
				while (isBusy)
					Monitor.Wait(readWriteLock);
			}

			if (initException != null)
			{
				timesRun = 0;
				throw initException;
			}

			MarkdownViewBase instance = null;
			if (this.evaluator != null)
			{
				instance = (MarkdownViewBase)this.evaluator.CreateInstance();

				object model;
				pageContext.ScopeArgs.TryGetValue(ModelName, out model);

				instance.Init(Markdown.AppHost, this, pageContext.ScopeArgs, model, pageContext.RenderHtml);
			    instance.ViewEngine = Markdown;
			}

			foreach (var block in blocks)
			{
				block.Write(instance, textWriter, pageContext.ScopeArgs);
			}

			if (instance != null)
			{
				instance.OnLoad();
			}
		}
 protected void btnAddCnblogs2_Click(object sender, EventArgs e)
 {
     PageContext.RegisterStartupScript(TabStrip1.GetAddTabReference("dynamic_tab_Cnblogs2", "http://www.cnblogs.com/", "Cnblogs2", IconHelper.GetIconUrl(Icon.ApplicationAdd), true));
 }