Beispiel #1
0
        //------------------------------------------------------------------------------------

        protected void lvItems_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            ListViewDataItem lv = e.Item as ListViewDataItem;

            EF.ImportedPod ip = lv.DataItem as EF.ImportedPod;

            System.Web.UI.HtmlControls.HtmlAnchor imageFile =
                lv.FindControl("ancImage") as System.Web.UI.HtmlControls.HtmlAnchor;

            System.Web.UI.HtmlControls.HtmlInputCheckBox chkDelete =
                lv.FindControl("chkDelete") as System.Web.UI.HtmlControls.HtmlInputCheckBox;

            if (lv.ItemType == ListViewItemType.DataItem)
            {
                // ImportedPods is the virtual directory. if this is not working make sure the virtual directory is present
                if (chkDelete != null && ip != null)
                {
                    chkDelete.Attributes.Add("ImportedPodId", ip.ImportedPodId.ToString());
                }

                if (imageFile != null && ip != null)
                {
                    string virtualPath = Server.MapPath("~/ImportedPods");
                    string actualPath  = "/ImportedPods" + Path.Combine(ip.ImageFolder.Replace(virtualPath, ""), ip.ImageName);
                    imageFile.HRef = actualPath;
                }
            }
        }
    /*
     * this function and CreatePagesNo (the previous function) are to do pagination of patients list, setting style and events for each page no and first, prev, next and last icons.
     */
    private void AddPageNavigator(string strNavigateCode, bool ShowFlag)
    {
        if (!ShowFlag)
        {
            return;
        }
        System.Web.UI.HtmlControls.HtmlAnchor aPage = new System.Web.UI.HtmlControls.HtmlAnchor();
        switch (strNavigateCode)
        {
        case "F":
            aPage.InnerText = "<<";
            break;

        case "P":
            aPage.InnerText = "<";
            break;

        case "N":
            aPage.InnerText = ">";
            break;

        case "L":
            aPage.InnerText = ">>";
            break;

        case "G":
            aPage.InnerText = "Go";
            break;
        }
        aPage.Attributes.Add("class", "squareBtn");
        aPage.Attributes.Add("style", "font-size:7.5pt;font-weight:normal");
        aPage.HRef = "#";
        aPage.Attributes.Add("onclick", "javascript:PageNavigator('" + strNavigateCode + "')");
        div_PagesNo.Controls.Add(aPage);
    }
Beispiel #3
0
        /// <summary>
        /// Sends rating to Soap Service so that it can be added to the database.
        /// </summary>
        public void SaveRating(object sender, EventArgs e)
        {
            int rating = 0;

            System.Web.UI.HtmlControls.HtmlAnchor button = (System.Web.UI.HtmlControls.HtmlAnchor)sender;
            if (button.ID == "a5")
            {
                rating = 5;
            }
            else if (button.ID == "a4")
            {
                rating = 4;
            }
            else if (button.ID == "a3")
            {
                rating = 3;
            }
            else if (button.ID == "a2")
            {
                rating = 2;
            }
            else if (button.ID == "a1")
            {
                rating = 1;
            }

            service1Client.NewRating(rating, this.id);
        }
Beispiel #4
0
                                                  public static void Bind(
                                                      long totalItems_in,

                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_left_in,
                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_2_in,
                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_3_in,
                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_4_in,
                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_right_in,
                                                      System.Web.UI.WebControls.Label lbl_pageSeparator_5_in,

                                                      System.Web.UI.HtmlControls.HtmlAnchor a_page_1_in,
                                                      System.Web.UI.HtmlControls.HtmlAnchor a_page_2_in,
                                                      System.Web.UI.HtmlControls.HtmlAnchor a_page_3_in,
                                                      System.Web.UI.HtmlControls.HtmlAnchor a_page_4_in,
                                                      System.Web.UI.HtmlControls.HtmlAnchor a_page_5_in
                                                      )
                                                  {
                                                      Bind(
                                                          totalItems_in,
                                                          ITEMSPERPAGE_DEFAULT,

                                                          lbl_pageSeparator_left_in,
                                                          lbl_pageSeparator_2_in,
                                                          lbl_pageSeparator_3_in,
                                                          lbl_pageSeparator_4_in,
                                                          lbl_pageSeparator_right_in,
                                                          lbl_pageSeparator_5_in,

                                                          a_page_1_in,
                                                          a_page_2_in,
                                                          a_page_3_in,
                                                          a_page_4_in,
                                                          a_page_5_in
                                                          );
                                                  }
        protected void gvwInvoice_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ImageButton btnCharge = (ImageButton)e.Row.FindControl("btnCharges");

                //long Status_Invoice_ID = Convert.ToInt64(e.CommandArgument);
                ImageButton btnStatus = (ImageButton)e.Row.FindControl("btnStatus");
                //LinkButton moneyReceipt = (LinkButton)e.Row.FindControl("aMoneyRecpt");
                HiddenField hdnInvID = (HiddenField)e.Row.FindControl("hdnInvID");
                btnStatus.OnClientClick = "javascript:return confirm('" + ResourceManager.GetStringWithoutName("ERR00014") + "');";

                System.Web.UI.HtmlControls.HtmlAnchor aPrint       = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("aPrint");
                System.Web.UI.HtmlControls.HtmlAnchor aAddCrdtNote = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("aAddCrdtNote");
                System.Web.UI.HtmlControls.HtmlAnchor aMoneyRecpt  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("aMoneyRecpt");
                System.Web.UI.HtmlControls.HtmlAnchor RcvdLnk      = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("RcvdLnk");
                System.Web.UI.HtmlControls.HtmlAnchor CrnLnk       = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("CrnLnk");

                var  data = (DataRowView)e.Row.DataItem;
                bool Actv = Convert.ToBoolean(data["invoiceActive"]);

                if (Actv == false)
                {
                    btnStatus.Visible    = false;
                    aPrint.Visible       = false;
                    aAddCrdtNote.Visible = false;
                    aMoneyRecpt.Visible  = false;
                    CrnLnk.Visible       = false;
                    RcvdLnk.Visible      = false;
                    e.Row.ForeColor      = System.Drawing.Color.Red;
                    //e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    btnStatus.Visible        = true;
                    aPrint.Visible           = true;
                    aAddCrdtNote.Visible     = true;
                    aMoneyRecpt.Visible      = true;
                    CrnLnk.Visible           = true;
                    RcvdLnk.Visible          = true;
                    e.Row.Cells[0].ForeColor = System.Drawing.Color.Black;
                }
            }


            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                IUser       user     = (IUser)Session[Constants.SESSION_USER_INFO];
                HiddenField hdnInvID = (HiddenField)e.Row.FindControl("hdnInvID");
                System.Web.UI.HtmlControls.HtmlAnchor aPrint = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("aPrint");
                //aPrint.Visible = false;
                aPrint.Attributes.Add("onclick", string.Format("return ReportPrint1('{0}','{1}','{2}','{3}','{4}');",
                                                               "reportName=" + EMS.Utilities.GeneralFunctions.EncryptQueryString("ExportInvoice"),
                                                               "&LineBLNo=" + EMS.Utilities.GeneralFunctions.EncryptQueryString(txtBlNo.Text),
                                                               "&Location=" + EMS.Utilities.GeneralFunctions.EncryptQueryString(ddlLocation.SelectedValue),
                                                               "&LoginUserName="******" " + user.LastName),
                                                               "&InvoiceId=" + EMS.Utilities.GeneralFunctions.EncryptQueryString(hdnInvID.Value)));
            }
        }
