protected void myview_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Label _st     = (Label)e.Item.FindControl("dr_statusLabel");
            Label _isdate = (Label)e.Item.FindControl("lbdate");
            Label _due    = (Label)e.Item.FindControl("lbdue");

            if (_st.Text == "True")
            {
                _st.Text = "OPEN";
            }
            else
            {
                _st.Text = "CLOSE";
            }
            if (_st.Text == "OPEN")
            {
                int due = 15;
                if (_isdate.Text != "")
                {
                    TimeSpan _days = DateTime.Now.Subtract(Convert.ToDateTime(_isdate.Text));
                    due = 15 - _days.Days;
                    //_due.Text = due.ToString();
                }
                if (due < 0)
                {
                    due *= -1;
                    Change_RowClr(e);
                    _due.Text = due.ToString();
                }
            }
            Button _edit = (Button)e.Item.FindControl("EditButton");

            if ((string)Session["group"] != "ADMIN GROUP" && (string)Session["group"] != "SYS.ADMIN GROUP")
            {
                _edit.Visible = false;
                if (lblprj.Text == "ABS")
                {
                    if (Session["ModuleAccess"].ToString() == "1")
                    {
                        _edit.Visible = true;
                    }
                }
            }
        }
        void lvEmptyPallets_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            m_emptyPalletCount = 0;
            ListView    lvItems               = e.Item.FindControl("lvItems") as ListView;
            Label       lblPalletTotal        = e.Item.FindControl("lblPalletTotal") as Label;
            Panel       pnlUpdateResource     = e.Item.FindControl("pnlUpdateResource") as Panel;
            Button      btnPalletMove         = e.Item.FindControl("btnPalletMove") as Button;
            HiddenField hidResourceID         = e.Item.FindControl("hidResourceID") as HiddenField;
            HiddenField hidPalletTypeID       = e.Item.FindControl("hidPalletTypeID") as HiddenField;
            RadComboBox rcbAlternateResources = e.Item.FindControl("rcbAlternateResources") as RadComboBox;

            int resourceID        = int.Parse(hidResourceID.Value);
            var specificResources = currentResources.Where <KeyValuePair <int, string> >(cr => cr.Key != resourceID);

            ListViewDataItem clvdi = e.Item as ListViewDataItem;

            if (specificResources.Count <KeyValuePair <int, string> >() > 0)
            {
                pnlUpdateResource.Visible = true;

                btnPalletMove.Attributes.Add("ResourceID", resourceID.ToString());
                btnPalletMove.Attributes.Add("ListItemIndex", clvdi.DataItemIndex.ToString());
                btnPalletMove.Attributes.Add("onclick", string.Format("realPostBack(\"{0}\", \"\"); return false;", btnPalletMove.UniqueID));

                rcbAlternateResources.DataSource = specificResources;
                rcbAlternateResources.DataBind();
            }
            else
            {
                pnlUpdateResource.Visible = false;
            }

            foreach (ListViewDataItem lvdi in lvItems.Items)
            {
                RadNumericTextBox rntNoOfPallets = lvdi.FindControl("rntNoOfPallets") as RadNumericTextBox;

                if (rntNoOfPallets != null)
                {
                    m_emptyPalletCount += (int)rntNoOfPallets.Value.Value;
                }
            }

            lblPalletTotal.Text = m_emptyPalletCount.ToString();
        }
        protected void lvwOrders_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                Order        od      = e.Item.DataItem as Order;
                Label        lblShip = e.Item.FindControl("lblShip") as Label;
                DropDownList dl      = e.Item.FindControl("ddlShip") as DropDownList;
                if (dl != null)
                {
                    dl.Items.Insert(0, "Undelivered");
                    dl.Items.Insert(1, "Delivered");
                }
                else
                if (od.Shipment == 1)
                {
                    lblShip.Text = "Delivered";
                    Label lblSP    = e.Item.FindControl("lblSP") as Label;
                    Label lblDate  = e.Item.FindControl("lblDate") as Label;
                    Label lblUser  = e.Item.FindControl("lblUser") as Label;
                    Label lblTotal = e.Item.FindControl("lblTotal") as Label;

                    lblSP.ForeColor    = System.Drawing.Color.Green;
                    lblDate.ForeColor  = System.Drawing.Color.Green;
                    lblUser.ForeColor  = System.Drawing.Color.Green;
                    lblTotal.ForeColor = System.Drawing.Color.Green;
                    lblShip.ForeColor  = System.Drawing.Color.Green;
                }
                else
                if (od.Shipment == 0)
                {
                    lblShip.Text = "Undelivered";
                    Label lblSP    = e.Item.FindControl("lblSP") as Label;
                    Label lblDate  = e.Item.FindControl("lblDate") as Label;
                    Label lblUser  = e.Item.FindControl("lblUser") as Label;
                    Label lblTotal = e.Item.FindControl("lblTotal") as Label;

                    lblSP.ForeColor    = System.Drawing.Color.Orange;
                    lblDate.ForeColor  = System.Drawing.Color.Orange;
                    lblUser.ForeColor  = System.Drawing.Color.Orange;
                    lblTotal.ForeColor = System.Drawing.Color.Orange;
                    lblShip.ForeColor  = System.Drawing.Color.Orange;
                }
            }
        }
Exemplo n.º 4
0
        //------------------------------------------------------------------------------------

        protected void lvItems_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            int              DifferenceAmountIndex = 18, DifferenceWeightIndex = 19;
            string           highlightChargeCell = "ChargesCell", highlightWeightCell = "WeightsCell";
            ListViewDataItem lv       = e.Item as ListViewDataItem;
            DataRow          dr       = lv.DataItem as DataRow;
            HtmlTableCell    statusCell = lv.FindControl("statusCell") as HtmlTableCell;
            HtmlAnchor       lnkOrder = lv.FindControl("lnkOrder") as HtmlAnchor;

            if (lv.ItemType == ListViewItemType.DataItem)
            {
                this.HighlightDifference(lv, highlightChargeCell, DifferenceAmountIndex);
                this.HighlightDifference(lv, highlightWeightCell, DifferenceWeightIndex);

                if (lnkOrder != null)
                {
                    if (dr["OrderID"] == DBNull.Value)
                    {
                        if (statusCell != null)
                        {
                            statusCell.BgColor   = "#FC445D"; //red - unmatched
                            statusCell.InnerText = "U";
                        }

                        lnkOrder.InnerText = "Match";
                        lnkOrder.HRef      = "javascript:matchOrder(" + dr["ImportedInvoiceItemID"] + ", " + dr["Ref2"] + ")";
                    }
                    else
                    {
                        lnkOrder.InnerText = dr["OrderID"].ToString();
                        lnkOrder.HRef      = "javascript:viewOrderProfile(" + dr["OrderID"] + ")";

                        if (dr["InvoiceId"] != DBNull.Value || dr["PreinvoiceId"] != DBNull.Value)
                        {
                            if (statusCell != null)
                            {
                                statusCell.BgColor   = "#F6FF00"; //yellow - invoiced
                                statusCell.InnerText = "I";
                            }
                        }
                    }
                }
            }
        }
        protected void ScheduleListView_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            var dataItem = e.Item as ListViewDataItem;

            if (dataItem == null || dataItem.DataItem == null)
            {
                return;
            }

            var scheduleItem = dataItem.DataItem as Entity;

            if (scheduleItem == null)
            {
                return;
            }

            var schedule = ServiceContext.CreateQuery("adx_eventschedule").FirstOrDefault(es => es.GetAttributeValue <Guid>("adx_eventscheduleid") == scheduleItem.GetAttributeValue <Guid>("adx_eventscheduleid"));

            var scheduleEvent = schedule.GetRelatedEntity(ServiceContext, new Relationship("adx_event_eventschedule"));

            var eventLocation = schedule.GetRelatedEntity(ServiceContext, new Relationship("adx_eventlocation_eventschedule"));

            var sessionEventControl = (CrmEntityDataSource)e.Item.FindControl("SessionEvent");

            var eventNameControl = (Property)e.Item.FindControl("EventName");

            var sessionEventLocationControl = (CrmEntityDataSource)e.Item.FindControl("SessionEventLocation");

            var eventLocationNameControl = (Property)e.Item.FindControl("EventLocationName");

            if (sessionEventControl != null && eventNameControl != null)
            {
                sessionEventControl.DataItem = scheduleEvent;

                eventNameControl.DataBind();
            }

            if (sessionEventLocationControl != null && eventLocationNameControl != null)
            {
                sessionEventLocationControl.DataItem = eventLocation;

                eventLocationNameControl.DataBind();
            }
        }
        protected void lvREQRequisitionItemFloorDetail_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                CheckBox chbxSelectLV        = (CheckBox)e.Item.FindControl("chbxSelectLV");
                Label    lblProjectFloorIDLV = (Label)e.Item.FindControl("lblProjectFloorIDLV");
                TextBox  txtQtyLV            = (TextBox)e.Item.FindControl("txtQtyLV");
                TextBox  txtRateLV           = (TextBox)e.Item.FindControl("txtRateLV");
                TextBox  txtRemarksLV        = (TextBox)e.Item.FindControl("txtRemarksLV");


                if (CurrentPRMWorkOrderEntity.WorkOrderStatusID == MasterDataConstants.WorkOrderStatus.APPROVED)
                {
                    chbxSelectLV.Enabled = false;
                }


                IList <PRMWorkOrderItemFloorDetailEntity> lst = PRMWorkOrderItemFloorDetailEntityList;

                if (lst != null && lst.Count > 0)
                {
                    var result = (from s in lst
                                  where s.ProjectFloorID.ToString() == lblProjectFloorIDLV.Text.Trim()
                                  select s).FirstOrDefault();

                    if (result != null)
                    {
                        chbxSelectLV.Checked = true;
                        txtQtyLV.Text        = result.Qty.ToString();
                        txtRateLV.Text       = result.Rate.ToString();
                        txtRemarksLV.Text    = result.Remarks;
                    }
                    else
                    {
                        chbxSelectLV.Checked = false;
                    }
                }

                else
                {
                    chbxSelectLV.Checked = false;
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Handles the RowDataBound event of the gvEMItxn control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewRowEventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void lstViewCardStatement_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            //List<CH_EMI_Request_DTO> lstEMIDTO = new List<CH_EMI_Request_DTO>();
            //CHRequestDetailManager cdm = new CHRequestDetailManager();
            //lstEMIDTO = cdm.GetEMIRequests(accountNumber.Encrypt());

            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                HiddenField HdnEMIId = (HiddenField)e.Item.FindControl("hdnEMIOracleId");

                foreach (var item in lstEMIDTO)
                {
                    if (item.Oracle_EMI_Id == HdnEMIId.Value)
                    {
                        //e.row.enable = false;
                        //e.Item.Visible = false;
                        CheckBox chk = (CheckBox)e.Item.FindControl("chkTransactions");
                        chk.Visible = false;
                        //e.Item.Cells[0].Text = "EMI Requested";
                        //e.Row.Cells[0].Font.Italic = true;


                        //Label lblEMIRequested = (Label)e.Item.FindControl("lblEMIRequested");
                        //lblEMIRequested.Visible = true;
                        //lblEMIRequested.Text = "EMI Requested";
                        //lblEMIRequested.Font.Italic = true;

                        HtmlGenericControl rowItem = e.Item.FindControl("rowItem") as HtmlGenericControl;
                        rowItem.Visible = false;
                        //btnSubmit.Visible = false;
                        btnReset.Visible = false;
                        //btndisabled.Visible = true;
                        btnSubmit.Enabled = false;
                        EMIRequestCount++;
                    }
                    else
                    {
                        btnSubmit.Visible   = true;
                        btnReset.Visible    = true;
                        btndisabled.Visible = false;
                    }
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// The list view main_ on item data bound.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void ListViewMain_OnItemDataBound(object sender, ListViewItemEventArgs e)
        {
            var labelEx = e.Item.FindControl("LabelStatusEx") as LabelStatusEx;

            if (labelEx != null)
            {
                labelEx.StatusEnum =
                    ((ViewModels.AccountEnrollViewModel)e.Item.DataItem).Status;
            }

            if (this.ManagerMode)
            {
                var btns = e.Item.FindControl("PanelBtns");
                if (btns != null)
                {
                    btns.Visible = true;
                }
            }
        }
 protected void uoHotelVendorList_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     if (e.Item.ItemType == ListViewItemType.DataItem)
     {
         HtmlControl PriorityTR        = (HtmlControl)e.Item.FindControl("PriorityTR");
         TextBox     uoTextBoxPriority = (TextBox)e.Item.FindControl("uoTextBoxPriority");
         if (uoHiddenFieldViewPriority.Value == "true")
         {
             HiddenField uoHiddenFieldBranchID = (HiddenField)e.Item.FindControl("uoHiddenFieldBranchID");
             string      scr = "validatePriority('" + uoHiddenFieldBranchID.Value + "', '" + uoTextBoxPriority.ClientID + "')";
             uoTextBoxPriority.Attributes.Add("onblur", scr);
         }
         else
         {
             PriorityTR.Attributes.Add("class", "hideElement");
             uoTextBoxPriority.Visible = false;
         }
     }
 }
Exemplo n.º 10
0
        protected void lvBDProject_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                BDProject_DetailedEntity ent = (BDProject_DetailedEntity)dataItem.DataItem;

                HyperLink hypProject              = (HyperLink)e.Item.FindControl("hypProject");
                HyperLink hypProjectReport        = (HyperLink)e.Item.FindControl("hypProjectReport");
                HyperLink hypProjectHistoryReport = (HyperLink)e.Item.FindControl("hypProjectHistoryReport");
                hypProjectReport.NavigateUrl        = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "ProjectReport", UrlConstants.OVERVIEW_PROJECT_ID, ent.ProjectID.ToString()).ToString();
                hypProjectHistoryReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.PROJECT_HISTORY_REPORT, UrlConstants.OVERVIEW_PROJECT_ID, ent.ProjectID.ToString()).ToString();
                hypProject.NavigateUrl         = UrlHelper.BuildSecureUrl("~/BD/BDProjectEditor.aspx", string.Empty, UrlConstants.OVERVIEW_PROJECT_ID, ent.ProjectID.ToString()).ToString();
                hypProject.Target              = "_blank";
                hypProjectReport.Target        = "_blank";
                hypProjectHistoryReport.Target = "_blank";
            }
        }