Beispiel #6
0
        ///// <summary>chen
        ///// 流程类型选择事件
        ///// </summary>
        ///// <param name="sender"></param>
        ///// <param name="e"></param>
        //protected void ddlProcessTemplate_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    if (this.ddlProcessTemplate.SelectedIndex == 0)
        //    {
        //        this.ddlStepName.Enabled = false;
        //        this.ddlStepName.Items.Clear();
        //    }
        //    else
        //    {
        //        this.ddlStepName.Enabled = true;

        //        //得到流程类型对应的流程步骤
        //        TemplateAdmin TAdmin = new TemplateAdmin();
        //        String l_strTemplateName = this.ddlProcessTemplate.SelectedValue;
        //        DataTable l_dtbDataTable = TAdmin.Templates.GetTemplate(l_strTemplateName).GetVersion(1).GetViewList();

        //        //加入空选择行
        //        DataRow l_dtrDataRow = l_dtbDataTable.NewRow();
        //        l_dtrDataRow[0] = DBNull.Value;
        //        l_dtrDataRow[1] = "";
        //        l_dtrDataRow[2] = DBNull.Value;

        //        l_dtbDataTable.Rows.InsertAt(l_dtrDataRow, 0);

        //        //绑定数据
        //        this.ddlStepName.DataSource = l_dtbDataTable;
        //        this.ddlStepName.DataBind();
        //    }
        //    LoadTaskList();
        //}

        protected void gvTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            DataRowView l_drvRowView = e.Row.DataItem as DataRowView;

            if (OAConfig.GetConfig(ConstString.Config.Section.Start_WORKFLOW_AGENT, ConstString.Config.Key.IS_START) == "1" && e.Row.RowType == DataControlRowType.DataRow)
            {
                (e.Row.FindControl("lblAgentUserName") as Label).Text = l_drvRowView["AgentUserName"].ToString();
            }

            DistinctUrgentDegree(l_drvRowView["UrgentDegree"], e.Row.Cells[0]);

            String    l_strCategory      = l_drvRowView["Category"].ToString();
            String    l_strReceiveUserID = l_drvRowView["ReceiveUserID"].ToString();
            string    strStatus          = l_drvRowView["D_StepStatus"].ToString();
            HyperLink l_hlkView          = e.Row.FindControl("hlkView") as HyperLink;

            l_hlkView.NavigateUrl = String.Format("../../Container.aspx?TemplateName={0}&ProcessID={1}&WorkItemID={2}&StepName={3}&TBID={4}&IsHistory=1", l_drvRowView["DEF_NAME"].ToString(), l_drvRowView["ProcessID"].ToString(), l_drvRowView["WorkItemID"].ToString(), l_drvRowView["StepName"].ToString(), l_drvRowView["ID"].ToString());
            e.Row.Cells[1].Controls.Add(l_hlkView);
            switch (l_strCategory)
            {
            case "已阅":
                e.Row.Cells[2].Text   = "<font style='color:#0080FF'>已阅</font>";
                l_hlkView.NavigateUrl = String.Format("../../Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Circulate.PG_Circulate&TemplateName={0}&ProcessID={1}&WorkItemID={2}&TBID={3}&CirculateID={4}&IsRead=True&RDT={5:yyyy/MM/dd hh时mm分ss秒}&IsHistory=1&MS=3&ID={4}", l_drvRowView["DEF_NAME"].ToString(), l_drvRowView["ProcessID"].ToString(), l_drvRowView["WorkItemID"].ToString(), l_drvRowView["ID"].ToString(), l_drvRowView["CirculateID"].ToString(), l_drvRowView["SendDateTime"].ToString());
                break;

            case "已办":
                e.Row.Cells[2].Text = "<font style='color:#FF00FF'>已办</font>";
                break;

            case "公办":
                if (strStatus == "Completed")
                {
                    e.Row.Cells[2].Text = "<font style='color:#2633DE'>自己公办</font>";
                }
                else
                {
                    e.Row.Cells[2].Text = "<font style='color:green'>他人公办</font>";
                }
                break;

            default:
                break;
            }
            //添加关联函件
            if (l_drvRowView["DEF_NAME"].ToString().Contains("函件收文") || l_drvRowView["DEF_NAME"].ToString().Contains("函件发文"))
            {
                System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchor = new System.Web.UI.HtmlControls.HtmlAnchor();
                l_htmlAnchor.InnerText = "查看";
                l_htmlAnchor.Target    = "_blank";
                l_htmlAnchor.HRef      = @"../Process/PG_ProcessRelation.aspx?ProcessType=" + l_drvRowView["DEF_NAME"].ToString() + "&ProcessID=" + l_drvRowView["ProcessID"].ToString();
                e.Row.Cells[14].Controls.Add(l_htmlAnchor);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Set link attributes to Branch link
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdFence_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Literal litDimensions = (Literal)e.Row.FindControl("litDimensions");
                decimal fenceLength   = (decimal)DataBinder.Eval(e.Row.DataItem, "DIMEN_LENGTH");
                decimal fenceHeight   = (decimal)DataBinder.Eval(e.Row.DataItem, "DIMEN_WIDTH");

                litDimensions.Text = (fenceLength * fenceHeight).ToString();

                Literal litDepreciatedValue = (Literal)e.Row.FindControl("litDepreciatedValue");
                // Literal litAmountPaid = (Literal)e.Row.FindControl("litAmountPaid");

                decimal DepreciatedValue = (decimal)DataBinder.Eval(e.Row.DataItem, "DEPRECIATEDVALUE");
                //decimal AmountPaid = (decimal)DataBinder.Eval(e.Row.DataItem, "AMOUNTPAID");

                litDepreciatedValue.Text = UtilBO.CurrencyFormat(DepreciatedValue);
                // litAmountPaid.Text = UtilBO.CurrencyFormat(AmountPaid);


                Literal PAPOtherFixID = (Literal)e.Row.FindControl("litUserID");
                System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto");
                System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto   = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto");

                int    ProjectID         = 0;
                int    HHID              = 0;
                int    userID            = 0;
                string ProjectCode       = string.Empty;
                string PermanentStructId = PAPOtherFixID.Text.ToString();

                if (Session["PROJECT_ID"] != null)
                {
                    ProjectID = Convert.ToInt32(Session["PROJECT_ID"]);
                }
                if (Session["HH_ID"] != null)
                {
                    HHID = Convert.ToInt32(Session["HH_ID"]);
                }
                if (Session["USER_ID"] != null)
                {
                    userID = Convert.ToInt32(Session["USER_ID"]);
                }
                if (Session["PROJECT_CODE"] != null)
                {
                    ProjectCode = Session["PROJECT_CODE"].ToString();
                }
                string PhotoModule = "PAPOHFIX";

                string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto);

                string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkViewPhoto.Attributes.Add("onclick", paramPhotoView);
            }
        }
        protected void relatedImages_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //get the ImageReference object that is bound to the current row.
                ImageReference imageDetails = (ImageReference)e.Item.DataItem;

                if (imageDetails != null)
                {
                    System.Web.UI.HtmlControls.HtmlImage termImage = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("termImage");
                    if (termImage != null)
                    {
                        termImage.Alt = imageDetails.AltText;

                        if (!string.IsNullOrEmpty(imageDetails.Filename))
                        {
                            System.Web.UI.HtmlControls.HtmlAnchor termEnlargeImage = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("termEnlargeImage");

                            //if either the regular image size or the enlarge image size is not in the config file
                            //default to the full image in the database
                            if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageRegular"]) || string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageEnlarge"]))
                            {
                                termImage.Src = imageDetails.Filename;

                                if (termEnlargeImage != null)
                                {
                                    termEnlargeImage.HRef      = imageDetails.Filename;
                                    termEnlargeImage.InnerText = dictionaryLanguage == "es" ? "Ampliar" : "Enlarge";
                                }

                                //log a warning
                                log.WarnFormat("Web.Config file does not specify image sizes for term id: {0}. Display full image.", CdrID);
                            }
                            else
                            {
                                string[] regularTermImage = imageDetails.Filename.Split('.');
                                if (regularTermImage.Length == 2)
                                {
                                    //termImage image size is 571
                                    //example format CDR526538-571.jpg
                                    termImage.Src = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageRegular"] + "." + regularTermImage[1];

                                    //enlarge image size is 750
                                    //example format CDR526538-750.jpg
                                    if (termEnlargeImage != null)
                                    {
                                        termEnlargeImage.HRef      = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageEnlarge"] + "." + regularTermImage[1];
                                        termEnlargeImage.InnerText = dictionaryLanguage == "es" ? "Ampliar" : "Enlarge";
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        protected void termDictionaryDefinitionView_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //get the TermReturn object that is bound to the current row.
                DictionaryTerm termDetails = (DictionaryTerm)e.Item.DataItem;

                if (termDetails != null)
                {
                    PlaceHolder phPronunciation = (PlaceHolder)e.Item.FindControl("phPronunciation");
                    if (termDetails.HasPronunciation && phPronunciation != null)
                    {
                        phPronunciation.Visible = true;
                        System.Web.UI.HtmlControls.HtmlAnchor pronunciationLink = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("pronunciationLink");

                        Label pronunciationKey = (Label)e.Item.FindControl("pronunciationKey");
                        if (pronunciationKey != null && termDetails.Pronunciation.HasKey)
                        {
                            pronunciationKey.Text = " " + termDetails.Pronunciation.Key;
                        }
                    }
                    else
                    {
                        phPronunciation.Visible = false;
                    }

                    //Get Related Information from the Manager layer
                    //Add check to see if it exists and then display data accordingly
                    Panel pnlRelatedInfo = e.Item.FindControl("pnlRelatedInfo") as Panel;
                    if (pnlRelatedInfo != null)
                    {
                        //display the related information panel
                        //when atleast one of the related item exists
                        if (termDetails.Images.Length > 0)
                        {
                            pnlRelatedInfo.Visible = true;

                            Repeater relatedImages = (Repeater)e.Item.FindControl("relatedImages");
                            if (relatedImages != null)
                            {
                                if (termDetails.Images.Length > 0)
                                {
                                    relatedImages.Visible    = true;
                                    relatedImages.DataSource = termDetails.Images;
                                    relatedImages.DataBind();
                                }
                            }
                        }
                        else
                        {
                            pnlRelatedInfo.Visible = false;
                        }
                    }
                }
            }
        }
Beispiel #10
0
        /// <summary>
        /// to set controls in grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdDamagedCrops_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DateTime dateDamaged = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "DATEDAMAGED"));
                if (dateDamaged != DateTime.MinValue)
                {
                    ((Literal)e.Row.FindControl("litDateDamaged")).Text = dateDamaged.ToString(UtilBO.DateFormat);
                }

                Literal litCropRate   = (Literal)e.Row.FindControl("litCropRate");
                Literal litAmountPaid = (Literal)e.Row.FindControl("litAmountPaid");

                decimal CropRate   = (decimal)DataBinder.Eval(e.Row.DataItem, "CROPRATE");
                decimal AmountPaid = (decimal)DataBinder.Eval(e.Row.DataItem, "AMOUNTPAID");

                litCropRate.Text   = UtilBO.CurrencyFormat(CropRate);
                litAmountPaid.Text = UtilBO.CurrencyFormat(AmountPaid);

                Literal DamagedCropID = (Literal)e.Row.FindControl("damagedCropId");
                System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto");
                System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto   = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto");

                int    ProjectID         = 0;
                int    HHID              = 0;
                int    userID            = 0;
                string ProjectCode       = string.Empty;
                string PermanentStructId = DamagedCropID.Text.ToString();

                if (Session["PROJECT_ID"] != null)
                {
                    ProjectID = Convert.ToInt32(Session["PROJECT_ID"]);
                }
                if (Session["HH_ID"] != null)
                {
                    HHID = Convert.ToInt32(Session["HH_ID"]);
                }
                if (Session["USER_ID"] != null)
                {
                    userID = Convert.ToInt32(Session["USER_ID"]);
                }
                if (Session["PROJECT_CODE"] != null)
                {
                    ProjectCode = Session["PROJECT_CODE"].ToString();
                }
                string PhotoModule = "DAMAGEDCROPS";

                string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto);

                string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkViewPhoto.Attributes.Add("onclick", paramPhotoView);
            }
        }