Exemplo n.º 11
0
    protected void lstQC_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        SetBackImage(e);
        Label lbl = (Label)e.Item.FindControl("lblRefNo");
        HtmlGenericControl hoverDiv = (HtmlGenericControl)e.Item.FindControl("BackDiv");

        hoverDiv.Attributes.Add("onmouseover", "ShowLoadProcessInOutTime(event,'" + lbl.Text + "','Final Inspection')");
        hoverDiv.Attributes.Add("onmouseout", "hideTooltip(event)");
        lblFICount.Text = (e.Item.Controls.Count > 0 ? (e.Item.Controls.Count / 3) : 0).ToString();
        Label lblTim = (Label)e.Item.FindControl("InTimeLabel");
        Label lblReg = (Label)e.Item.FindControl("RegnoLabel");
        Label lblDv  = (Label)e.Item.FindControl("lblDev");

        if (lblDv.Text.Trim() != "0")
        {
            lblReg.Attributes.Add("style", "color:red;");
            lblTim.Attributes.Add("style", "color:red;");
        }
    }
Exemplo n.º 12
0
        private void openDialogClicked(ListViewItemEventArgs obj)
        {

                if(obj.Value.ToString() != "...")
		        {
                    if(dirnames.Count > 0 && obj.Item <= dirnames.Count - 1)
                    {
                            FileAttributes attr = File.GetAttributes(dirnames[obj.Item]);
                        if((attr & FileAttributes.Directory) == FileAttributes.Directory)
                        {
                                musicDir = dirnames[obj.Item];
                                listDirContents();        
                                return;
                        }
                    }
		        }

                if(obj.Value.ToString() != "...")
                {



                    dirText.Text = musicDir.ToString();
                    var filename = Path.GetFileName(filelist[obj.Item - dirnames.Count]);
                    playList.Add(filename);
                    var track = new Track();
                    track.title = filename;
                    track.directory = filelist[obj.Item - dirnames.Count];
                    playListTable.Add(track);
                    PlayListView.SetSource(playList);
                }
                else
                {
                    
                    if(Directory.GetDirectoryRoot(musicDir) != musicDir)
                    {
                        var temp = Directory.GetParent(musicDir).ToString();
                        musicDir = temp;
                        listDirContents();
                    }
                }

        }
Exemplo n.º 13
0
 //protected bool ValiEdit()
 //{
 //    bool bcheck = true;
 //    ShowMsg1.InnerContent = "";
 //    if (string.IsNullOrEmpty(txtsLink.Text))
 //    {
 //        ShowMsg1.InnerContent += "联系不能为空<br/>";
 //        bcheck = false;
 //    }
 //    return bcheck;
 //}
 protected void lvInquiryList_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     try
     {
         //if (e.Item.ItemType == ListViewItemType.DataItem)
         //{
         //    Label lblsTitle = (Label)e.Item.FindControl("lblsTitle");
         //    lblsTitle.Text = lblsTitle.Text.Substring(0, 8).ToString() + "....";
         //    Label lblsContents = (Label)e.Item.FindControl("lblsContents");
         //    lblsContents.Text = lblsContents.Text.Substring(0, 16).ToString() + "....";
         //}
         //DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
         //ImageButton imgDelete = (ImageButton)e.Item.FindControl("imgDelete");
         //imgDelete.OnClientClick = "javascript:if (confirm('" + option.GetOptionValue("FormatSetting", "CommandControl", "bIsDelete") + "')){$('#EntryForm').block({ message: null });}else{return false;}";
     }
     catch (Exception)
     {
     }
 }
        protected void ListView_Days_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Button working     = (Button)e.Item.FindControl("btn_working");
            Button non_working = (Button)e.Item.FindControl("btn_Nonworking");
            string aa          = working.Text;

            if (aa == "1")
            {
                non_working.Visible = true;
                non_working.Text    = "Non-Working";
                working.Visible     = false;
            }
            else
            {
                non_working.Visible = false;
                working.Visible     = true;
                working.Text        = "Working";
            }
        }
Exemplo n.º 15
0
        protected void lvGroups_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                System.Web.UI.WebControls.Image imgGroupImage = e.Item.FindControl("imgGroupImage") as System.Web.UI.WebControls.Image;
                Literal     litImageID  = e.Item.FindControl("litImageID") as Literal;
                Literal     litPageName = e.Item.FindControl("litPageName") as Literal;
                LinkButton  lbPageName  = e.Item.FindControl("lbPageName") as LinkButton;
                ImageButton ibDelete    = e.Item.FindControl("ibDelete") as ImageButton;
                Literal     litGroupID  = e.Item.FindControl("litGroupID") as Literal;
                ImageButton ibEdit      = e.Item.FindControl("ibEdit") as ImageButton;

                ibDelete.Attributes.Add("GroupID", litGroupID.Text);
                ibEdit.Attributes.Add("GroupID", litGroupID.Text);
                ibDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this group?');");
                lbPageName.Attributes.Add("PageName", litPageName.Text);
                imgGroupImage.ImageUrl = "/files/photos/" + _presenter.GetImageByID(Convert.ToInt64(litImageID.Text), File.Sizes.S);
            }
        }
 protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     if (e.Item.ItemType == ListViewItemType.DataItem)
     {
         Panel panelComplaint      = (Panel)e.Item.FindControl("panelComplaint");
         HtmlGenericControl div    = (HtmlGenericControl)e.Item.FindControl("Reply");
         string             status = (string)DataBinder.Eval(e.Item.DataItem, "Status");
         if (status == "Delivered")
         {
             panelComplaint.BackColor = System.Drawing.Color.White;
             div.Visible = false;
         }
         else
         {
             panelComplaint.BackColor = System.Drawing.ColorTranslator.FromHtml("#EEEEEE");
             div.Visible = true;
         }
     }
 }