Beispiel #11
0
 /// <summary>
 /// to link to another page onclick of lnkEvalElement
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gvGoalEval_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         System.Web.UI.HtmlControls.HtmlAnchor lnkEvalElement = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkEvalElement");
         int    evalID   = (int)DataBinder.Eval(e.Row.DataItem, "EvaluationID");
         string goalName = (string)DataBinder.Eval(e.Row.DataItem, "GoalName");
         lnkEvalElement.Attributes.Add("onclick", "OpenEvalElements('" + evalID + "','" + goalName + "');");
     }
 }
Beispiel #12
0
        /// <summary>
        /// to open new page on click on link in grid
        /// </summary>
        protected void gvCropName_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkCropRate = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkCropRate");
                int cropID = (int)DataBinder.Eval(e.Row.DataItem, "CROPID");

                lnkCropRate.Attributes.Add("onclick", "OpenCropRate(" + cropID + ");");
            }
        }
Beispiel #13
0
        /// <summary>
        /// Set link attributes to Branch link
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdBanks_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkBank = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkBank");
                int BankID = (int)DataBinder.Eval(e.Row.DataItem, "bankID");

                lnkBank.Attributes.Add("onclick", "OpenBranchBank(" + BankID + ");");
            }
        }
Beispiel #14
0
        /// <summary>
        /// Set link attributes to Branch link
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvTribe_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkClan = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkClan");
                int CLANID = (int)DataBinder.Eval(e.Row.DataItem, "TRIBEID");

                lnkClan.Attributes.Add("onclick", "OpenClans(" + CLANID + ");");
            }
        }
Beispiel #15
0
        /// <summary>
        /// to link to other page on click of link  in grid
        /// </summary>
        /// <returns></returns>

        protected void grdBudgetCategory_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkSubCategory = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkSubCategory");
                int lIV_BUD_CATEGID = (int)DataBinder.Eval(e.Row.DataItem, "lIV_BUD_CATEGID");

                lnkSubCategory.Attributes.Add("onclick", "OpenSubCategories(" + lIV_BUD_CATEGID + ");");
            }
        }
Beispiel #16
0
        /// <summary>
        /// Set link attributes to  link
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdCategory_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkCropRate = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkSubCategory");
                int BGT_CATEGORYID = (int)DataBinder.Eval(e.Row.DataItem, "BGT_CATEGORYID");

                lnkCropRate.Attributes.Add("onclick", "OpenSubCategory(" + BGT_CATEGORYID + ");");
            }
        }
Beispiel #17
0
        protected void Link_OnClick(Object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlAnchor mySender = (System.Web.UI.HtmlControls.HtmlAnchor)sender;
            string senderName      = mySender.ID;
            int    categoryClicked = int.Parse(senderName[3].ToString());
            string categoryName    = categoryNames[categoryClicked];

            Session["Category"] = categoryName;
            Response.Redirect("CategoryPage.aspx");
        }
Beispiel #18
0
        protected void gvProcessList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            DataRowView l_drvRowView = e.Row.DataItem as DataRowView;

            //流程图
            Image img = new Image();

            img.Attributes.Add("onclick", "window.open('/AgilePoint/ProcessViewer.aspx?PIID=" + l_drvRowView["Proc_Inst_ID"].ToString() + "');");
            img.ImageUrl = "../../AgilePoint/resource/en-us/Task.gif";
            img.Style.Add("cursor", "hand");

            //传阅单
            System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchor = new System.Web.UI.HtmlControls.HtmlAnchor();
            l_htmlAnchor.InnerText = "传阅单";
            l_htmlAnchor.HRef      = "#";
            l_htmlAnchor.Attributes.Add("onclick", @"javascript: window.open('/WorkflowMenu/Circulate/ChuanYueDan.aspx?ProcessID=" + l_drvRowView["PROC_INST_ID"].ToString() + "&TemplateName=" + l_drvRowView["PDEF_NAME"].ToString() + "','', 'width=600,height=500,toolbar=no,scrollbars=yes,menubar=no,resizable=yes');event.returnValue=false;");

            e.Row.Cells[1].Text = GetProcessStatus(l_drvRowView["Status"]);

            //添加关联函件
            System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchorRelation = new System.Web.UI.HtmlControls.HtmlAnchor();
            if (l_drvRowView["PDEF_NAME"].ToString().Contains("函件收文") || l_drvRowView["PDEF_NAME"].ToString().Contains("函件发文"))
            {
                l_htmlAnchorRelation.InnerText = "查看";
                l_htmlAnchorRelation.Target    = "_blank";
                l_htmlAnchorRelation.HRef      = @"../Process/PG_ProcessRelation.aspx?ProcessType=" + l_drvRowView["PDEF_NAME"].ToString() + "&ProcessID=" + l_drvRowView["Proc_Inst_ID"].ToString();
            }

            if (this.gvProcessList.Columns.Count > 13)
            {
                e.Row.Cells[10].Controls.Add(img);
                e.Row.Cells[12].Controls.Add(l_htmlAnchor);
            }
            else if (this.gvProcessList.Columns.Count > 12)
            {
                e.Row.Cells[9].Controls.Add(img);
                e.Row.Cells[11].Controls.Add(l_htmlAnchor);
            }
            else if (this.gvProcessList.Columns.Count > 11)
            {
                e.Row.Cells[8].Controls.Add(img);
                e.Row.Cells[10].Controls.Add(l_htmlAnchor);
            }
            else
            {
                e.Row.Cells[7].Controls.Add(img);
                e.Row.Cells[9].Controls.Add(l_htmlAnchor);
            }
            e.Row.Cells[this.gvProcessList.Columns.Count - 1].Controls.Add(l_htmlAnchorRelation);
        }