Exemplo n.º 17
0
        protected void lvHRMember_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                HRMember_CustomEntity ent = (HRMember_CustomEntity)dataItem.DataItem;

                HyperLink hypAccess         = (HyperLink)e.Item.FindControl("hypAccess");
                HyperLink hypRoles          = (HyperLink)e.Item.FindControl("hypRoles");
                HyperLink hypChangePassword = (HyperLink)e.Item.FindControl("hypChangePassword");
                HyperLink hypBlockUser      = (HyperLink)e.Item.FindControl("hypBlockUser");

                String ss = ent.UserId.ToString();

                if (ent.UserId.ToString().Equals("00000000-0000-0000-0000-000000000000"))
                {
                    hypAccess.Text            = "Create Login";
                    hypRoles.Text             = "";
                    hypRoles.Enabled          = false;
                    hypChangePassword.Text    = "";
                    hypChangePassword.Enabled = false;
                    hypBlockUser.Enabled      = false;
                }
                else
                {
                    hypAccess.Text         = "Manage Login";
                    hypRoles.Text          = "Manage Roles";
                    hypChangePassword.Text = "Reset Password";
                    hypBlockUser.Text      = "Block User";
                }

                hypAccess.NavigateUrl         = UrlHelper.BuildSecureUrl("~/Admin/HRMemberLogin.aspx", string.Empty, HRMember_CustomEntity.FLD_NAME_MemberID, ent.MemberID.ToString()).ToString();
                hypRoles.NavigateUrl          = UrlHelper.BuildSecureUrl("~/Admin/HRMemberRoles.aspx", string.Empty, HRMember_CustomEntity.FLD_NAME_MemberID, ent.MemberID.ToString()).ToString();
                hypChangePassword.NavigateUrl = UrlHelper.BuildSecureUrl("~/Admin/HRMemberChangePassword.aspx", string.Empty, HRMember_CustomEntity.FLD_NAME_MemberID, ent.MemberID.ToString()).ToString();
                hypBlockUser.NavigateUrl      = UrlHelper.BuildSecureUrl("~/Security/ASBlockUser.aspx", string.Empty, UrlConstants.OVERVIEW_MEMBER_ID, ent.MemberID.ToString()).ToString();

                hypAccess.Target         = "_blank";
                hypRoles.Target          = "_blank";
                hypChangePassword.Target = "_blank";
                hypBlockUser.Target      = "_blank";
            }
        }
Exemplo n.º 18
0
        protected void ListViewRewards_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            actNo++;
            Label lblNo = e.Item.FindControl("lblNo") as Label;

            HyperLink   HlnkImg         = e.Item.FindControl("HlnkImg") as HyperLink;
            HyperLink   HlnkRewardsName = e.Item.FindControl("HlnkRewardsName") as HyperLink;
            HyperLink   HlnkClickHere   = e.Item.FindControl("HlnkClickHere") as HyperLink;
            HiddenField hdnRewardsID    = e.Item.FindControl("hdnRewardsID") as HiddenField;
            HiddenField hdnRewardImage  = e.Item.FindControl("hdnRewardImage") as HiddenField;

            System.Web.UI.WebControls.Image imgPreview = e.Item.FindControl("imgPreview") as System.Web.UI.WebControls.Image;

            HlnkRewardsName.NavigateUrl = HlnkImg.NavigateUrl = "~/Rewards/Rewards.aspx?" + SystemConstants.qs_RewardsID + "=" + hdnRewardsID.Value;



            HiddenField hdnExpiryDate = e.Item.FindControl("hdnExpiryDate") as HiddenField;


            //Image imgStatus = e.Item.FindControl("imgStatus") as Image;
            if (!string.IsNullOrEmpty(hdnRewardImage.Value))
            {
                if (Convert.ToBoolean(hdnRewardImage.Value))
                {
                    var dr = new CustomerDAC().RetrieveRewardPrimaryImage(Convert.ToInt32(hdnRewardsID.Value));
                    if (dr != null)
                    {
                        //Convert byte directly, while its easier, its not suppose to be
                        //imgPreview.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(dr.ImageStream);
                        imgPreview.ImageUrl = "~/ImageHandler.ashx?" + SystemConstants.qs_RewardThumbImageID + "=" + dr.ID;
                    }
                }
                else
                {
                    imgPreview.ImageUrl = "~/Images/gift.jpg";
                }
            }
            else
            {
                imgPreview.ImageUrl = "~/Images/gift.jpg";
            }
        }
Exemplo n.º 19
0
    protected void GVW_Annonces_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        try
        {
            if (e.Item == null)
            {
                return;
            }

            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                AIS.Content c = ((AIS.Content)e.Item.DataItem);

                //System.Web.UI.HtmlControls.HtmlGenericControl lbl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("LBL_Titre");
                Label l = (Label)e.Item.FindControl("Label1");
                l.Text = c.title;

                //Hyperlink1
                //Label1
                //Literal1

                Literal lbl1    = (Literal)e.Item.FindControl("Literal1");
                string  letexte = StripHTML(c.text);
                if (letexte.Length > 20)
                {
                    lbl1.Text = letexte.Substring(0, 20) + " ...";
                }
                else
                {
                    lbl1.Text = letexte;
                }

                HyperLink hl = (HyperLink)e.Item.FindControl("Hyperlink1");
                hl.NavigateUrl = Functions.UrlAddParam(Globals.NavigateURL(Annoncetabid), "id_contenu", "" + c.id);
                //hl.Text = "Voir l'annonce";
                hl.ToolTip = "Voir l'annonce";
            }
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
        /// <summary>
        /// Set the uri of images.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                Image img = e.Item.FindControl("img") as Image;

                // According to the choose of location, we set the uri of image.
                if (String.IsNullOrEmpty(this.selectedValue) || this.selectedValue.Equals(BLOB))
                {
                    ImageInBlob image = e.Item.DataItem as ImageInBlob;
                    img.ImageUrl = image.BlobUri;
                }
                else if (this.selectedValue.Equals(SQL))
                {
                    ImageInSQLAzure image = e.Item.DataItem as ImageInSQLAzure;
                    img.ImageUrl = "GetImage.ashx?ImageId=" + image.ImageId;
                }
            }
        }
Exemplo n.º 21
0
        void viewSelector_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                LinkButton link  = null;
                var        query = from Control c in e.Item.Controls
                                   where c is LinkButton
                                   select c;
                if (query.Count() > 0)
                {
                    link = query.First() as LinkButton;
                }

                if (link != null)
                {
                    viewButtons.Add(link);
                }
            }
        }
        protected void lvwPurchaseHistory_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                HiddenField hdnCartId = (HiddenField)e.Item.FindControl("hdnCartId");
                HiddenField hdnStatus = (HiddenField)e.Item.FindControl("hdnStatus");
                hccCart     cart      = (hccCart)e.Item.DataItem;

                if (hdnCartId != null)
                {
                    hdnCartId.Value = cart.CartID.ToString();
                }

                if (hdnStatus != null)
                {
                    hdnStatus.Value = cart.StatusID.ToString();
                }
            }
        }
Exemplo n.º 23
0
        protected void lvCMAbstractMeasurementBook_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                DataKey currentDataKey = this.lvCMAbstractMeasurementBook.DataKeys[dataItem.DataItemIndex];

                Label lblRate        = (Label)e.Item.FindControl("lblRate");
                Label lblPreviousQty = (Label)e.Item.FindControl("lblPreviousQty");
                Label lblPresentQty  = (Label)e.Item.FindControl("lblPresentQty");
                Label lblAmount      = (Label)e.Item.FindControl("lblAmount");
                Label lblTotal       = (Label)e.Item.FindControl("lblTotal");

                System.Data.DataRowView rowView = e.Item.DataItem as System.Data.DataRowView;
                string currentItemID            = rowView["ItemID"].ToString();
                string currentProjectID         = rowView["ProjectID"].ToString();

                String fe = String.Empty;


                //  IList<PRMSupplierItemMapEntity> lstSupplierItemMap = FCCPRMSupplierItemMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                //CMAbstractMeasurementBook_CustomEntity ent = (CMAbstractMeasurementBook_CustomEntity)dataItem.DataItem;
                IList <CMAbstractMeasurementBookHelper_CustomEntity> lst = FCCCMAbstractMeasurementBookHelper_Custom.GetFacadeCreate().GetIL(Int64.Parse(currentProjectID), Int64.Parse(currentItemID));
                if (lst != null && lst.Count > 0)
                {
                    lblPresentQty.Text = lst[0].PresentQty.ToString();
                }
                else
                {
                    lblPresentQty.Text = "0";
                }

                Decimal rate, previousQty, presentQty, total, amount;
                //lbl
                Decimal.TryParse(lblPresentQty.Text.ToString(), out presentQty);
                Decimal.TryParse(lblTotal.Text.ToString(), out total);
                Decimal.TryParse(lblRate.Text.ToString(), out rate);
                previousQty         = total - presentQty;
                lblPreviousQty.Text = previousQty.ToString();
            }
        }
Exemplo n.º 24
0
        protected void CapexListView_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            HideTableData(e);
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataitem = (ListViewDataItem)e.Item;

                HtmlTableRow cell = (HtmlTableRow)e.Item.FindControl("prev");

                //HtmlTableCell act = (HtmlTableCell)cell.FindControl("act");
                HtmlTableCell tableDataRevDesc = (HtmlTableCell)cell.FindControl("tableDataRevDesc");
                HtmlTableCell desc             = (HtmlTableCell)cell.FindControl("sec");
                HtmlTableCell uom       = (HtmlTableCell)cell.FindControl("third");
                HtmlTableCell qty       = (HtmlTableCell)cell.FindControl("fourth");
                HtmlTableCell cost      = (HtmlTableCell)cell.FindControl("fifth");
                HtmlTableCell total_one = (HtmlTableCell)cell.FindControl("six");
                HtmlTableCell qty_rec   = (HtmlTableCell)cell.FindControl("sev");
                HtmlTableCell cost_two  = (HtmlTableCell)cell.FindControl("eight");
                HtmlTableCell total_two = (HtmlTableCell)cell.FindControl("nine");

                if (entitycode == Constants.TRAIN_CODE())
                {
                    string farm = (string)DataBinder.Eval(dataitem.DataItem, "RevDesc").ToString();

                    if (!string.IsNullOrEmpty(farm))
                    {
                        cell.Attributes.Add("class", "no_border");

                        tableDataRevDesc.ColSpan = 9;
                        tableDataRevDesc.Style.Add("font-weight", "bold");

                        desc.Style.Add("display", "none");
                        uom.Style.Add("display", "none");
                        qty.Style.Add("display", "none");
                        cost.Style.Add("display", "none");
                        total_one.Style.Add("display", "none");
                        qty_rec.Style.Add("display", "none");
                        cost_two.Style.Add("display", "none");
                        total_two.Style.Add("display", "none");
                    }
                }
            }
        }
Exemplo n.º 25
0
        protected void lvProjectImages_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType != ListViewItemType.DataItem)
            {
                return;
            }

            try
            {
                string imageLink = e.Item.DataItem.ToString();
                Image  img       = (Image)e.Item.FindControl("itemImage");
                //---
                img.ImageUrl = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), imageLink);
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
            }
        }