Beispiel #19
0
        /// <summary>
        /// to set controls in grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdCultureProperties_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlAnchor lnkMeeting = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkMeeting");

                int CULTURALPROPID = (int)DataBinder.Eval(e.Row.DataItem, "CULTURALPROPID");

                lnkMeeting.Attributes.Add("onclick", "OpenMeeting(" + CULTURALPROPID + ");");


                Literal litValuationAmount = (Literal)e.Row.FindControl("litValuationAmount");

                decimal ValuationAmount = (decimal)DataBinder.Eval(e.Row.DataItem, "CULT_VALUATIONAMOUNT");

                litValuationAmount.Text = UtilBO.CurrencyFormat(ValuationAmount);

                //Literal PAPFenceID = (Literal)e.Row.FindControl("litUserID");
                System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto");
                System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto   = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto");

                int    ProjectID         = 0;
                int    HHID              = 0;
                int    userID            = 0;
                string ProjectCode       = string.Empty;
                string PermanentStructId = CULTURALPROPID.ToString();

                if (Session["PROJECT_ID"] != null)
                {
                    ProjectID = Convert.ToInt32(Session["PROJECT_ID"]);
                }
                if (Session["HH_ID"] != null)
                {
                    HHID = Convert.ToInt32(Session["HH_ID"]);
                }
                if (Session["USER_ID"] != null)
                {
                    userID = Convert.ToInt32(Session["USER_ID"]);
                }
                if (Session["PROJECT_CODE"] != null)
                {
                    ProjectCode = Session["PROJECT_CODE"].ToString();
                }
                string PhotoModule = "PAPCP";

                string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto);

                string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkViewPhoto.Attributes.Add("onclick", paramPhotoView);
            }
        }
Beispiel #20
0
        /// <summary>
        /// Renders the HTML anchor.
        /// </summary>
        /// <param name="writer">The writer.</param>
        protected virtual void RenderHtmlAnchor(HtmlTextWriter writer)
        {
            var htmlLink = new System.Web.UI.HtmlControls.HtmlAnchor
            {
                HRef      = this.Field.Content.Path,
                Target    = "_blank",
                InnerText = this.Field.Content.Name
            };

            htmlLink.RenderControl(writer);
        }
Beispiel #21
0
        public void viewimages(string spname, Int32 id, System.Web.UI.HtmlControls.HtmlAnchor sss)
        {
            try
            {
                string        cs  = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
                SqlConnection con = new SqlConnection(cs);

                SqlCommand cmd = new SqlCommand(spname, con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter imgdata = new SqlParameter("@imgdata", SqlDbType.VarBinary, -1)
                {
                    Direction = ParameterDirection.Output
                };
                SqlParameter imgnam = new SqlParameter("@imgname", SqlDbType.VarChar, 50)
                {
                    Direction = ParameterDirection.Output
                };
                SqlParameter imgty = new SqlParameter("@imgty", SqlDbType.VarChar, 50)
                {
                    Direction = ParameterDirection.Output
                };
                cmd.Parameters.Add(imgdata);
                cmd.Parameters.Add(imgnam);
                cmd.Parameters.Add(imgty);

                cmd.Parameters.AddWithValue("@id", id);

                con.Open();
                cmd.ExecuteScalar();

                byte[] img  = (byte[])(imgdata.Value);
                string type = imgty.Value.ToString();
                string name = imgnam.Value.ToString().ToLower().Replace(".jpg", "").Replace(".png", "").Replace(".gif", "").Replace(".jpeg", "");
                string ty   = type.Split('.')[1].ToLower();



                string base64String = Convert.ToBase64String(img, 0, img.Length);

                sss.HRef = "data:image/" + ty + ";base64," + base64String;
            }
            catch (System.Threading.ThreadAbortException lException)
            {
            }
            catch (Exception db)
            {
                String ss   = db.Message.ToString();
                string sw   = db.Source.ToString();
                string sddd = db.HResult.ToString();
                AHRMS1.usae.specpersonusr.errorlog(ss, sw, sddd);
                Response.Redirect("~/error.aspx", true);
            }
        }
Beispiel #22
0
        protected void lbtnRemoveWoreda_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlAnchor lb = (System.Web.UI.HtmlControls.HtmlAnchor)sender;
            List <woreda> classWoreda = (List <woreda>)ViewState["ClassWoreda"];

            classWoreda.RemoveAll(w => w.WoredaID == lb.Attributes["woredaid"]);
            ViewState["ClassWoreda"] = classWoreda;

            gvClassWereda.DataSource = classWoreda;
            gvClassWereda.DataBind();
        }
Beispiel #23
0
        protected void lbtnRemoveInsp_Click(object sender, EventArgs e)
        {
            List <InventoryInspector> invInsectors = inventoryInspectors;

            System.Web.UI.HtmlControls.HtmlAnchor lb = (System.Web.UI.HtmlControls.HtmlAnchor)sender;
            invInsectors.RemoveAll(i => i.InspectorID.ToString().Equals(lb.Attributes["inspectorid"]));
            ViewState.Add("InventoryInspectors", invInsectors);
            gvInventoryInspectors.DataSource = inventoryInspectors;
            gvInventoryInspectors.DataBind();
            Messages1.ClearMessage();
            upMessage.Update();
        }
Beispiel #24
0
 private static void link_set(
     System.Web.UI.WebControls.Label label_in,
     System.Web.UI.HtmlControls.HtmlAnchor anchor_in,
     long page_in
     )
 {
     label_in.Visible = true;
     link_set(
         anchor_in,
         page_in
         );
 }