Exemplo n.º 26
0
        protected void lvCMNAdvanceSearch_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                DataRowView rowView   = e.Item.DataItem as DataRowView;
                PlaceHolder plhCommon = (PlaceHolder)e.Item.FindControl("plhCommon");

                if (plhCommon != null)
                {
                    foreach (object c in rowView.Row.ItemArray)
                    {
                        Literal oliteral = new Literal();

                        oliteral.Text = String.Format("<td>{0}</td>", c.ToString());
                        plhCommon.Controls.Add(oliteral);
                    }
                }
            }
        }
        protected void LvRelatedProductsRepeater_OnItemDataBound(object sender, ListViewItemEventArgs e)
        {
            //UpToGuestLabel
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                var product         = (Products)e.Item.DataItem;
                var aTag            = (HtmlAnchor)e.Item.FindControl("HotelItem");
                var productPriceLit = (Literal)e.Item.FindControl("ProductPriceLit");

                double actualPrice = product.ActualPriceWithDate.Price;
                var    maxGuest    = product.MaxGuest <= 0 ? Constant.DefaultMaxGuest : product.MaxGuest;
                if (maxGuest > 1)
                {
                    actualPrice = actualPrice / maxGuest;
                }
                aTag.Attributes.Add("onclick", string.Format("f{0}(event)", product.ProductId));
                productPriceLit.Text = Helper.FormatPrice(actualPrice);
            }
        }
Exemplo n.º 28
0
        protected void ListJourneyDataBound(object sender, ListViewItemEventArgs e)
        {
            var check  = e.Item.FindControl("interest") as CheckBox;
            var hidden = e.Item.FindControl("interestHidden") as HiddenField;
            var item   = e.Item.DataItem as Sitecore.Data.Items.Item;

            if (check != null && item != null && hidden != null)
            {
                if (mode == Constants.QueryStrings.Registration.ModeEdit)
                {
                    if ((this.registeringUser != null) && (this.registeringUser.Journeys.ToList().Exists(x => x.Key == Guid.Parse(item.ID.ToString()))))
                    {
                        check.Checked = true;
                    }
                }
                //check.Attributes.Add("guid", item.ID.ToString());
                hidden.Value = item.ID.ToString();
            }
        }
Exemplo n.º 29
0
        protected void lvCRMServeyMaster_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                CRMSurveyMasterEntity ent = (CRMSurveyMasterEntity)dataItem.DataItem;

                HyperLink hypTitle = (HyperLink)e.Item.FindControl("hypTitle");
                HyperLink hypSurveyMasterReport = (HyperLink)e.Item.FindControl("hypSurveyMasterReport");


                hypTitle.NavigateUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMSurvey.aspx", string.Empty, UrlConstants.OVERVIEW_SURVEY_MASTER_ID, ent.SurveyMasterID.ToString()).ToString();

                hypSurveyMasterReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", "SurveyMasterReport", UrlConstants.OVERVIEW_SURVEY_MASTER_ID, ent.SurveyMasterID.ToString()).ToString();
                hypSurveyMasterReport.Target      = "_blank";
                hypTitle.Target = "_blank";
            }
        }
Exemplo n.º 30
0
    protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        if (e.Item.ItemType == ListViewItemType.DataItem)
        {
            // Display the e-mail address in italics.

            Label      status = ((Label)e.Item.FindControl("Label9"));
            LinkButton buy    = ((LinkButton)e.Item.FindControl("LinkButton2"));

            if (status.Text != "Offer")
            {
                buy.Visible = false;
            }
            else
            {
                buy.Visible = false;
            }
        }
    }