Beispiel #25
0
 private static void link_set(
     System.Web.UI.HtmlControls.HtmlAnchor anchor_in,
     long page_in
     )
 {
     anchor_in.InnerText = page_in.ToString(System.Globalization.CultureInfo.CurrentCulture);
     anchor_in.HRef      = string.Format(
         System.Globalization.CultureInfo.CurrentCulture,
         "?page={0}",
         page_in
         );
     anchor_in.Visible = true;
 }
Beispiel #26
0
        /// <summary>
        /// Set link attributes to link
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdPermanentBuilding_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Literal litDepreciatedValue = (Literal)e.Row.FindControl("litDepreciatedValue");
                Literal litReplacementValue = (Literal)e.Row.FindControl("litReplacementValue");

                decimal depreciatedValue = (decimal)DataBinder.Eval(e.Row.DataItem, "DEPRECIATEDVALUE");
                decimal replacementValue = (decimal)DataBinder.Eval(e.Row.DataItem, "REPLACEMENTVALUE");

                litDepreciatedValue.Text = UtilBO.CurrencyFormat(depreciatedValue);
                litReplacementValue.Text = UtilBO.CurrencyFormat(replacementValue);


                Literal PermanentStrucID = (Literal)e.Row.FindControl("PermanentStrucID");
                System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto");
                System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto   = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto");

                int    ProjectID         = 0;
                int    HHID              = 0;
                int    userID            = 0;
                string ProjectCode       = string.Empty;
                string PermanentStructId = PermanentStrucID.Text.ToString();

                if (Session["PROJECT_ID"] != null)
                {
                    ProjectID = Convert.ToInt32(Session["PROJECT_ID"]);
                }
                if (Session["HH_ID"] != null)
                {
                    HHID = Convert.ToInt32(Session["HH_ID"]);
                }
                if (Session["USER_ID"] != null)
                {
                    userID = Convert.ToInt32(Session["USER_ID"]);
                }
                if (Session["PROJECT_CODE"] != null)
                {
                    ProjectCode = Session["PROJECT_CODE"].ToString();
                }
                string PhotoModule = "PAPPB";

                string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto);

                string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkViewPhoto.Attributes.Add("onclick", paramPhotoView);
            }
        }
Beispiel #27
0
    protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string      name   = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Name"));
            ImageButton button = (ImageButton)e.Row.FindControl("btn_del");
            button.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this file?');");

            System.Web.UI.HtmlControls.HtmlAnchor buttonselect = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("btn_select");
            buttonselect.Attributes.Add("href", "../../Upload/BustaPaga/" + name);
            buttonselect.Attributes.Add("target", "_blank");
            buttonselect.Attributes.Add("style", "display: inline-flex;");
        }
    }
Beispiel #28
0
        protected void grdCrops_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Literal litDimensions = (Literal)e.Row.FindControl("litDimensions");
                decimal Quantity      = (decimal)DataBinder.Eval(e.Row.DataItem, "QUANTITY");
                decimal CropRate      = (decimal)DataBinder.Eval(e.Row.DataItem, "CROPRATE");

                litDimensions.Text = UtilBO.CurrencyFormat(Quantity * CropRate);

                Literal litCroprate = (Literal)e.Row.FindControl("litCroprate");
                litCroprate.Text = UtilBO.CurrencyFormat(CropRate);

                Literal PAPCropID = (Literal)e.Row.FindControl("PapCropId");
                System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto");
                System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto   = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto");

                int    ProjectID         = 0;
                int    HHID              = 0;
                int    userID            = 0;
                string ProjectCode       = string.Empty;
                string PermanentStructId = PAPCropID.Text.ToString();

                if (Session["PROJECT_ID"] != null)
                {
                    ProjectID = Convert.ToInt32(Session["PROJECT_ID"]);
                }
                if (Session["HH_ID"] != null)
                {
                    HHID = Convert.ToInt32(Session["HH_ID"]);
                }
                if (Session["USER_ID"] != null)
                {
                    userID = Convert.ToInt32(Session["USER_ID"]);
                }
                if (Session["PROJECT_CODE"] != null)
                {
                    ProjectCode = Session["PROJECT_CODE"].ToString();
                }
                string PhotoModule = "PAPCROP";

                string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto);

                string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId);

                lnkViewPhoto.Attributes.Add("onclick", paramPhotoView);
            }
        }
Beispiel #29
0
        private void DisplayList()
        {
            phList.Visible    = true;
            phDetails.Visible = false;
            phRoles.Controls.Clear();

            foreach (string roleName in System.Web.Security.Roles.GetAllRoles())
            {
                System.Web.UI.HtmlControls.HtmlAnchor a = new System.Web.UI.HtmlControls.HtmlAnchor();
                a.HRef      = "Role/Edit/" + roleName;
                a.InnerText = roleName;
                phRoles.Controls.Add(a);
                phRoles.Controls.Add(new LiteralControl("<br/>"));
            }
        }
Beispiel #30
0
        private void DisplayList()
        {
            phList.Visible = true;
            phDetails.Visible = false;
            phRoles.Controls.Clear();

            foreach ( string roleName in System.Web.Security.Roles.GetAllRoles() )
            {
                System.Web.UI.HtmlControls.HtmlAnchor a = new System.Web.UI.HtmlControls.HtmlAnchor();
                a.HRef = "Role/Edit/" + roleName;
                a.InnerText = roleName;
                phRoles.Controls.Add( a );
                phRoles.Controls.Add( new LiteralControl( "<br/>" ) );
            }
        }
        private void addScanUrlToButton(System.Web.UI.HtmlControls.HtmlAnchor btn, int docType, int docStatus, System.Web.UI.HtmlControls.HtmlGenericControl panel, int reqID)
        {
            int       codeOstad = Convert.ToInt32(Session[sessionNames.userID_StudentOstad]);
            DataTable dt        = ProfReqBuss.getProfessorRequests_Scan(codeOstad, docStatus, reqID);

            if (dt.Rows.Count > 0)
            {
                DataRow[] dr = dt.Select("doctype=" + docType);
                if (dr.Length == 1)
                {
                    try
                    {
                        if (dr[0]["scanUrl"] == DBNull.Value)
                        {
                            return;
                        }
                        panel.Visible = true;
                        btn.Visible   = true;
                        if (dr[0]["scanImage"] == DBNull.Value)
                        {
                            return;
                        }
                        string path = "";
                        if (dr[0]["scanUrl"].ToString().StartsWith("~"))
                        {
                            path = Server.MapPath(dr[0]["scanUrl"].ToString());
                        }
                        else
                        {
                            path = dr[0]["scanUrl"].ToString();
                        }

                        if (!Directory.Exists(path.Substring(0, path.LastIndexOf("\\"))))
                        {
                            Directory.CreateDirectory(path.Substring(0, path.LastIndexOf("\\")));
                        }
                        if (!File.Exists(path))
                        {
                            var stream = new MemoryStream((byte[])dr[0]["scanImage"]);
                            var image  = System.Drawing.Image.FromStream(stream);
                            image.Save(path);
                        }
                        btn.HRef = "../OpenScanImage.aspx" + "?o=" + codeOstad + "&f=" + dr[0]["scanUrl"].ToString().Substring(dr[0]["scanUrl"].ToString().IndexOf(substringScanFile) + substringScanFile.Length + 1);
                    }
                    catch (Exception ex) { btn.Visible = false; }
                }
            }
        }
Beispiel #32
0
Datei: Tab.cs Projekt: VKeCRM/V2
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor();
            anchor.InnerHtml = InnerHTML;
            anchor.HRef = "javascript:void(0);";
            anchor.Attributes.Add("class", AnchorCssClass);

            string clickEvent = !string.IsNullOrEmpty(Attributes["onclick"]) ? Attributes["onclick"] : ClientTabClick;
            if(!string.IsNullOrEmpty(clickEvent))
                anchor.Attributes.Add("onclick", clickEvent);

            Attributes.Remove("onclick");

            Controls.Add(anchor);
        }
Beispiel #33
0
 /// <summary>
 /// Renders the HTML anchor.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected virtual void RenderHtmlAnchor(HtmlTextWriter writer)
 {
     var htmlLink = new System.Web.UI.HtmlControls.HtmlAnchor
     {
         HRef = this.Field.Content.Path,
         Target = "_blank",
         InnerText = this.Field.Content.Name
     };
     htmlLink.RenderControl(writer);
 }
		void CreateSideBar (TableCell sideBarCell)
		{
			RegisterApplyStyle (sideBarCell, SideBarStyle);

			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.HRef = "#" + ClientID + "_SkipLink";

				Image img = new Image ();
				ClientScriptManager csm = new ClientScriptManager (null);
				img.ImageUrl = csm.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif");
				img.Attributes.Add ("height", "0");
				img.Attributes.Add ("width", "0");
				img.AlternateText = SkipLinkText;

				anchor.Controls.Add (img);
				sideBarCell.Controls.Add (anchor);
			}

			if (sideBarTemplate != null) {
				sideBarTemplate.InstantiateIn (sideBarCell);
				stepDatalist = sideBarCell.FindControl (DataListID) as DataList;
				if (stepDatalist == null)
					throw new InvalidOperationException ("The side bar template must contain a DataList control with id '" + DataListID + "'.");
				stepDatalist.ItemDataBound += new DataListItemEventHandler(StepDatalistItemDataBound);
			} else {
				stepDatalist = new DataList ();
				stepDatalist.ID = DataListID;
				stepDatalist.SelectedItemStyle.Font.Bold = true;
				stepDatalist.ItemTemplate = SideBarItemTemplate;
				sideBarCell.Controls.Add (stepDatalist);
			}

			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.ID = "SkipLink";
				sideBarCell.Controls.Add (anchor);
			}

			stepDatalist.ItemCommand += new DataListCommandEventHandler (StepDatalistItemCommand);
			stepDatalist.CellSpacing = 0;
			stepDatalist.DataSource = WizardSteps;
			stepDatalist.SelectedIndex = ActiveStepIndex;
			stepDatalist.DataBind ();
		}
        ///// <summary>chen
        ///// 流程类型选择事件
        ///// </summary>
        ///// <param name="sender"></param>
        ///// <param name="e"></param>
        //protected void ddlProcessTemplate_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    if (this.ddlProcessTemplate.SelectedIndex == 0)
        //    {
        //        this.ddlStepName.Enabled = false;
        //        this.ddlStepName.Items.Clear();
        //    }
        //    else
        //    {
        //        this.ddlStepName.Enabled = true;
        //        //得到流程类型对应的流程步骤
        //        TemplateAdmin TAdmin = new TemplateAdmin();
        //        String l_strTemplateName = this.ddlProcessTemplate.SelectedValue;
        //        DataTable l_dtbDataTable = TAdmin.Templates.GetTemplate(l_strTemplateName).GetVersion(1).GetViewList();
        //        //加入空选择行
        //        DataRow l_dtrDataRow = l_dtbDataTable.NewRow();
        //        l_dtrDataRow[0] = DBNull.Value;
        //        l_dtrDataRow[1] = "";
        //        l_dtrDataRow[2] = DBNull.Value;
        //        l_dtbDataTable.Rows.InsertAt(l_dtrDataRow, 0);
        //        //绑定数据
        //        this.ddlStepName.DataSource = l_dtbDataTable;
        //        this.ddlStepName.DataBind();
        //    }
        //    LoadTaskList();
        //}
        protected void gvTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            DataRowView l_drvRowView = e.Row.DataItem as DataRowView;

            if (OAConfig.GetConfig(ConstString.Config.Section.Start_WORKFLOW_AGENT, ConstString.Config.Key.IS_START) == "1" && e.Row.RowType == DataControlRowType.DataRow)
            {
                (e.Row.FindControl("lblAgentUserName") as Label).Text = l_drvRowView["AgentUserName"].ToString();
            }

            DistinctUrgentDegree(l_drvRowView["UrgentDegree"], e.Row.Cells[0]);

            String l_strCategory = l_drvRowView["Category"].ToString();
            String l_strReceiveUserID = l_drvRowView["ReceiveUserID"].ToString();
            string strStatus = l_drvRowView["D_StepStatus"].ToString();
            HyperLink l_hlkView = e.Row.FindControl("hlkView") as HyperLink;
            l_hlkView.NavigateUrl = String.Format("../../Container.aspx?TemplateName={0}&ProcessID={1}&WorkItemID={2}&StepName={3}&TBID={4}&IsHistory=1", l_drvRowView["DEF_NAME"].ToString(), l_drvRowView["ProcessID"].ToString(), l_drvRowView["WorkItemID"].ToString(), l_drvRowView["StepName"].ToString(),l_drvRowView["ID"].ToString());
            e.Row.Cells[1].Controls.Add(l_hlkView);
            switch (l_strCategory)
            {
                case "已阅":
                    e.Row.Cells[2].Text = "<font style='color:#0080FF'>已阅</font>";
                    l_hlkView.NavigateUrl = String.Format("../../Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Circulate.PG_Circulate&TemplateName={0}&ProcessID={1}&WorkItemID={2}&TBID={3}&CirculateID={4}&IsRead=True&RDT={5:yyyy/MM/dd hh时mm分ss秒}&IsHistory=1&MS=3&ID={4}", l_drvRowView["DEF_NAME"].ToString(), l_drvRowView["ProcessID"].ToString(), l_drvRowView["WorkItemID"].ToString(), l_drvRowView["ID"].ToString(), l_drvRowView["CirculateID"].ToString(), l_drvRowView["SendDateTime"].ToString());
                    break;
                case "已办":
                    e.Row.Cells[2].Text = "<font style='color:#FF00FF'>已办</font>";
                    break;
                case "公办":
                    if (strStatus == "Completed")
                    {
                        e.Row.Cells[2].Text = "<font style='color:#2633DE'>自己公办</font>";
                    }
                    else
                    {
                        e.Row.Cells[2].Text = "<font style='color:green'>他人公办</font>";
                    }
                    break;
                default:
                    break;
            }
            //添加关联函件
            if (l_drvRowView["DEF_NAME"].ToString().Contains("函件收文") || l_drvRowView["DEF_NAME"].ToString().Contains("函件发文"))
            {
                System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchor = new System.Web.UI.HtmlControls.HtmlAnchor();
                l_htmlAnchor.InnerText = "查看";
                l_htmlAnchor.Target = "_blank";
                l_htmlAnchor.HRef = @"../Process/PG_ProcessRelation.aspx?ProcessType=" + l_drvRowView["DEF_NAME"].ToString() + "&ProcessID=" + l_drvRowView["ProcessID"].ToString();
                e.Row.Cells[14].Controls.Add(l_htmlAnchor);
            }
        }
        protected void gvProcessList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            DataRowView l_drvRowView = e.Row.DataItem as DataRowView;

            //流程图
            Image img = new Image();
            img.Attributes.Add("onclick", "window.open('/AgilePoint/ProcessViewer.aspx?PIID=" + l_drvRowView["Proc_Inst_ID"].ToString() + "');");
            img.ImageUrl = "../../AgilePoint/resource/en-us/Task.gif";
            img.Style.Add("cursor", "hand");

            //传阅单
            System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchor = new System.Web.UI.HtmlControls.HtmlAnchor();
            l_htmlAnchor.InnerText = "传阅单";
            l_htmlAnchor.HRef = "#";
            l_htmlAnchor.Attributes.Add("onclick", @"javascript: window.open('/WorkflowMenu/Circulate/ChuanYueDan.aspx?ProcessID=" + l_drvRowView["PROC_INST_ID"].ToString() + "&TemplateName=" + l_drvRowView["PDEF_NAME"].ToString() + "','', 'width=600,height=500,toolbar=no,scrollbars=yes,menubar=no,resizable=yes');event.returnValue=false;");

            e.Row.Cells[1].Text = GetProcessStatus(l_drvRowView["Status"]);

            //添加关联函件
            System.Web.UI.HtmlControls.HtmlAnchor l_htmlAnchorRelation = new System.Web.UI.HtmlControls.HtmlAnchor();
            if (l_drvRowView["PDEF_NAME"].ToString().Contains("函件收文") || l_drvRowView["PDEF_NAME"].ToString().Contains("函件发文"))
            {
                l_htmlAnchorRelation.InnerText = "查看";
                l_htmlAnchorRelation.Target = "_blank";
                l_htmlAnchorRelation.HRef = @"../Process/PG_ProcessRelation.aspx?ProcessType=" + l_drvRowView["PDEF_NAME"].ToString() + "&ProcessID=" + l_drvRowView["Proc_Inst_ID"].ToString();
            }

            if (this.gvProcessList.Columns.Count > 13)
            {
                e.Row.Cells[10].Controls.Add(img);
                e.Row.Cells[12].Controls.Add(l_htmlAnchor);
            }
            else if (this.gvProcessList.Columns.Count > 12)
            {
                e.Row.Cells[9].Controls.Add(img);
                e.Row.Cells[11].Controls.Add(l_htmlAnchor);
            }
            else if (this.gvProcessList.Columns.Count > 11)
            {
                e.Row.Cells[8].Controls.Add(img);
                e.Row.Cells[10].Controls.Add(l_htmlAnchor);
            }
            else
            {
                e.Row.Cells[7].Controls.Add(img);
                e.Row.Cells[9].Controls.Add(l_htmlAnchor);
            }
            e.Row.Cells[this.gvProcessList.Columns.Count - 1].Controls.Add(l_htmlAnchorRelation);
        }
Beispiel #37
0
		public override void RenderEndTag (HtmlTextWriter writer)
		{
			base.RenderEndTag (writer);

			if (StaticDisplayLevels == 1 && MaximumDynamicDisplayLevels > 0)
				RenderDynamicMenu (writer, Items);

			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.ID = ClientID + "_SkipLink";
				anchor.Render (writer);
			}
		}
Beispiel #38
0
		public override void RenderBeginTag (HtmlTextWriter writer)
		{
			if (SkipLinkText != "") {
				System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
				anchor.HRef = "#" + ClientID + "_SkipLink";

				Image img = new Image ();
				ClientScriptManager csm = new ClientScriptManager (null);
				img.ImageUrl = csm.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif");
				img.Attributes.Add ("height", "0");
				img.Attributes.Add ("width", "0");
				img.AlternateText = SkipLinkText;

				anchor.Controls.Add (img);
				anchor.Render (writer);
			}
			base.RenderBeginTag (writer);
		}