Exemplo n.º 31
0
 private void VersionList_ItemClick(object sender, ListViewItemEventArgs e)
 {
     radListView1.SelectedItem = e.Item;
 }
 private void versionsListView_ItemMouseClick(object sender, ListViewItemEventArgs e)
 {
     versionsListView.SelectedItem = e.Item;
     Version ver =
         Version.ParseVersion(new DirectoryInfo(Path.Combine(_applicationContext.McVersions, versionsListView.SelectedItem[0].ToString() + "\\")), false);
     RadMenuItem launchVerButton = new RadMenuItem { Text = _applicationContext.ProgramLocalization.Launch };
     launchVerButton.Click += delegate {
         if (versionsListView.SelectedItem == null) {
             return;
         }
         _versionToLaunch = versionsListView.SelectedItem[0].ToString();
         LaunchButton.PerformClick();
     };
     bool enableRestoreButton = false;
     switch (ver.ReleaseType) {
         case "release":
         case "snapshot":
         case "old_beta":
         case "old_alpha":
             enableRestoreButton = true;
             break;
     }
     RadMenuItem restoreVerButton = new RadMenuItem { Text = "Restore and launch", Enabled = enableRestoreButton };
     restoreVerButton.Click += delegate {
         _restoreVersion = true;
         _versionToLaunch = versionsListView.SelectedItem[0].ToString();
         LaunchButton.PerformClick();
     };
     RadMenuItem openVerButton = new RadMenuItem { Text = _applicationContext.ProgramLocalization.OpenLocation };
     openVerButton.Click += delegate {
         if (versionsListView.SelectedItem == null) {
             return;
         }
         Process.Start(Path.Combine(_applicationContext.McVersions, versionsListView.SelectedItem[0].ToString() + "\\"));
     };
     RadMenuItem delVerButton = new RadMenuItem { Text = _applicationContext.ProgramLocalization.DeleteVersion};
     delVerButton.Click += delegate {
         if (versionsListView.SelectedItem == null) {
             return;
         }
         DialogResult dr =
             RadMessageBox.Show(
                 string.Format(_applicationContext.ProgramLocalization.DeleteConfirmationText,
                     versionsListView.SelectedItem[0].ToString()),
                 _applicationContext.ProgramLocalization.DeleteConfirmationTitle,
                 MessageBoxButtons.YesNo, RadMessageIcon.Question);
         if (dr != DialogResult.Yes) {
             return;
         }
         try {
             Directory.Delete(
                 Path.Combine(_applicationContext.McVersions, versionsListView.SelectedItem[0].ToString() + "\\"), true);
             AppendLog($"Version '{versionsListView.SelectedItem[0].ToString()}' has been deleted successfuly.");
             UpdateVersionListView();
         }
         catch (Exception ex) {
             AppendException($"An error has occurred during version deletion: {ex.ToString()}");
         }
         string path = Path.Combine(_applicationContext.McVersions,
             _selectedProfile.SelectedVersion ?? GetLatestVersion(_selectedProfile) + "\\");
         string state = _applicationContext.ProgramLocalization.ReadyToLaunch;
         if (!File.Exists(string.Format("{0}/{1}.json", path, _selectedProfile.SelectedVersion ??
                                                              GetLatestVersion(_selectedProfile)))) {
             state = _applicationContext.ProgramLocalization.ReadyToDownload;
         }
         SelectedVersion.Text = string.Format(state, (_selectedProfile.SelectedVersion ??
                                                      GetLatestVersion(_selectedProfile)));
     };
     RadContextMenu verListMenuStrip = new RadContextMenu();
     verListMenuStrip.Items.Add(launchVerButton);
     verListMenuStrip.Items.Add(new RadMenuSeparatorItem());
     verListMenuStrip.Items.Add(restoreVerButton);
     verListMenuStrip.Items.Add(new RadMenuSeparatorItem());
     verListMenuStrip.Items.Add(openVerButton);
     verListMenuStrip.Items.Add(delVerButton);
     new RadContextMenuManager().SetRadContextMenu(versionsListView, verListMenuStrip);
 }
Exemplo n.º 33
0
        private void lsvInsurances_ItemCheckedChanged(object sender, ListViewItemEventArgs e)
        {
            if (!_canUpdateInsurance)
                return;

            InsuranceDef insuraceDef = e.Item.Tag as InsuranceDef;
            VisitService visitService = srcService.DataSource as VisitService;

            if (e.Item.CheckState == ToggleState.On)
            {
                VisitServiceInsurance visitServiceInsurance = new VisitServiceInsurance();
                visitServiceInsurance.InsuranceDef = insuraceDef;
                visitServiceInsurance.Fee = insuraceDef.Fee;
                visitService.VisitServiceInsurances.Add(visitServiceInsurance);
            }
            else
            {
                VisitServiceInsurance visitServiceInsurance = visitService.VisitServiceInsurances.First(i => i.InsuranceDef == insuraceDef);
                visitService.VisitServiceInsurances.Remove(visitServiceInsurance);

                if (visitServiceInsurance.EntityState == System.Data.EntityState.Added)
                    DataLayer.Detach(visitServiceInsurance);
                else
                    DataLayer.Remove(visitServiceInsurance);
            }
        }
Exemplo n.º 34
0
        private ListViewItem CreateListViewItem(TableRow rowContainer, int itemIndex, ListViewItemType itemType, object dataItem, bool dataBind)
        {
            ListViewItem item = CreateListViewItem(itemIndex, itemType);
            ListViewItemEventArgs e = new ListViewItemEventArgs(item);

            ITemplate template = GetTemplateForItem(item);
            if (template != null) {
                template.InstantiateIn(item);
            }

            OnItemCreated(e);
            rowContainer.Cells.Add(item);

            if (dataBind) {
                item.DataItem = dataItem;
                item.DataBind();

                OnItemDataBound(e);
            }

            return item;
        }
        private async void radCheckedListBoxLocals_ItemCheckedChanged(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.CheckState != ToggleState.On) return;

            ExpressionViewModel vm = (ExpressionViewModel)e.Item.DataBoundItem;
            Expression checkedExpression = vm.Expression;
            string expressionName = checkedExpression.Name;

            e.Item.Text = $"{expressionName} (calculating...)";


            CancellationTokenSource tokenSource = new CancellationTokenSource((int) _settings.DepthSolverTimeOut);
            string depth = await GetDepth(checkedExpression, tokenSource.Token);

            string textToDisplay = $"{expressionName} (max depth: {depth})";
            e.Item.Text = textToDisplay;
        }
Exemplo n.º 36
0
 private void listaInstalaciones_ItemMouseClick(object sender, ListViewItemEventArgs e)
 {
     datePick.MaxDate = DateTime.Now.AddDays(14);
     datePick.Visible = true;
     inst = db.Instalaciones.Where(x => x.ToString().Equals(e.Item.Value.ToString())).ToArray()[0];
 }
Exemplo n.º 37
0
 protected virtual void OnItemDataBound(ListViewItemEventArgs e)
 {
     ListViewItemEventHandler handler = (ListViewItemEventHandler)Events[EventItemDataBound];
     if (handler != null) {
         handler(this, null);
     }
 }