protected void dlPassengers_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType != ListItemType.Footer && e.Item.ItemType != ListItemType.Header)
        {
            Label lbl = (Label)e.Item.FindControl("Label3");

            if (lbl.Text.Trim() == "0".Trim())
            {
                lbl.Text = "Mr";
            }
            if (lbl.Text.Trim() == "1".Trim())
            {
                lbl.Text = "Mrs";
            }
            if (lbl.Text.Trim() == "2".Trim())
            {
                lbl.Text = "Ms";
            }
            if (((Label)e.Item.FindControl("lbBirth")).Text.Trim() != "")
            {
                DateTime birthDay = Convert.ToDateTime(((Label)e.Item.FindControl("lbBirth")).Text);
                if (IsDateTimeCurrent(birthDay))
                {
                    ((Label)e.Item.FindControl("lbBirth")).Visible = true;
                    ((Label)e.Item.FindControl("lbBirth")).Text = Convert.ToDateTime(((Label)e.Item.FindControl("lbBirth")).Text).ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
                }
                else
                {
                    ((Label)e.Item.FindControl("lbBirth")).Visible = false;
                }
            }
        }
    }
 //Contact 替換關鍵字查詢的顏色
 protected void dlContact_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         new IMAUtil().RepKW(e.Item.Controls);
     }
 }
 // method to select status radio button according to approvalSatatus in the table
 protected void dlApp_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     foreach (DataListItem item in dlApp.Items) 
     {
         if (item.ItemType == ListItemType.Item)
         {
             HiddenField hdfStatus = (HiddenField)e.Item.FindControl("hdfStatus");
             if (hdfStatus.Value == "Pending")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Pending";                    
             }
             else if (hdfStatus.Value == "Accepted")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Accept";
             }
             else if (hdfStatus.Value == "Rejected")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Reject";
             }
         }
     }
 }
 protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     int nCount = e.Item.ItemIndex + 1;
     String str = "第"+nCount.ToString()+"题:";
     Label lbl = (Label)e.Item.FindControl("Label4");
     lbl.Text = str;
 }
    protected void datListGeneral_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Label lblImage = e.Item.FindControl("lblImage") as Label;
        Image imgPicture = e.Item.FindControl("imgPicture") as Image;

        imgPicture.ImageUrl = "~/Uploads/" + lblImage.Text;
    }
    protected void list_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        DataRowView dataRow = (DataRowView)e.Item.DataItem;
        string productId = dataRow["ProductID"].ToString();
        DataTable attrTable = CatalogAccess.GetProductAttributes(productId);

        string prevAttributeName = "";
        string attributeName, attributeValue, attributeValueId;
        Label attributeNameLabel;
        PlaceHolder attrPlaceHolder = (PlaceHolder)e.Item.FindControl("attrPlaceHolder");
        DropDownList attributeValuesDropDown = new DropDownList();

        foreach (DataRow r in attrTable.Rows)
        {
            attributeName = r["AttributeName"].ToString();
            attributeValue = r["AttributeValue"].ToString();
            attributeValueId = r["AttributeValueID"].ToString();

            if (attributeName != prevAttributeName)
            {
                prevAttributeName = attributeName;
                attributeNameLabel = new Label();
                attributeNameLabel.Text = attributeName + ": ";
                attributeValuesDropDown = new DropDownList();
                attrPlaceHolder.Controls.Add(attributeNameLabel);
                attrPlaceHolder.Controls.Add(attributeValuesDropDown);
            }

            attributeValuesDropDown.Items.Add(new ListItem(attributeValue, attributeValueId));
        }
    }
    protected void dlFlights_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {

        }
    }
 protected void rptDataBound(object sender, DataListItemEventArgs e)
 {
     try
     {
         string str = Server.HtmlDecode(ds.Tables[0].Rows[e.Item.ItemIndex]["Article"].ToString());
         Match m = Regex.Match(str, @"<img(.|\n)+?>");
         Image ArticleImage = (Image)e.Item.FindControl("img");
         if (!string.IsNullOrEmpty(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()))
         {
             System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()), 110, 80, ArticleImage);
             ArticleImage.ImageUrl = ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString();
         }
         else if (m.Success)
         {
             Match inner = Regex.Match(m.Value, "src=[\'|\"](.+?)[\'|\"]");
             if (inner.Success)
             {
                 string imageurl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
                 System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(imageurl), 110, 80, ArticleImage);
                 ArticleImage.ImageUrl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
             }
         }
     }
     catch (Exception ex)
     {
         UserInfo info = UserController.GetCurrentUserInfo();
         ErrorLog objLog = new ErrorLog();
         objLog.ErrorDescription = ex.ToString();
         objLog.ErrorDate = DateTime.Now;
         objLog.ErrorFunctionName = "Page Load";
         objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
         objLog.ErrorLoggedInUser = info.Username;
         objLog.AddErrorToLog(objLog);
     }
 }
    protected void dlTourProduct_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Label lbl_HasAir = (Label)e.Item.FindControl("lbl_HasAir");
            Label lbl_DeptFrom = (Label)e.Item.FindControl("lbl_DeptFrom");
            Label lbl_Disp = (Label)e.Item.FindControl("lblDisp");
            Label lbl_PriceValue = (Label)e.Item.FindControl("lbl_PriceValue");
            HtmlTableRow trIsShowAirline = (HtmlTableRow)e.Item.FindControl("trIsShowAirline");

            TourMaterial tourMaterial= (TourMaterial)(((System.Object)(((System.Web.UI.WebControls.DataListItem)(e.Item)).DataItem)));
            //lbl_PriceValue.Text = ((TourProfile)tourMaterial.Profile)..
            if (((TourSearchCondition)this.Transaction.CurrentSearchConditions).IsLandOnly)
            {
                lbl_HasAir.Visible = lbl_DeptFrom.Visible = lbl_Disp.Visible = false;
                lbl_PriceValue.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).StartFromLandOnlyFare.ToString("n", System.Globalization.CultureInfo.CurrentUICulture.NumberFormat);
                trIsShowAirline.Visible = false;
            }
            else
            {
                lbl_DeptFrom.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).DefaultDepartureCity.Name + ")";
                lbl_PriceValue.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).StartFromAirLandFare.ToString("n", System.Globalization.CultureInfo.CurrentUICulture.NumberFormat);
            }

            //if (((TourProfile)tourMaterial.Profile).Airlines.Count==0)
            //    trIsShowAirline.Visible=false;

            Image img = (Image)e.Item.FindControl("imgTour");
            img.ImageUrl = img.ImageUrl.ToString().Replace("~/", string.Empty);
        }
    }
Example #10
0
 protected void DataListvote_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     bool webvotelimit = LearnSite.Common.XmlHelp.WebVote_Limit();
     string wdate = ((Label)e.Item.FindControl("LabelWupdate")).Text;
     if (wdate != "")
     {
         string nowday = DateTime.Now.ToShortDateString();
         DateTime nowdayDt = Convert.ToDateTime(nowday);
         DateTime updateDt = Convert.ToDateTime(wdate);
         if (updateDt > nowdayDt)
         {
             ((LinkButton)e.Item.FindControl("Linkvote")).BackColor = Lbc.BackColor;
         }
     }
     if (!webvotelimit)
     {
         ((LinkButton)e.Item.FindControl("Linkvote")).Enabled = true;
     }
     else
     {
         ((LinkButton)e.Item.FindControl("Linkvote")).Enabled = false;
         Labelmsg.Text = "现在还不可以进行网站投票,请努力制作好你的网站吧!";
     }
     string mystr = "网站现评价得分为:" + ((Label)e.Item.FindControl("LabelWscore")).Text + "分";
     ((HyperLink)e.Item.FindControl("Hypername")).ToolTip = mystr;
 }
Example #11
0
    protected void ItemDataBoundFormattingExample_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            // Programmatically reference the ProductsRow instance bound to this DataListItem
            Northwind.ProductsRow product = (Northwind.ProductsRow)((System.Data.DataRowView)e.Item.DataItem).Row;

            // See if the UnitPrice is not NULL and less than $20.00
            if (!product.IsUnitPriceNull() && product.UnitPrice < 20)
            {
                // Highlight the product name and unit price Labels
                // First, get a reference to the two Label Web controls
                Label ProductNameLabel = (Label)e.Item.FindControl("ProductNameLabel");
                Label UnitPriceLabel = (Label)e.Item.FindControl("UnitPriceLabel");

                // Next, set their CssClass properties
                if (ProductNameLabel != null)
                    ProductNameLabel.CssClass = "AffordablePriceEmphasis";

                if (UnitPriceLabel != null)
                    UnitPriceLabel.CssClass = "AffordablePriceEmphasis";

                // Alternatively, you can opt to adjust the style for the *entire* item:
                // e.Item.CssClass = "AffordablePriceEmphasis";
            }
        }
    }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.EditItem)
        {
            DropDownList ddlGradeCourseSubject = (DropDownList)e.Item.FindControl("ddlGradeCourseSubject");
            ddlGradeCourseSubject.DataTextField = "CourseSubjectName";
            ddlGradeCourseSubject.DataValueField = "id";
            DataTable dt = (DataTable)ViewState["CourseByGrade"];
            ddlGradeCourseSubject.DataSource = dt;
            ddlGradeCourseSubject.DataBind();
            DataRowView row = (DataRowView)e.Item.DataItem; //取得繫節過來那一筆DataRow
            if (!string.IsNullOrEmpty(row["GradeCourseSubjectID"].ToString()))
            {
                ddlGradeCourseSubject.SelectedValue = row["GradeCourseSubjectID"].ToString();
            }

        }
        if(e.Item.ItemType== ListItemType.Item || e.Item.ItemType== ListItemType.AlternatingItem)
        {
            Person myPerson = new Person();
            if (myPerson.Role == Person.LoginRole.Administrator)
            {
                Panel addPan = (Panel)e.Item.FindControl("addPan");
                addPan.Visible = false;

            }
        }
    }
Example #13
0
    protected void dlEstimate_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Footer)
        {
            Label lblCurrent = e.Item.FindControl("lblCurrentPage") as Label;
            Label lblCount = e.Item.FindControl("lblCount") as Label;
            LinkButton lbtnFirst = e.Item.FindControl("lbtnFirst") as LinkButton;
            LinkButton lbtnPre = e.Item.FindControl("lbtnPre") as LinkButton;
            LinkButton lbtnNext = e.Item.FindControl("lbtnNext") as LinkButton;
            LinkButton lbtnLast = e.Item.FindControl("lbtnLast") as LinkButton;

            lblCurrent.Text = "第" + (pds.CurrentPageIndex + 1).ToString() + "页";
            lblCount.Text = "共" + pds.PageCount.ToString() + "页";
            if (pds.IsFirstPage)
            {
                lbtnFirst.Enabled = false;
                lbtnPre.Enabled = false;
            }
            if (pds.IsLastPage)
            {
                lbtnNext.Enabled = false;
                lbtnLast.Enabled = false;
            }
        }
    }
    protected void _dlstPages_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                string _insStatus = ((Label)e.Item.FindControl("_lblInsertStatus")).Text;
                if (_insStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkInsert")).Checked = true;

                string _viewStatus = ((Label)e.Item.FindControl("_lblViewStatus")).Text;
                if (_viewStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkView")).Checked = true;

                string _editStatus = ((Label)e.Item.FindControl("_lblEditStatus")).Text;
                if (_editStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkEdit")).Checked = true;

                string _deleteStatus = ((Label)e.Item.FindControl("_lblDeleteStatus")).Text;
                if (_deleteStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkDelete")).Checked = true;

                string _status = ((Label)e.Item.FindControl("_lblStatus")).Text;
                if (_status == "1")
                    ((CheckBox)e.Item.FindControl("_chkPage")).Checked = true;

            }
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        }
    }
Example #15
0
 protected void dlPictrue_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Footer)
     {
         //以下六个为得到脚模板中的控件,并创建变量.
         Label CurrentPage = e.Item.FindControl("labCurrentPage") as Label;
         Label PageCount = e.Item.FindControl("labPageCount") as Label;
         LinkButton FirstPage = e.Item.FindControl("lnkbtnFirst") as LinkButton;
         LinkButton PrePage = e.Item.FindControl("lnkbtnFront") as LinkButton;
         LinkButton NextPage = e.Item.FindControl("lnkbtnNext") as LinkButton;
         LinkButton LastPage = e.Item.FindControl("lnkbtnLast") as LinkButton;
         CurrentPage.Text = (pds.CurrentPageIndex + 1).ToString();//绑定显示当前页
         PageCount.Text = pds.PageCount.ToString();//绑定显示总页数
         if (pds.IsFirstPage)//如果是第一页,首页和上一页不能用
         {
             FirstPage.Enabled = false;
             PrePage.Enabled = false;
         }
         if (pds.IsLastPage)//如果是最后一页"下一页"和"尾页"按钮不能用
         {
             NextPage.Enabled = false;
             LastPage.Enabled = false;
         }
     }
 }
 protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         LinkButton btnDel = (LinkButton)e.Item.FindControl("lbtnDelete");
         btnDel.Attributes.Add("OnClick", "return confirm('Are you sure to delete this image?');");
     }
 }
 protected void dtlContainer_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataList dtlContianer = (DataList)e.Item.Parent.Parent.Parent.FindControl("dtlContainer");
         string[] dataKeys = dtlContianer.DataKeys[e.Item.ItemIndex].ToString().Split(',');
     }
 }
 protected void g_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item)) || (e.Item.ItemType == ListItemType.EditItem))
     {
         ShoveConfirmButton button = e.Item.FindControl("btnQuash") as ShoveConfirmButton;
         button.Visible = base._User.Competences.IsOwnedCompetences(Competences.BuildCompetencesList(new string[] { "LotteryIsuseScheme" }));
     }
 }
 protected void dlHotel_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         HyperLink hotelSelect = (HyperLink)e.Item.FindControl("hotelSelect");
         hotelSelect.NavigateUrl += "&ConditionID=" + Request.Params["ConditionID"];
     }
 }
Example #20
0
 protected void DataListPaging_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     LinkButton lnkPage = (LinkButton)e.Item.FindControl("Pagingbtn");
     if (lnkPage.CommandArgument.ToString() == CurrentPage.ToString())
     {
         lnkPage.Enabled = false;
     }
 }
Example #21
0
    protected void dlList_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if( !(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem) ) return;

        LinkButton lnkRemove = (LinkButton)e.Item.FindControl("lnkRemove");

        lnkRemove.OnClientClick = string.Format("return confirm('정말로 삭제하시겠습니까?');");
    }
 protected void OnCategoryListItemCreated(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
         ObjectDataSource ds = e.Item.FindControl("UserReportData") as ObjectDataSource;
         if (ds != null && (DataBinder.Eval(e.Item.DataItem, "Id") != null)) {
             ds.SelectParameters["CategoryId"].DefaultValue = DataBinder.Eval(e.Item.DataItem, "Id").ToString();
         }
     }
 }
    protected void dlProducts_OnItemDataBound(object sender, DataListItemEventArgs e)
    {
        ProductCollection products = (ProductCollection)e.Item.DataItem;

        Literal litName = e.Item.FindControl("litName") as Literal;
        litName.Text = products.ProductName;
        Literal litColour = e.Item.FindControl("litColour") as Literal;
        litColour.Text = products.ProductColour;
    }
Example #24
0
 protected void dlstParentMenu_ItemCreated(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         //给嵌套的DATALIST添加一个项绑定事件
         DataList dl = ((DataList)(e.Item.FindControl("dlstChildMenu")));
         dl.ItemDataBound += new DataListItemEventHandler(dl_ItemDataBound);
     }
 }
Example #25
0
    protected void dlList_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if( !(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem )) return;

        LinkButton lnkRemove			= (LinkButton)e.Item.FindControl("lnkRemove");

        lnkRemove.Attributes["onclick"]	= string.Format("return confirm('{0}');",
            Umc.Core.UmcConfiguration.Message[EmoticonConst.MESSAGE_EMOTICON_REMOVE_REALLY ]);
    }
Example #26
0
 protected void dlTabs_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     string ID = dlTabs.DataKeys[e.Item.ItemIndex].ToString();
     DataTable dtBookCase = (DataTable)Session["MyBookCase"];
     DataView dv = new DataView(dtBookCase);
     dv.RowFilter = "tab_id=" + ID;
     DataList dlBookCase = (DataList)e.Item.FindControl("dlBookCase");
     dlBookCase.DataSource = dv;
     dlBookCase.DataBind();
 }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        System.Data.DataRowView drv = (System.Data.DataRowView)(e.Item.DataItem);
        int ProductId = int.Parse(drv.Row["ProductId"].ToString());
        if (IsThisProductSelectedForCart(ProductId) == true)
        {

            e.Item.FindControl("GalPanel1").Visible = false;
        }
    }
Example #28
0
 //-------------------------------------------------------------------------------------------
 protected void List_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
       {
            LinkButton but = (LinkButton) e.Item.FindControl("Subject");
            but.Text = ds.Tables[0].Rows[e.Item.ItemIndex]["subject"].ToString();
            but.CommandArgument = ds.Tables[0].Rows[e.Item.ItemIndex]["ticket_id"].ToString();
            but.Click += new EventHandler(but_Click);
       }
 }
Example #29
0
	/// <summary>
	/// Sets the navigation links images.
	/// </summary>
	protected void siteLinks_ItemDataBound(object sender, DataListItemEventArgs e)
	{
		INavigateUIData dataItem = e.Item.DataItem as INavigateUIData;
		if (dataItem != null && !string.IsNullOrEmpty(dataItem.Description))
		{
			string descr = dataItem.Description;
			Image image = (Image)e.Item.FindControl("linkIm");
			image.ImageUrl = this.ResolveUrl/**/(descr.Split('|')[0]);
		}
	}
 protected void OnListUserTimeEntriesItemCreated(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         ObjectDataSource ds = e.Item.FindControl("TimeEntryData") as ObjectDataSource;
         if (ds != null && (DataBinder.Eval(e.Item.DataItem, "UserName") != null))  {
             ds.SelectParameters["userName"].DefaultValue = DataBinder.Eval(e.Item.DataItem, "UserName").ToString();
         }
     }
 }
 protected void dtPaginacionVolantePago_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
Example #32
0
 protected void dtPaginacionDetalle_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
Example #33
0
        protected void lstStuff_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["PromoBySupplierItemsID"].ToString();

                Label lblContactName = (Label)e.Item.FindControl("lblContactName");
                if (dr["ContactID"].ToString() == Constants.ZERO_STRING)
                {
                    lblContactName.Text = "All Suppliers";
                }
                else
                {
                    lblContactName.Text = dr["ContactName"].ToString();
                }

                Label lblProductGroup = (Label)e.Item.FindControl("lblProductGroup");
                if (string.IsNullOrEmpty(dr["ProductGroupName"].ToString()))
                {
                    lblProductGroup.Text = "All Groups";
                }
                else
                {
                    lblProductGroup.Text = dr["ProductGroupName"].ToString();
                }

                Label lblProductSubGroup = (Label)e.Item.FindControl("lblProductSubGroup");
                if (string.IsNullOrEmpty(dr["ProductSubGroupName"].ToString()))
                {
                    lblProductSubGroup.Text = "All SubGroups";
                }
                else
                {
                    lblProductSubGroup.Text = dr["ProductSubGroupName"].ToString();
                }

                Label lblProduct = (Label)e.Item.FindControl("lblProduct");
                if (string.IsNullOrEmpty(dr["ProductDesc"].ToString()))
                {
                    lblProduct.Text = "All Products";
                }
                else
                {
                    lblProduct.Text = dr["ProductDesc"].ToString();
                }

                Label lblVariation = (Label)e.Item.FindControl("lblVariation");
                if (string.IsNullOrEmpty(dr["Description"].ToString()))
                {
                    lblVariation.Text = "All Variations";
                }
                else
                {
                    lblVariation.Text = dr["Description"].ToString();
                }

                Label lblPromoBySupplierValue = (Label)e.Item.FindControl("lblPromoBySupplierValue");
                lblPromoBySupplierValue.Text = Convert.ToDecimal(dr["PromoBySupplierValue"].ToString()).ToString("#,##0.#");

                Label lblCouponRemarks = (Label)e.Item.FindControl("lblCouponRemarks");
                lblCouponRemarks.Text = dr["CouponRemarks"].ToString().Replace("\r\n", "<br>").Replace("\n\n", "<br><br>");

                //For anchor
//				HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst");
//
//				HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown");
//				anchorDown.HRef = "javascript:ToggleDiv('" +  divExpCollAsst.ClientID + "')";
            }
        }
        protected void dlVersionList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label lblTitle         = e.Item.FindControl("lblTitle") as Label;
                Label lblTotalOrder    = e.Item.FindControl("lblTotalOrder") as Label;
                Label lblTotalRev      = e.Item.FindControl("lblTotalRev") as Label;
                Label lbHitLinkVisitor = e.Item.FindControl("lbHitLinkVisitor") as Label;
                Label lblConversion    = e.Item.FindControl("lblConversion") as Label;

                ReportFields item = e.Item.DataItem as ReportFields;

                lblTitle.Text = item.Title.ToUpper();
                if (lblTitle.Text.ToLower() == "display_mob")
                {
                    lblTitle.Text = "DISPLAY_MOBILE";
                }
                if (lblTitle.Text.ToLower() == "display_tab")
                {
                    lblTitle.Text = "DISPLAY_TABLET";
                }
                if (lblTitle.Text.ToLower() == "display")
                {
                    lblTitle.Text = "DISPLAY_DESKTOP";
                }

                lblTotalOrder.Text = item.TotalOrders.ToString();
                if (item.UniqueVisitors > 0)
                {
                    lbHitLinkVisitor.Text = string.Format("{0:##,##}", item.UniqueVisitors);
                }
                else
                {
                    lbHitLinkVisitor.Text = "0";
                }

                lblConversion.Text = String.Format("{0}", item.Conversion);

                lblTotalRev.Text = String.Format("{0:0.##}", Math.Round(item.TotalRevenue, 2).ToString("n2"));

                CategoryUniqueVistiors += item.UniqueVisitors;
                totalOrders            += item.TotalOrders;
                totalRevenue           += item.TotalRevenue;
            }

            if (e.Item.ItemType == ListItemType.Footer)
            {
                Label lblSumTotalOrder      = e.Item.FindControl("lblSumTotalOrder") as Label;
                Label lblSumTotalRev        = e.Item.FindControl("lblSumTotalRev") as Label;
                Label lblSumHitLinkVisitor  = e.Item.FindControl("lblSumHitLinkVisitor") as Label;
                Label lblSumTotalConversion = e.Item.FindControl("lblSumTotalConversion") as Label;


                if (CategoryUniqueVistiors > 0)
                {
                    lblSumTotalConversion.Text = String.Format("{0}", Math.Round((totalOrders * 100) / CategoryUniqueVistiors, 2));
                    lblSumHitLinkVisitor.Text  = string.Format("{0:##,##}", CategoryUniqueVistiors);
                }
                else
                {
                    lblSumTotalConversion.Text = "0";
                    lblSumHitLinkVisitor.Text  = "0";
                }

                lblSumTotalOrder.Text = totalOrders.ToString();
                lblSumTotalRev.Text   = String.Format("{0:C}", totalRevenue);
            }
        }
Example #35
0
 protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     ((HyperLink)e.Item.Controls[0].FindControl("HyperLink1")).Text = ((HyperLink)e.Item.Controls[0].FindControl("HyperLink1")).Text.Substring(0, 4);
 }
Example #36
0
        protected void lstItemCustomer_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {
                //LoadSortFieldOptions(e);
            }
            else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr          = (DataRowView)e.Item.DataItem;
                ImageButton imgItemEdit = (ImageButton)e.Item.FindControl("imgItemEdit");

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["ContactID"].ToString();
                if (chkList.Value == "1" || chkList.Value == "2")
                {
                    chkList.Attributes.Add("disabled", "false");
                    imgItemEdit.Enabled = false; imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                }
                else
                {
                    imgItemEdit.Enabled = cmdSaveGuarantor.Visible; if (!imgItemEdit.Enabled)
                    {
                        imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    }
                }

                HyperLink lnkContactName = (HyperLink)e.Item.FindControl("lnkContactName");
                lnkContactName.Text        = dr["ContactName"].ToString();
                lnkContactName.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID) + "&showbills=" + Common.Encrypt("false", Session.SessionID);

                Label lblCreditType = (Label)e.Item.FindControl("lblCreditType");
                lblCreditType.Text = dr["CardTypeCode"].ToString().ToString();

                Label lblCreditCardNo = (Label)e.Item.FindControl("lblCreditCardNo");
                lblCreditCardNo.Text = dr["CreditCardNo"].ToString();

                Label lblCreditCardStatus = (Label)e.Item.FindControl("lblCreditCardStatus");
                lblCreditCardStatus.Text = Enum.Parse(typeof(CreditCardStatus), dr["CreditCardStatus"].ToString()).ToString();

                Label lblCreditActive = (Label)e.Item.FindControl("lblCreditActive");
                lblCreditActive.Text = Data.Contacts.checkCreditActive((CreditCardStatus)Enum.Parse(typeof(CreditCardStatus), dr["CreditCardStatus"].ToString())) ? "Active" : "InActive";

                Label lblExpiryDate = (Label)e.Item.FindControl("lblExpiryDate");
                lblExpiryDate.Text = Convert.ToDateTime(dr["ExpiryDate"].ToString()).ToString("dd-MMM-yyyy");

                decimal decCreditLimit     = Convert.ToDecimal(dr["CreditLimit"].ToString());
                decimal decCredit          = Convert.ToDecimal(dr["Credit"].ToString());
                decimal decAvailableCredit = decCreditLimit - decCredit;

                Label lblCreditLimit = (Label)e.Item.FindControl("lblCreditLimit");
                lblCreditLimit.Text = decCreditLimit.ToString("#,##0.#");

                Label lblCredit = (Label)e.Item.FindControl("lblCredit");
                lblCredit.Text = decCredit.ToString("#,##0.#");

                Label lblAvailableCredit = (Label)e.Item.FindControl("lblAvailableCredit");
                lblAvailableCredit.Text = decAvailableCredit.ToString("#,##0.#");

                Label lblTotalPurchases = (Label)e.Item.FindControl("lblTotalPurchases");
                lblTotalPurchases.Text = Convert.ToDecimal(dr["TotalPurchases"].ToString()).ToString("#,##0.#");

                Label lblLastBillingDate = (Label)e.Item.FindControl("lblLastBillingDate");
                lblLastBillingDate.Text = Convert.ToDateTime(dr["LastBillingDate"].ToString()).ToString("dd-MMM-yyyy");
            }
        }
        /// <summary>
        /// Adds a confirmation dialog to the delete button.
        /// </summary>
        /// <param name="e"></param>
        /// <remarks></remarks>
        /// <history>
        ///     [jbrinkman]	5/28/2007  Created
        /// </history>
        private static void AddConfirmActiontoDeleteButton(DataListItemEventArgs e)
        {
            var cmdDelete = (ImageButton)e.Item.FindControl("cmdDelete");

            ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem"));
        }
Example #38
0
        protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {
                LoadSortFieldOptions(e);
            }
            else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr            = (DataRowView)e.Item.DataItem;
                ImageButton imgItemDelete = (ImageButton)e.Item.FindControl("imgItemDelete");
                ImageButton imgItemEdit   = (ImageButton)e.Item.FindControl("imgItemEdit");

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["ProductSubGroupID"].ToString();
                if (chkList.Value == "1")
                {
                    chkList.Attributes.Add("disabled", "false");
                    imgItemDelete.Enabled = false; imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemEdit.Enabled   = false; imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                }
                else
                {
                    imgItemDelete.Enabled = cmdDelete.Visible; if (!imgItemDelete.Enabled)
                    {
                        imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    }
                    imgItemEdit.Enabled = cmdEdit.Visible; if (!imgItemEdit.Enabled)
                    {
                        imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    }
                    if (imgItemDelete.Enabled)
                    {
                        imgItemDelete.Attributes.Add("onClick", "return confirm_item_delete();");
                    }
                }

                HyperLink lnkProductGroupCode = (HyperLink)e.Item.FindControl("lnkProductGroupCode");
                lnkProductGroupCode.Text        = dr["ProductGroupCode"].ToString();
                lnkProductGroupCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_ProductGroup/Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(dr["ProductGroupID"].ToString(), Session.SessionID);

                HyperLink lnkProductSubGroupCode = (HyperLink)e.Item.FindControl("lnkProductSubGroupCode");
                lnkProductSubGroupCode.Text        = dr["ProductSubGroupCode"].ToString();
                lnkProductSubGroupCode.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);

                HyperLink lnkProductSubGroupName = (HyperLink)e.Item.FindControl("lnkProductSubGroupName");
                lnkProductSubGroupName.Text        = dr["ProductSubGroupName"].ToString();
                lnkProductSubGroupName.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);

                HyperLink lnkBaseUnitName = (HyperLink)e.Item.FindControl("lnkBaseUnitName");
                lnkBaseUnitName.Text        = dr["BaseUnitName"].ToString();
                lnkBaseUnitName.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Unit/Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(dr["BaseUnitID"].ToString(), Session.SessionID);

                Label lblPrice = (Label)e.Item.FindControl("lblPrice");
                lblPrice.Text = Convert.ToDecimal(dr["Price"].ToString()).ToString("#,##0.#0");

                Label lblPurchasePrice = (Label)e.Item.FindControl("lblPurchasePrice");
                lblPurchasePrice.Text = Convert.ToDecimal(dr["PurchasePrice"].ToString()).ToString("#,##0.#0");

                Label lblSequenceNo = (Label)e.Item.FindControl("lblSequenceNo");
                lblSequenceNo.Text = Convert.ToInt32(dr["SequenceNo"].ToString()).ToString("#,##0");

                //For anchor
                HtmlGenericControl divExpCollAsst = (HtmlGenericControl)e.Item.FindControl("divExpCollAsst");

                HtmlAnchor anchorDown = (HtmlAnchor)e.Item.FindControl("anchorDown");
                anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')";

                Label lblVAT = (Label)e.Item.FindControl("lblVAT");
                lblVAT.Text = Convert.ToDecimal(dr["VAT"].ToString()).ToString("#,##0.#0") + " %";

                Label lblEVAT = (Label)e.Item.FindControl("lblEVAT");
                lblEVAT.Text = Convert.ToDecimal(dr["EVAT"].ToString()).ToString("#,##0.#0") + " %";

                Label lblLocalTax = (Label)e.Item.FindControl("lblLocalTax");
                lblLocalTax.Text = Convert.ToDecimal(dr["LocalTax"].ToString()).ToString("#,##0.#0") + " %";
            }
        }
Example #39
0
        protected void dItems_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            //if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            //{
            //    //Label lb = (Label)(e.Item.FindControl("lbStatus"));
            //    HyperLink hl = (HyperLink)(e.Item.FindControl("hlAddItem"));
            //    //if (mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["status"].ToString() == "On Hold")
            //    //{
            //    //    // lb.Text = "On Hold";
            //    //    hl.NavigateUrl = "";
            //    //    hl.Text = "On Hold";
            //    //    // hl.Visible = false;
            //    //}
            //    //else
            //    //{
            //        //HyperLink hl = (HyperLink)(e.Item.FindControl("hlAddItem"));
            //        // lb.Visible = false;
            //        hl.NavigateUrl = hl.NavigateUrl + "&back=" + Server.UrlEncode(ViewState["backURL"].ToString());
            //    //}

            //    Label lb = (Label)(e.Item.FindControl("lbStatus"));
            //    if (mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["status"].ToString() == "On Hold")
            //    {
            //        lb.Text = "On Hold";
            //    }

            //    if (mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["status"].ToString() == "Sold")
            //    {
            //        lb.Text = "Sold Recently";
            //    }

            //}


            string s         = String.Empty;
            string iPath     = String.Empty;
            string imageName = String.Empty;

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label lb = (Label)(e.Item.FindControl("lbStatus"));
                if (mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["status"].ToString() == "On Hold")
                {
                    lb.Text = "On Hold";
                }

                if (mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["status"].ToString() == "Sold")
                {
                    lb.Text = "Sold Recently";
                }


                System.Web.UI.WebControls.Image i = (System.Web.UI.WebControls.Image)(e.Item.FindControl("image1"));


                s = mDataSet.Tables["udsp_getPagedResults9"].Rows[e.Item.ItemIndex]["Image1"].ToString();
                //string str = "this is a #string";
                imageName = s.Substring(s.LastIndexOf("/") + 1);
                iPath     = "~/images/Products/" + imageName;


                MemoryStream ms = null;
                Bitmap       bm = null;

                try
                {
                    if (!string.IsNullOrEmpty(iPath))
                    {
                        ms = new MemoryStream();
                        ImageBuilder.Current.Build(iPath, ms, new ResizeSettings("width=200&height=200&&mode=pad&bgcolor=black"), true);
                        bm         = new Bitmap(ms);
                        i.ImageUrl = BitmapToEmbedded(bm);
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    ms.Flush();
                    ms.Dispose();
                    bm = null;
                }
            }

            //protected void butMyProfile_B_ServerClick(object sender, ImageClickEventArgs e)
            //{
            //    Response.Redirect("chameleon-memberProfile.aspx", true);
            //}



            //ADDED BY ROB START

            //protected void butTraditional_ServerClick(object sender, System.Web.UI.ImageClickEventArgs e)
            //{
            //    Response.Redirect("chameleon-searchResults.aspx?Line=Traditional", true);
            //}

            //protected void butContemporary_ServerClick(object sender, System.Web.UI.ImageClickEventArgs e)
            //{
            //    Response.Redirect("chameleon-searchResults.aspx?Line=Contemporary", true);
            //}
        }
Example #40
0
        void rolesList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            ImageButton btnDelete = e.Item.FindControl("btnDelete") as ImageButton;

            UIHelper.AddConfirmationDialog(btnDelete, Resource.RolesDeleteWarning);
        }
Example #41
0
        protected void DataList2_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            int user_id = (int)Session["user_id"];



            Button req_btn        = e.Item.FindControl("btn_request") as Button;
            Button cancel_btn     = e.Item.FindControl("btn_cancel") as Button;
            Button disconnect_btn = e.Item.FindControl("btn_disconnect") as Button;


            cancel_btn.Visible     = false;
            req_btn.Visible        = false;
            disconnect_btn.Visible = false;


            if ((int)Session["role"] == 1)
            {
                SqlConnection con = (SqlConnection)Application["con"];
                SqlCommand    cmd = (SqlCommand)Application["cmd"];

                int disconnect = 0;



                //for connected people
                cmd.CommandText =
                    "SELECT * FROM js_connection WHERE (src_js_user_id = " + disconnect_btn.CommandArgument.ToString() + "AND dest_js_user_id = " + user_id + ") OR (dest_js_user_id = " + disconnect_btn.CommandArgument.ToString() + "AND src_js_user_id = " + user_id + ")";
                //"SELECT dest_js_user_id as user_id FROM js_connection WHERE src_js_user_id =" + user_id + ") UNION (SELECT src_js_user_id as user_id FROM js_connection WHERE dest_js_user_id =" + user_id + ")";
                try
                {
                    con.Open();
                    SqlDataReader sdr = cmd.ExecuteReader();

                    if (sdr.HasRows)
                    {
                        req_btn.Visible        = false;
                        cancel_btn.Visible     = false;
                        disconnect_btn.Visible = true;
                        disconnect             = 1;
                    }
                }
                finally
                {
                    cmd.Parameters.Clear();
                    con.Close();
                }

                if (disconnect == 0)
                {
                    disconnect_btn.Visible = false;

                    // for request send and cancel
                    cmd.CommandText = "SELECT * FROM request WHERE dest_user_id=" + req_btn.CommandArgument + "AND src_user_id=" + user_id;



                    try
                    {
                        con.Open();
                        SqlDataReader sdr = cmd.ExecuteReader();

                        if (sdr.HasRows)
                        {
                            req_btn.Visible    = false;
                            cancel_btn.Visible = true;
                        }
                        else
                        {
                            req_btn.Visible    = true;
                            cancel_btn.Visible = false;
                        }
                    }
                    finally
                    {
                        cmd.Parameters.Clear();
                        con.Close();
                    }
                }
            }
            else if ((int)Session["role"] == 2)
            {
                cancel_btn.Visible     = false;
                req_btn.Visible        = false;
                disconnect_btn.Visible = false;
            }
        }
Example #42
0
    //protected void custValidIngredients_ServerValidate(object source, ServerValidateEventArgs args)
    //{
    //    args.IsValid = true;
    //    if (string.IsNullOrEmpty(this.txtFoodName.Text))
    //    {
    //        args.IsValid = false;
    //        this.custValidIngredients.ErrorMessage = ValidationResources.FoodNameIsRequired;
    //    }
    //    else if (string.IsNullOrEmpty(this.txtQuantity.Text) &&
    //             string.IsNullOrEmpty(this.ddlFractions.Text))
    //    {
    //        args.IsValid = false;
    //        this.custValidIngredients.ErrorMessage = ValidationResources.QuantityIsRequired;
    //    }
    //    else if (!string.IsNullOrEmpty(this.txtQuantity.Text))
    //    {
    //        decimal result = 0;
    //        args.IsValid = decimal.TryParse(this.txtQuantity.Text, out result);
    //        this.custValidIngredients.ErrorMessage = ValidationResources.WrongQuantityFieldValue;
    //    }

    //    this.UpdatePanel4.Update();

    //}

    //protected void btnAddIngerdient_Command(object sender, CommandEventArgs e)
    //{
    //    try
    //    {
    //        this.Page.Validate("ingredients");
    //        if (!this.Page.IsValid)
    //        {
    //            return;
    //        }

    //        List<SRL_Ingredient> list = Ingredients;
    //        SRL_Ingredient ingredient = null;
    //        //List<Ingredient> list = Ingredients;
    //        //Ingredient ingredient = null;
    //        string commandArg = e.CommandArgument as string;

    //        if (commandArg == MyGlobalResources.Add)
    //        {
    //            ingredient = new SRL_Ingredient();
    //            //ingredient = new Ingredient();
    //            list.Add(ingredient);
    //        }
    //        else if (!string.IsNullOrEmpty(commandArg))
    //        {
    //            int itemIndex = int.Parse(commandArg);
    //            ingredient = list[itemIndex];
    //        }

    //        if (ingredient == null)
    //            return;

    //        //ingredient.FoodName = this.txtFoodName.Text;
    //        //ingredient.Remarks = this.txtFoodRemark.Text;
    //        ingredient.Quantity = 0.0M;
    //        //if (!string.IsNullOrEmpty(this.txtQuantity.Text))
    //        //{
    //        //    ingredient.Quantity = decimal.Parse(this.txtQuantity.Text);
    //        //}
    //        //if (!string.IsNullOrEmpty(ddlFractions.SelectedItem.Value))
    //        //{
    //        //    decimal quantity;
    //        //    decimal.TryParse(ddlFractions.SelectedItem.Value, out quantity);
    //        //    ingredient.Quantity += quantity;
    //        //}

    //        //ingredient.CompleteValue = this.txtQuantity.Text;
    //        //ingredient.FractionValue = this.ddlFractions.SelectedItem.Value;

    //        //ingredient.MeasurementUnitId = int.Parse(this.ddlMeasurementUnits.SelectedItem.Value);
    //        //ingredient.MeasurementUnitName = this.ddlMeasurementUnits.SelectedItem.Text;
    //        //ingredient.MEASUREMENT_NAME = this.ddlMeasurementUnits.SelectedItem.Text;

    //        this.Ingredients = list;
    //        //this.dlistIngredients.DataSource = this.Ingredients.ToArray();
    //        //this.dlistIngredients.DataBind();

    //        //this.txtFoodName.Text = "";
    //        //this.txtFoodRemark.Text = "";
    //        //this.txtQuantity.Text = "";
    //        //this.ddlFractions.Text = "";
    //        //this.ddlMeasurementUnits.SelectedIndex = 0;
    //        //this.txtFoodName.Focus();

    //        //this.btnAddIngerdient.CommandArgument = MyGlobalResources.Add;
    //        //this.imgAdd.Visible = true;
    //        //this.imgUpdate.Visible = false;

    //        //this.UpdatePanel2.Update();
    //        //this.UpdatePanel3.Update();
    //        //this.UpdatePanel4.Update();
    //    }
    //    catch(Exception ex)
    //    {
    //    }
    //}

    //protected void btnAddIngerdient_Click(object sender, EventArgs e)
    //{
    //    //this.mpeRecipe.Show();

    //    this.Page.Validate("ingredients");
    //    if (!this.Page.IsValid)
    //    {
    //        return;
    //    }

    //    List<SRL_Ingredient> list = this.Ingredients;
    //    SRL_Ingredient ingredient = null;
    //    //List<Ingredient> list = Ingredients;
    //    //Ingredient ingredient = null;
    //    //if (this.btnAddIngerdient.Text == MyGlobalResources.Add)
    //    //{
    //    //    ingredient = new SRL_Ingredient();
    //    //    //ingredient = new Ingredient();
    //    //    list.Add(ingredient);
    //    //}
    //    //else if (!string.IsNullOrEmpty(this.btnAddIngerdient.Attributes["ItemIndex"]))
    //    //{
    //    //    int itemIndex = int.Parse(this.btnAddIngerdient.Attributes["ItemIndex"]);
    //    //    ingredient = list[itemIndex];
    //    //}

    //    if (ingredient == null)
    //        return;

    //    //ingredient.FoodName = this.txtFoodName.Text;
    //    //ingredient.Remarks = this.txtFoodRemark.Text;
    //    //ingredient.Quantity = 0;
    //    //if (!string.IsNullOrEmpty(this.txtQuantity.Text))
    //    //{
    //    //    ingredient.Quantity = decimal.Parse(this.txtQuantity.Text);
    //    //}
    //    //if (!string.IsNullOrEmpty(this.ddlFractions.SelectedItem.Value))
    //    //{
    //    //    ingredient.Quantity += decimal.Parse(this.ddlFractions.SelectedItem.Value);
    //    //}

    //    //ingredient.CompleteValue = this.txtQuantity.Text;
    //    //ingredient.FractionValue = this.ddlFractions.SelectedItem.Value;

    //    //ingredient.MeasurementUnitId = int.Parse(this.ddlMeasurementUnits.SelectedItem.Value);
    //    //ingredient.MeasurementUnitName = this.ddlMeasurementUnits.SelectedItem.Text;
    //    //ingredient.MEASUREMENT_NAME = this.ddlMeasurementUnits.SelectedItem.Text;

    //    this.Ingredients = list;
    //    //this.dlistIngredients.DataSource = this.Ingredients.ToArray();
    //    //this.dlistIngredients.DataBind();

    //    //this.txtFoodName.Text = "";
    //    //this.txtFoodRemark.Text = "";
    //    //this.txtQuantity.Text = "";
    //    //this.ddlFractions.Text = "";
    //    //this.txtFoodName.Focus();

    //    //this.btnAddIngerdient.Text = MyGlobalResources.Add;
    //    //this.btnAddIngerdient.Attributes["ItemIndex"] = "";

    //}

    //protected void btnUpdateIngredient_Click(object sender, EventArgs e)
    //{
    //    LinkButton btn = sender as LinkButton;
    //    DataListItem item = btn.Parent.Parent as DataListItem;

    //    List<SRL_Ingredient> list = this.Ingredients;
    //    SRL_Ingredient ingredient = list[item.ItemIndex];
    //    //List<Ingredient> list = Ingredients;
    //    //Ingredient ingredient = list[item.ItemIndex];

    //    //this.txtFoodName.Text = ingredient.FoodName;
    //    //this.txtFoodRemark.Text = ingredient.Remarks;

    //    //if (!string.IsNullOrEmpty(ingredient.CompleteValue))
    //    //{
    //    //    this.txtQuantity.Text = ingredient.CompleteValue;
    //    //}
    //    //else
    //    //{
    //    //    this.txtQuantity.Text = "";
    //    //}

    //    //if (!string.IsNullOrEmpty(ingredient.FractionValue))
    //    //{
    //    //    this.ddlFractions.Text = ingredient.FractionValue;
    //    //}
    //    //else
    //    //{
    //    //    this.ddlFractions.Text = "";
    //    //}

    //    //this.ddlMeasurementUnits.Text = ingredient.MeasurementUnitId.ToString();
    //    //this.txtFoodName.Focus();

    //    //this.btnAddIngerdient.Text = MyGlobalResources.Update;
    //    //this.btnAddIngerdient.Attributes["ItemIndex"] = item.ItemIndex.ToString();
    //    //this.btnAddIngerdient.CommandArgument = item.ItemIndex.ToString();
    //    //this.imgAdd.Visible = false;
    //    //this.imgUpdate.Visible = true;

    //    //this.UpdatePanel3.Update();
    //    //this.UpdatePanel4.Update();

    //    //this.mpeRecipe.Show();
    //}

    protected void dlistIngredients_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        PlaceHolder buttons = (PlaceHolder)e.Item.FindControl("buttons");

        buttons.Visible = !ReadOnly;
    }
Example #43
0
        void userRoles_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            ImageButton btnRemoveRole = e.Item.FindControl("btnRemoveRole") as ImageButton;

            UIHelper.AddConfirmationDialog(btnRemoveRole, Resource.ManageUsersRemoveRoleWarning);
        }
Example #44
0
    protected void dlperiods_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        try
        {
            DataRowView dr             = (DataRowView)e.Item.DataItem;
            DataGrid    dgstudentmarks = (DataGrid)e.Item.FindControl("dgstudentmarks");
            Label       lblperiod      = (Label)e.Item.FindControl("lblperiod");
            Label       lblteacher     = (Label)e.Item.FindControl("lblteacher");
            Label       lblsubject     = (Label)e.Item.FindControl("lblsubject");
            DataAccess  da             = new DataAccess();
            DataSet     ds;

            str = "select * from (";
            str = str + " select a.intid,a.strperiod,a.strsubject,b.strtittle + ' ' + ltrim(b.strfirstname) + ' ' + ltrim(b.strmiddlename) + ' ' + ltrim(b.strlastname) as strteacher from (";
            str = str + " select intid,strperiod,strsubject,strteacher from tbltimetable where strstandard + ' - ' + strsection='" + Session["StudentClass"].ToString() + "' and strday='" + lbltimetabletoday.Text + "'";
            str = str + " and strsubject not like '%Language' and strsubject not like 'Extra Activities'";
            str = str + " and strsubject not like 'None' and strperiod not like '%Interval' and strperiod not like 'Lunch'";
            str = str + " union all";
            str = str + " select a.intid,a.strperiod,b.strlanguage as strsubject,b.strteacher from tbltimetable a, tbltimetable2 b where a.strstandard=b.strstandard1 and ";
            str = str + " a.strsection=b.strsection1 and a.strday=b.strday and a.strperiod=b.strperiod and ";
            str = str + " a.strstandard + ' - ' + a.strsection='" + Session["StudentClass"].ToString() + "' and a.strday='" + lbltimetabletoday.Text + "'";
            str = str + " and a.strsubject like '%Language' and a.strsubject not like 'Extra Activities' and a.strsubject not like 'None'";
            str = str + " and a.strperiod not like '%Interval' and a.strperiod not like 'Lunch'";
            str = str + " union all";
            str = str + " select a.intid,a.strperiod,b.strlanguage as strsubject,b.strteacher from tbltimetable a, tbltimetable3 b where a.strstandard=b.strstandard and ";
            str = str + " a.strsection=b.strsection and a.strday=b.strday and a.strperiod=b.strperiod and ";
            str = str + " a.strstandard + ' - ' + a.strsection='" + Session["StudentClass"].ToString() + "' and a.strday='" + lbltimetabletoday.Text + "'";
            str = str + " and a.strsubject not like '%Language' and a.strsubject like 'Extra Activities' and a.strsubject not like 'None'";
            str = str + " and a.strperiod not like '%Interval' and a.strperiod not like 'Lunch') as a, tblemployee b";
            str = str + " where a.strteacher=b.intid";
            str = str + " union all ";
            str = str + " select intid,strperiod,strperiod as strsubject,'' as strteacher  from tbltimetable where strstandard + ' - ' + strsection='" + Session["StudentClass"].ToString() + "' and strday='" + lbltimetabletoday.Text + "'";
            str = str + " and (strperiod like '%Interval' or strperiod like 'Lunch')";
            str = str + " union all ";
            str = str + " select intid,strperiod,'Not Alloted' as strsubject,'Not Alloted' as strteacher  from tbltimetable where strstandard + ' - ' + strsection='" + Session["StudentClass"].ToString() + "' and strday='" + lbltimetabletoday.Text + "'";
            str = str + " and strsubject like 'None'";
            str = str + " union all";
            str = str + " select intid,strperiod,'Not Alloted' as strsubject,'Not Alloted' as strteacher from tbltimetable where strstandard + ' - ' + strsection='" + Session["StudentClass"].ToString() + "' and strday='" + lbltimetabletoday.Text + "'";
            str = str + " and strsubject like '%Language' and strsubject not like 'Extra Activities' and strsubject not like 'None' ";
            str = str + " and strperiod not like '%Interval' and strperiod not like 'Lunch'";
            str = str + " and intid not in(";
            str = str + " select a.intid from tbltimetable a, tbltimetable2 b where a.strstandard=b.strstandard1 and ";
            str = str + " a.strsection=b.strsection1 and a.strday=b.strday and a.strperiod=b.strperiod and ";
            str = str + " a.strstandard + ' - ' + a.strsection='" + Session["StudentClass"].ToString() + "' and a.strday='" + lbltimetabletoday.Text + "'";
            str = str + " and a.strsubject like '%Language' and a.strsubject not like 'Extra Activities' and a.strsubject not like 'None'";
            str = str + " and a.strperiod not like '%Interval' and a.strperiod not like 'Lunch'";
            str = str + " )";
            str = str + " union all";
            str = str + " select intid,strperiod,'Not Alloted' as strsubject,'Not Alloted' as strteacher from tbltimetable where strstandard + ' - ' + strsection='" + Session["StudentClass"].ToString() + "' and strday='" + lbltimetabletoday.Text + "'";
            str = str + " and strsubject not like '%Language' and strsubject like 'Extra Activities' and strsubject not like 'None' ";
            str = str + " and strperiod not like '%Interval' and strperiod not like 'Lunch'";
            str = str + " and intid not in(";
            str = str + " select a.intid from tbltimetable a, tbltimetable3 b where a.strstandard=b.strstandard and ";
            str = str + " a.strsection=b.strsection and a.strday=b.strday and a.strperiod=b.strperiod and ";
            str = str + " a.strstandard + ' - ' + a.strsection='" + Session["StudentClass"].ToString() + "' and a.strday='" + lbltimetabletoday.Text + "'";
            str = str + " and a.strsubject not like '%Language' and a.strsubject like 'Extra Activities' and a.strsubject not like 'None'";
            str = str + " and a.strperiod not like '%Interval' and a.strperiod not like 'Lunch'";
            str = str + " )";
            str = str + " ) as a1 where strperiod='" + lblperiod.Text + "' order by intid";

            ds = new DataSet();
            ds = da.ExceuteSql(str);
            if (ds.Tables[0].Rows.Count > 0)
            {
                lblteacher.Text = ds.Tables[0].Rows[0]["strteacher"].ToString();
                lblsubject.Text = ds.Tables[0].Rows[0]["strsubject"].ToString();
            }
        }
        catch { }
    }
Example #45
0
 protected void dtPaginacionConfiguracion_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
Example #46
0
    protected void lstRequirements_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Image        img1;
        Image        img2;
        CheckBox     chkItem;
        Label        txtItemDesc;
        Item         item;
        HyperLink    lnkHelp;
        Panel        pnlHelp;
        Label        lblHelp;
        FormControls formControls;

        DataList    lstRequirements = (DataList)sender;
        List <Item> itemList        = (List <Item>)lstRequirements.DataSource;

        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {
            img1        = (Image)e.Item.FindControl("imgspace1");
            img2        = (Image)e.Item.FindControl("imgspace2");
            chkItem     = (CheckBox)e.Item.FindControl("chkItem");
            txtItemDesc = (Label)e.Item.FindControl("txtItemDesc");
            lnkHelp     = (HyperLink)e.Item.FindControl("lnkHelp");
            pnlHelp     = (Panel)e.Item.FindControl("pnlHelp");
            lblHelp     = (Label)e.Item.FindControl("lblHelp");

            item = (Item)e.Item.DataItem;   //get the current datasource row

            img2.Visible     = false;
            txtItemDesc.Text = item.Description.Trim();
            if (item.ListLevel == 2)
            {
                img1.Style.Remove("width");
                img1.Style.Add("width", "35px");
            }
            else if (item.ListLevel == 3)
            {
                img1.Style.Remove("width");
                img1.Style.Add("width", "60px");
            }
            else if (item.ListLevel == 4)
            {
                img1.Style.Remove("width");
                img1.Style.Add("width", "85px");
            }
            if (item.DisplayType == 0)  //label
            {
                chkItem.Visible       = false;
                txtItemDesc.Font.Bold = true;
                //txtItemDesc.Style.Add("color", "blue");
                img1.Style.Remove("width");
            }
            else
            {
                /*****we try to put the controls into the the form controls list, so later on we can get all the client ids****/
                ////formControls = (FormControls)formControlsList[item.ElementID];
                chkItem.Checked = (item.Checked == 1) ? true : false;
                chkItem.Attributes.Add("onclick", "javascript:changeItemValue('" + item.ID + "', this.checked);");
                ////formControls.ItemCheckBoxesList.Add(item.ID, chkItem);
                sScript.Text += "arrForms['" + FormID.ToString() + "'][1][" + CheckBoxCount++ + "] = new Array('" + item.ID + "','" + chkItem.ClientID + "');";
                sScript.Text += "arrItemValue[" + item.ID + "]=" + ((chkItem.Checked) ? "true" : "false") + ";";
            }

            if (string.IsNullOrEmpty(item.HelpTips))
            {
                lnkHelp.Visible = false;
                pnlHelp.Visible = false;
            }
            else
            {
                lnkHelp.NavigateUrl = "javascript:displayHelp('" + pnlHelp.ClientID + "');";
                lblHelp.Text        = Server.HtmlEncode(item.HelpTips);
            }
        }
    }
Example #47
0
        protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["CreditMemoItemID"].ToString();

                HyperLink lnkDescription = (HyperLink)e.Item.FindControl("lnkDescription");
                lnkDescription.Text        = dr["Description"].ToString();
                lnkDescription.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/Default.aspx?task=" + Common.Encrypt("det", Session.SessionID) + "&id=" + Common.Encrypt(dr["ProductID"].ToString(), Session.SessionID);

                HyperLink lnkMatrixDescription = (HyperLink)e.Item.FindControl("lnkMatrixDescription");
                if (dr["MatrixDescription"].ToString() == string.Empty || dr["MatrixDescription"].ToString() == null)
                {
                    lnkMatrixDescription.Text = "_";
                }
                else
                {
                    lnkMatrixDescription.Text        = dr["MatrixDescription"].ToString();
                    lnkMatrixDescription.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/_VariationsMatrix/Default.aspx?task=" + Common.Encrypt("det", Session.SessionID) + "&prodid=" + Common.Encrypt(dr["ProductID"].ToString(), Session.SessionID) + "&id=" + Common.Encrypt(dr["VariationMatrixID"].ToString(), Session.SessionID);
                }

                Label lblQuantity = (Label)e.Item.FindControl("lblQuantity");
                lblQuantity.Text = Convert.ToDecimal(dr["Quantity"].ToString()).ToString("#,##0.#0");

                Label lblProductUnitID = (Label)e.Item.FindControl("lblProductUnitID");
                lblProductUnitID.Text = dr["ProductUnitID"].ToString();

                Label lblProductUnitCode = (Label)e.Item.FindControl("lblProductUnitCode");
                lblProductUnitCode.Text = dr["ProductUnitCode"].ToString();

                Label lblUnitCost = (Label)e.Item.FindControl("lblUnitCost");
                lblUnitCost.Text = Convert.ToDecimal(dr["UnitCost"].ToString()).ToString("#,##0.#0");

                Label lblDiscountApplied = (Label)e.Item.FindControl("lblDiscountApplied");
                lblDiscountApplied.Text = Convert.ToDecimal(dr["DiscountApplied"].ToString()).ToString("#,##0.#0");

                DiscountTypes DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), dr["DiscountType"].ToString());
                if (DiscountType == DiscountTypes.Percentage)
                {
                    Label lblPercent = (Label)e.Item.FindControl("lblPercent");
                    lblPercent.Visible = true;
                }

                Label lblAmount = (Label)e.Item.FindControl("lblAmount");
                lblAmount.Text = Convert.ToDecimal(dr["Amount"].ToString()).ToString("#,##0.#0");

                Label lblVAT = (Label)e.Item.FindControl("lblVAT");
                lblVAT.Text = Convert.ToDecimal(dr["VAT"].ToString()).ToString("#,##0.#0");

                Label lblEVAT = (Label)e.Item.FindControl("lblEVAT");
                lblEVAT.Text = Convert.ToDecimal(dr["EVAT"].ToString()).ToString("#,##0.#0");

                Label lblisVATInclusive = (Label)e.Item.FindControl("lblisVATInclusive");
                lblisVATInclusive.Text = Convert.ToBoolean(Convert.ToInt16(dr["isVATInclusive"].ToString())).ToString();

                Label lblLocalTax = (Label)e.Item.FindControl("lblLocalTax");
                lblLocalTax.Text = Convert.ToDecimal(dr["LocalTax"].ToString()).ToString("#,##0.#0");

                Label lblRemarks = (Label)e.Item.FindControl("lblRemarks");
                lblRemarks.Text = dr["Remarks"].ToString();

                //For anchor
                HtmlGenericControl divExpCollAsst = (HtmlGenericControl)e.Item.FindControl("divExpCollAsst");

                HtmlAnchor anchorDown = (HtmlAnchor)e.Item.FindControl("anchorDown");
                anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')";
            }
        }
Example #48
0
 protected void DataListProd_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
 protected void dtPaginacionHistoricoFianzas_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            e.Item.Attributes.Add("onmouseover", "this.style.background-color='#ccsdcc'");
            e.Item.Attributes.Add("onmouseout", "this.style.background-color='#ffsfff'");

            System.Data.DataRowView drv = (DataRowView)(e.Item.DataItem);
            string PL    = DataBinder.Eval(e.Item.DataItem, "Plantcode").ToString();
            string PRO   = DataBinder.Eval(e.Item.DataItem, "procureData").ToString();
            string CL    = DataBinder.Eval(e.Item.DataItem, "ClosingStock").ToString();
            string ROUT  = DataBinder.Eval(e.Item.DataItem, "RouteTime").ToString();
            string CASKC = DataBinder.Eval(e.Item.DataItem, "CashCollection").ToString();
            string GAR   = DataBinder.Eval(e.Item.DataItem, "GarberTesting").ToString();
            //string LD = DataBinder.Eval(e.Item.DataItem, "LiveData").ToString();

            //if ((PRO == "Pending") || (CL == "Pending") || (ROUT == "Pending") || (CASKC == "Pending") || (GAR == "Pending") || (LD == "Pending") )
            //{
            //    e.Item.ForeColor = System.Drawing.Color.Red;
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.HotPink;

            //}
            //            LinkLabel lblItem = e.Item.FindControl("Item") as LinkLabel

            //if(lblitem !=null)
            //{
            //// add properties to it
            //lblItem.Attributes.Add("onclick", "this.style.background='#eeff00'");

            //}



            //if (PRO == "Pending")
            //{
            //    e.Item.BackColor = System.Drawing.Color.Red;

            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}

            //if (CL == "Pending")
            //{
            //    e.Item.BackColor = System.Drawing.Color.Red;
            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}

            //if (ROUT == "Pending")
            //{
            //  //  e.Item.BackColor = System.Drawing.Color.Red;
            //    e.Item.Attributes.Add("style", "background-color:Green;");
            //}
            //else
            //{
            //    e.Item.Attributes.Add("style", "background-color:Green;");
            //}

            //if (CASKC == "Pending")
            //{
            //    e.Item.BackColor = System.Drawing.Color.Red;
            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}
            //if (GAR == "Pending")
            //{
            //    e.Item.BackColor = System.Drawing.Color.Red;
            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}

            //if (LD == "Pending")
            //{
            //    e.Item.BackColor = System.Drawing.Color.Red;
            //}
            //else
            //{
            //    e.Item.BackColor = System.Drawing.Color.GreenYellow;
            //}
            //}
        }
    }
Example #51
0
    private void BindingItem(DataListItemEventArgs e)
    {
        DataRowView dr = (DataRowView)e.Item.DataItem;

        string q_sbj_id     = DataTypeUtility.GetValue(dr["Q_SBJ_ID"]);
        string q_sbj_name   = DataTypeUtility.GetValue(dr["Q_SBJ_NAME"]);
        string q_sbj_define = DataTypeUtility.GetValue(dr["Q_SBJ_DEFINE"]);
        double weight       = DataTypeUtility.GetToDouble(dr["WEIGHT"]);

        quizWeight.Columns.Add(q_sbj_id, typeof(double));
        if (quizWeight.Rows.Count == 0)
        {
            quizWeight.Rows.Add(weight / 100);
        }
        else
        {
            quizWeight.Rows[0][q_sbj_id] = weight / 100;
        }


        Literal         ltrSbjName   = e.Item.FindControl("ltrLevelSbjName") as Literal;
        Literal         ltrSbjDefine = e.Item.FindControl("ltrLevelSbjDefine") as Literal;
        RadioButtonList rBtnList     = e.Item.FindControl("rBtnList") as RadioButtonList;
        TextBox         txtValue     = e.Item.FindControl("txtLevelValue") as TextBox;
        HiddenField     hdfSubItmYN  = e.Item.FindControl("tmpSubItmYN") as HiddenField;
        Literal         ltrPointData = e.Item.FindControl("ltrLevelPointData") as Literal;
        DataList        dtList       = e.Item.FindControl("DataList3") as DataList;
        HtmlTableCell   tdHeader     = e.Item.FindControl("tdHeader") as HtmlTableCell;
        HtmlTableCell   tdContent    = null;



        if (dtList == null)
        {
            tdContent = e.Item.FindControl("tdContent") as HtmlTableCell;
        }
        else
        {
            tdContent = dtList.FindControl("tdContent") as HtmlTableCell;
        }

        TextBoxCommon.SetOnlyPercent(txtValue);

        ltrSbjName.Text   = q_sbj_name;
        ltrSbjDefine.Text = q_sbj_define;

        Biz_QuestionItems questionItems = new Biz_QuestionItems();
        DataSet           ds            = questionItems.GetQuestionItem("", q_sbj_id, Q_OBJ_ID);

        SUBJECT_ITEM_YN   = ds.Tables[0].Rows[0]["SUBJECT_ITEM_YN"].ToString();
        hdfSubItmYN.Value = SUBJECT_ITEM_YN;

        if (ds.Tables[0].Rows.Count == 0)
        {
            rBtnList.Visible = false;
            txtValue.Visible = false;
            txtValue.Width   = Unit.Percentage(100);
        }
        else if (SUBJECT_ITEM_YN == "1")
        {
            rBtnList.Visible = false;
            txtValue.Visible = true;
            txtValue.Width   = Unit.Percentage(100);

            Biz_Prj_QuestionData questionDatas = new Biz_Prj_QuestionData(COMP_ID
                                                                          , EST_ID
                                                                          , ESTTERM_REF_ID
                                                                          , ESTTERM_SUB_ID
                                                                          , ESTTERM_STEP_ID
                                                                          , EST_DEPT_ID
                                                                          , EST_EMP_ID
                                                                          , PRJ_REF_ID
                                                                          , q_sbj_id);

            txtValueText  = questionDatas.Text_Value;
            txtValue.Text = txtValueText;
        }
        else
        {
            rBtnList.Visible = true;
            txtValue.Visible = false;

            // 만약 질의항목에 설명을 표시할 경우
            if (_q_item_desc_use_yn.Equals("Y"))
            {
                rBtnList.RepeatLayout  = RepeatLayout.Table;
                rBtnList.DataTextField = "Q_ITEM_DESC";
                tdHeader.Style.Add("width", "260px");

                if (tdContent != null)
                {
                    tdContent.Style.Add("width", "262px");
                }
            }

            rBtnList.DataSource = ds;
            rBtnList.DataBind();

            if (READ_ONLY_YN.Equals("N"))
            {
                Biz_Prj_QuestionData questionDatas = new Biz_Prj_QuestionData(COMP_ID
                                                                              , EST_ID
                                                                              , ESTTERM_REF_ID
                                                                              , ESTTERM_SUB_ID
                                                                              , ESTTERM_STEP_ID
                                                                              , EST_DEPT_ID
                                                                              , EST_EMP_ID
                                                                              , PRJ_REF_ID
                                                                              , q_sbj_id);
                // 데이타 바인딩
                WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);

                groupNumber += questionDatas.Point;

                if (questionDatas.Point.Equals(0))
                {
                    noneSelectCount = noneSelectCount + 1;
                }


                if (questionDatas.Point > 0)
                {
                    ltrPointData.Text = "<font color=#BF0000>" + DataTypeUtility.GetToInt32_String(questionDatas.Point, "##.#0") + "</font>점";
                    //TOTALPOINT += questionDatas.Point * weight;
                }

                //----------------- 라디오버튼 유효성 검사 시작 -------------------

                string clientIDs = "";

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (i != 0)
                    {
                        clientIDs += ";";
                    }

                    clientIDs += rBtnList.ClientID + "_" + i.ToString();
                }

                VALID_SCRIPT += string.Format("if(ValidQuestion('{0}', '{1}') == false) return false;", dr["Q_SBJ_NAME"], clientIDs);

                //----------------- 라디오버튼 유효성 검사 끝 -------------------
            }
        }
    }
Example #52
0
        protected void dv_lotto539_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Mariadb  m      = new Mariadb(this.CN);
                DataList dvlist = (DataList)e.Item.FindControl("dvlist");
                if (dvlist != null)
                {
                    string period = dv_lotto539.DataKeys[e.Item.ItemIndex].ToString();
                    //暗彩539列出有中獎的清單
                    string       sql = "SELECT D.NICK_NAME,A.*,B.CAL_NAME FROM PRIZE539_NEXT_NONLEGAL AS A JOIN CALCULATION_TYPE AS B ON A.CAL_ID=B.CAL_ID JOIN USER_FORECAST AS C ON A.FORECAST_UID=C.FORECAST_UID JOIN USERS AS D ON C.USER_UID=D.USER_UID WHERE (S2_IS_WINNING='Y' OR S3_IS_WINNING='Y' OR S4_IS_WINNING='Y') AND A.NEXT_PERIOD=@PERIOD   ";
                    MySqlCommand cmd = new MySqlCommand(sql);
                    cmd.Parameters.AddWithValue("@PERIOD", period);
                    DataSet ds = m.GetDataset(cmd);

                    DataTable dt = new DataTable();
                    dt.Columns.Add("NICK_NAME");
                    dt.Columns.Add("CAL_NAME");
                    dt.Columns.Add("NEXT_PERIOD");
                    dt.Columns.Add("STAR_TYPE");
                    dt.Columns.Add("NUMS");
                    dt.Columns.Add("MATCH_NUM");

                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (ds.Tables[0].Rows[i]["S4_IS_WINNING"].ToString() == "Y")
                        {
                            DataRow dr = dt.NewRow();
                            dr["NICK_NAME"]   = ds.Tables[0].Rows[i]["NICK_NAME"].ToString();
                            dr["CAL_NAME"]    = ds.Tables[0].Rows[i]["CAL_NAME"].ToString();
                            dr["NEXT_PERIOD"] = ds.Tables[0].Rows[i]["NEXT_PERIOD"].ToString();
                            dr["STAR_TYPE"]   = "4星";
                            dr["NUMS"]        = "(" + ds.Tables[0].Rows[i]["4_STAR_1"].ToString() + ")(" + ds.Tables[0].Rows[i]["4_STAR_2"].ToString() + ")(" + ds.Tables[0].Rows[i]["4_STAR_3"].ToString() + ")(" + ds.Tables[0].Rows[i]["4_STAR_4"].ToString() + ")";
                            dr["MATCH_NUM"]   = ds.Tables[0].Rows[i]["S4_MATCH_NUM"].ToString();
                            dt.Rows.Add(dr);
                        }
                        if (ds.Tables[0].Rows[i]["S3_IS_WINNING"].ToString() == "Y")
                        {
                            DataRow dr = dt.NewRow();
                            dr["NICK_NAME"]   = ds.Tables[0].Rows[i]["NICK_NAME"].ToString();
                            dr["CAL_NAME"]    = ds.Tables[0].Rows[i]["CAL_NAME"].ToString();
                            dr["NEXT_PERIOD"] = ds.Tables[0].Rows[i]["NEXT_PERIOD"].ToString();
                            dr["STAR_TYPE"]   = "3星";
                            dr["NUMS"]        = "(" + ds.Tables[0].Rows[i]["3_STAR_1"].ToString() + ")(" + ds.Tables[0].Rows[i]["3_STAR_2"].ToString() + ")(" + ds.Tables[0].Rows[i]["3_STAR_3"].ToString() + ")";
                            dr["MATCH_NUM"]   = ds.Tables[0].Rows[i]["S3_MATCH_NUM"].ToString();
                            dt.Rows.Add(dr);
                        }
                        if (ds.Tables[0].Rows[i]["S2_IS_WINNING"].ToString() == "Y")
                        {
                            DataRow dr = dt.NewRow();
                            dr["NICK_NAME"]   = ds.Tables[0].Rows[i]["NICK_NAME"].ToString();
                            dr["CAL_NAME"]    = ds.Tables[0].Rows[i]["CAL_NAME"].ToString();
                            dr["NEXT_PERIOD"] = ds.Tables[0].Rows[i]["NEXT_PERIOD"].ToString();
                            dr["STAR_TYPE"]   = "2星";
                            dr["NUMS"]        = "(" + ds.Tables[0].Rows[i]["2_STAR_1"].ToString() + ")(" + ds.Tables[0].Rows[i]["2_STAR_2"].ToString() + ")";
                            dr["MATCH_NUM"]   = ds.Tables[0].Rows[i]["S2_MATCH_NUM"].ToString();
                            dt.Rows.Add(dr);
                        }
                    }


                    dvlist.DataSource = dt;
                    dvlist.DataBind();
                }
            }
        }
        protected void dlAddress_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.EditItem)
            {
                AddressControl  ctrlAddress    = e.Item.FindControl("ctrlAddress") as AddressControl;
                CreditCardPanel ctrlCreditCard = e.Item.FindControl("ctrlCreditCard") as CreditCardPanel;
                Echeck          ctrlECheck     = e.Item.FindControl("ctrlECheck") as Echeck;
                int             addyID         = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "AddressID"));
                PopulateAddressControlValues(ctrlAddress, ctrlCreditCard, ctrlECheck, e.Item.ItemIndex, addyID);

                if (CustomerCCRequired)
                {
                    TableRow trCCInformation = e.Item.FindControl("trCCInformation") as TableRow;
                    if (trCCInformation != null)
                    {
                        if (AddressMode == AddressTypes.Billing)
                        {
                            RadioButtonList rblPaymentMethodInfo = e.Item.FindControl("rblPaymentMethodInfo") as RadioButtonList;
                            Panel           pnlCCData            = e.Item.FindControl("pnlCCData") as Panel;
                            Panel           pnlECData            = e.Item.FindControl("pnlECData") as Panel;

                            if (rblPaymentMethodInfo.SelectedValue.Equals(AppLogic.ro_PMCreditCard,
                                                                          StringComparison.InvariantCultureIgnoreCase))
                            {
                                trCCInformation.Visible = true;
                                rblPaymentMethodInfo.Items[0].Enabled = true;
                                pnlCCData.Visible = true;
                            }
                            if (!ShowEcheck)
                            {
                                rblPaymentMethodInfo.Items.Remove(rblPaymentMethodInfo.Items[1]);
                            }

                            //Image for eCheck
                            if (ShowEcheck && ctrlECheck != null)
                            {
                                ctrlECheck = e.Item.FindControl("ctrlECheck") as Echeck;
                                ctrlECheck.ECheckBankABAImage1    = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_aba.gif", SkinID.ToString()));
                                ctrlECheck.ECheckBankABAImage2    = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_aba.gif", SkinID.ToString()));
                                ctrlECheck.ECheckBankAccountImage = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_account.gif", SkinID.ToString()));
                                ctrlECheck.ECheckNoteLabel        = string.Format(AppLogic.GetString("address.cs.48", SkinID, ThisCustomer.LocaleSetting), AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/check_micr.gif"));
                            }

                            //hide payment methods if storeccindb = false
                        }
                        else if (AddressMode == AddressTypes.Shipping)
                        {
                            trCCInformation.Visible = false;
                        }
                    }
                }
            }

            if (e.Item.ItemType == ListItemType.Footer)
            {
                LinkButton  lbAddNewAddress = e.Item.FindControl("lbAddNewAddress") as LinkButton;
                ImageButton ibAddNewAddress = e.Item.FindControl("ibAddNewAddress") as ImageButton;

                if (lbAddNewAddress != null)
                {
                    if (AddressMode == AddressTypes.Billing)
                    {
                        string billingText = AppLogic.GetString("address.cs.70", SkinID, ThisCustomer.LocaleSetting);
                        lbAddNewAddress.Text = billingText;
                        if (ibAddNewAddress != null)
                        {
                            ibAddNewAddress.ToolTip       = billingText;
                            ibAddNewAddress.AlternateText = billingText;
                        }
                    }
                    else if (AddressMode == AddressTypes.Shipping)
                    {
                        string shippingText = AppLogic.GetString("address.cs.71", SkinID, ThisCustomer.LocaleSetting);
                        lbAddNewAddress.Text = shippingText;
                        if (ibAddNewAddress != null)
                        {
                            ibAddNewAddress.ToolTip       = shippingText;
                            ibAddNewAddress.AlternateText = shippingText;
                        }
                    }
                }
            }

            if ((e.Item.ItemType == ListItemType.Item ||
                 e.Item.ItemType == ListItemType.AlternatingItem))
            {
                //Assign numbering for individual address
                (e.Item.FindControl("lblIndexOrder") as Label).Text = String.Format("{0}.", (e.Item.ItemIndex + 1).ToString());
                int itemAddressID = Int32.Parse((e.Item.FindControl("hfAddressID") as HiddenField).Value);
                int primaryID     = 0;

                ImageButton ibDelete = e.Item.FindControl("ibDelete") as ImageButton;
                ImageButton ibEdit   = e.Item.FindControl("ibEdit") as ImageButton;

                DisableEditButtonsForAddressWithOpenOrder(ibDelete, ibEdit, itemAddressID);


                ImageButton ibMakePrimaryAddress = e.Item.FindControl("ibMakePrimary") as ImageButton;
                //Check if the address mode from the querystring to know what will be the primary address
                if (AddressMode == AddressTypes.Billing)
                {
                    primaryID = AppLogic.GetPrimaryBillingAddressID(ThisCustomer.CustomerID);
                    ibMakePrimaryAddress.ToolTip  = AppLogic.GetString("account.aspx.87", SkinID, ThisCustomer.LocaleSetting);
                    ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_disabled.png", SkinID);
                }
                else if (AddressMode == AddressTypes.Shipping)
                {
                    primaryID = AppLogic.GetPrimaryShippingAddressID(ThisCustomer.CustomerID);
                    ibMakePrimaryAddress.ToolTip  = AppLogic.GetString("account.aspx.88", SkinID, ThisCustomer.LocaleSetting);
                    ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_disabled.png", SkinID);
                }

                if (itemAddressID == primaryID)
                {
                    Label AddressHTML = e.Item.FindControl("lblAddressHTML") as Label;

                    //Display the last payment method used
                    if (CustomerCCRequired && AddressMode == AddressTypes.Billing)
                    {
                        string paymentMethodDisplay = DisplayPaymentMethod(primaryID);
                        if (!CommonLogic.IsStringNullOrEmpty(paymentMethodDisplay))
                        {
                            AddressHTML.Text += paymentMethodDisplay;
                        }
                    }

                    AddressHTML.Style["font-weight"] = "bold";
                    if (AddressMode == AddressTypes.Billing)
                    {
                        ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.89", SkinID, ThisCustomer.LocaleSetting);
                    }
                    else if (AddressMode == AddressTypes.Shipping)
                    {
                        ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.90", SkinID, ThisCustomer.LocaleSetting);
                    }
                    ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_enabled.png", SkinID);
                }

                //shows the footer where you can click add
                dlAddress.ShowFooter = !tblNewAddress.Visible;
            }
        }
Example #54
0
        //protected void ddlSelMenu_SelectedIndexChanged(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    URLQuery.Self.Remove("cp");
        //    URLQuery.Self["cp"] = "1";
        //    Paging.Self.SetCurrentPage(1);

        //    //메뉴상태 스태틱저장
        //    //SelMenuValue = Convert.ToInt16(ddlSelMenu.SelectedValue);

        //    SetCondition();
        //    GoodsListBind();
        //    //나머지 이벤트실행되면 혼나
        //    //this.tbSearchString.TextChanged -= new System.EventHandler(this.tbSearchString_TextChanged);
        //    //this.btnSearch.Click -= new System.EventHandler(this.btnSearch_Click);
        //}
        //protected void tbSearchString_TextChanged(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    Paging.Self.SetCurrentPage(1);

        //    SetCondition();
        //    GoodsListBind();
        //    //this.btnSearch.Click -= new System.EventHandler(this.btnSearch_Click);
        //}
        //protected void btnSearch_Click(object sender, System.EventArgs e)
        //{
        //    //페이지 번호는 제거해야 에러가 안남.
        //    Paging.Self.SetCurrentPage(1);

        //    SetCondition();
        //    GoodsListBind();
        //    //this.tbSearchString.TextChanged -= new System.EventHandler(this.tbSearchString_TextChanged);
        //}


        //protected void ibSendMail_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        //{
        //    //Response.Write("where = " + tableName + ";" + ViewState["whereClause"] );
        //    Session.Add("whereClause", ViewState["whereClause"]);
        //    Response.Redirect("../Mine/Mail/MailForm.aspx?t=mbr");
        //}
        #endregion

        protected void dataList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //DataRow row = ((DataRowView)e.Item.DataItem).Row;    //<-- DataSet에서만 가능
                System.Data.Common.DbDataRecord dRecord = (System.Data.Common.DbDataRecord)e.Item.DataItem;

                //메일링크
                //HyperLink hlEmail = (HyperLink)e.Item.FindControl("hlEmail");
                //string strSendonemail = ((System.Data.Common.DbDataRecord)e.Item.DataItem).GetValue(2) + " <" + hlEmail.ToolTip +">;";
                //hlEmail.NavigateUrl = "../Mine/Mail/MailForm.aspx?m=" + strSendonemail;

                URLQuery.Self["gcID"] = ((System.Data.Common.DbDataRecord)e.Item.DataItem).GetValue(0).ToString();
                //작은 상품이미지(링크) 만들기
                Image imgGdsSmallPic = (Image)e.Item.FindControl("imgGdsSmallPic");
                imgGdsSmallPic.ImageUrl = GdsCellBaseLib.Self.GetGdsSmallPicUrl(Convert.ToInt32(URLQuery.Self["gcID"]));
                imgGdsSmallPic.ToolTip  = dRecord.GetString(dRecord.GetOrdinal("gName"));
                HyperLink hlGdsSmallPic = (HyperLink)e.Item.FindControl("hlGdsSmallPic");
                hlGdsSmallPic.NavigateUrl = "/Shop/GdsView/CellView.aspx?gcid=" + URLQuery.Self["gcID"];
                HyperLink hlGdsTitle = (HyperLink)e.Item.FindControl("hlGdsTitle");
                hlGdsTitle.NavigateUrl = hlGdsSmallPic.NavigateUrl;

                //bool boolDisplay;
                //if (GdsCellBaseLib.Self.CanAccess())
                //{
                //    //보기버튼
                //    HyperLink hlView = (HyperLink)e.Item.FindControl("hlView");
                //    hlView.NavigateUrl = "GdsCellView.aspx?" + URLQuery.Self.GetQueryString();
                //    hlView.ToolTip = "내용보기";
                //    hlView.Visible = true;
                //    //수정버튼
                //    ImageButton ibUpdate = (ImageButton)e.Item.FindControl("ibUpdate");
                //    //이렇게 할필요 까지???ibUpdate.Attributes["onClick"] = "return ConfirmJ('수정하시겠습니까?');";
                //    ibUpdate.ToolTip = "수정하기";
                //    ibUpdate.Visible = true;

                //    //Response.Write(hlView.Visible + " - " + ibUpdate.Visible + " : " + DateTime.Now.ToString() + "<br>");
                //    boolDisplay = false;
                //}
                //else
                //    boolDisplay = true;
                ////없음표시(뭔가 이상);
                //Literal displayNone = (Literal)e.Item.FindControl("displayNone");
                //displayNone.Visible = boolDisplay;//DisplayNone(hlView.Visible, ibUpdate.Visible);
            }
            else if (e.Item.ItemType == ListItemType.Header)
            {
                //Literal litSearchResult = (Literal)e.Item.FindControl("litSearchResult");
                //litSearchResult.Text = this.SearchResultDisplay("");//this.tbSearchString.Text);
                //Literal litListBrief = (Literal)e.Item.FindControl("litListBrief");
                litListBrief.Text = Paging.Self.ListSummary;
                //각종 상태값 메모리로 올림(상태유지를 위해)
                SetQueryString();
                #region 페이징기능구현
                Paging.Self.Init_Violet();
                this.litPaging.Text = Paging.Self.GeneratePaging();
                #endregion
            }
            else if (e.Item.ItemType == ListItemType.Footer)
            {
                //페이징기능이 여기에 구현되어야 하나 인터페이스에 없으므로 헤더에서 구현
                //Literal litPaging = (Literal)e.Item.FindControl("litPaging");
            }

            //Response.Write("WebUtil.CurrentRequest.Path => " + WebUtil.CurrentRequest.Path + "<br/>");
        }
Example #55
0
    private void BindingItem_P(DataListItemEventArgs e)
    {
        DataRowView dr           = (DataRowView)e.Item.DataItem;
        string      q_dfn_id     = DataTypeUtility.GetValue(dr["Q_DFN_ID"]);
        string      q_sbj_id     = DataTypeUtility.GetValue(dr["Q_SBJ_ID"]);
        string      q_obj_id     = DataTypeUtility.GetValue(dr["Q_OBJ_ID"]);
        string      q_sbj_define = DataTypeUtility.GetValue(dr["Q_SBJ_DEFINE"]);
        string      q_sbj_desc   = DataTypeUtility.GetValue(dr["Q_SBJ_DESC"]);
        double      weight       = DataTypeUtility.GetToDouble(dr["WEIGHT"]);

        Literal         ltrDefine     = e.Item.FindControl("ltrLevelDefine") as Literal;
        Literal         ltrDesc       = e.Item.FindControl("ltrLevelDesc") as Literal;
        RadioButtonList rBtnList      = e.Item.FindControl("rBtnList") as RadioButtonList;
        TextBox         txtValue      = e.Item.FindControl("txtLevelValue") as TextBox;
        HiddenField     hAttachNo     = e.Item.FindControl("hAttachNo") as HiddenField;
        DropDownList    ddlFileUpload = e.Item.FindControl("ddlFileUpload") as DropDownList;
        ImageButton     ibnDownload   = e.Item.FindControl("ibnDownload") as ImageButton;
        ImageButton     iBtnAttach    = e.Item.FindControl("iBtnAttach") as ImageButton;
        Literal         ltrUpload     = e.Item.FindControl("ltrUpload") as Literal;
        TextBox         txtTextValue  = e.Item.FindControl("txtLevelTextValue") as TextBox;
        TextBox         txtOpinion    = e.Item.FindControl("txtLevelOpinion") as TextBox;
        Literal         ltrPointData  = e.Item.FindControl("ltrLevelPointData") as Literal;
        Label           lblCnt        = e.Item.FindControl("lblCnt") as Label;

        TextBoxCommon.SetOnlyInteger(txtValue);

        ltrUpload.Text = string.Format("<a href='#null' onclick=\"mfUpload('{0}');\"><img src='../images/icon/icon_gr_po05.gif' align='absmiddle' border='0'/></a>", hAttachNo.ClientID);

        ibnDownload.CausesValidation = false;
        ibnDownload.CommandName      = ddlFileUpload.UniqueID;

        ltrDefine.Text = q_sbj_define;
        ltrDesc.Text   = q_sbj_desc;

        DropDownListCommom.BindDefaultValue(ddlFileUpload, "--------------------", "");

        Biz_QuestionItems questionItems = new Biz_QuestionItems();
        DataSet           ds            = questionItems.GetQuestionItem("", q_sbj_id, Q_OBJ_ID);

        if (ds.Tables[0].Rows.Count == 0)
        {
            rBtnList.Visible = false;
            txtValue.Visible = false;
            txtValue.Width   = Unit.Percentage(100);
        }
        else if (ds.Tables[0].Rows[0]["SUBJECT_ITEM_YN"].ToString() == "1")
        {
            rBtnList.Visible = false;
            txtValue.Visible = true;
            txtValue.Width   = Unit.Percentage(100);
        }
        else
        {
            // 평가자인지 피평가인지 따라
            if (EST_TGT_TYPE.Equals("EST"))
            {
                ibnDownload.Visible = true;
                ltrUpload.Visible   = false;
            }
            else if (EST_TGT_TYPE.Equals("TGT"))
            {
                ibnDownload.Visible = true;
                ltrUpload.Visible   = true;
                rBtnList.Visible    = false;
                txtOpinion.Visible  = false;
            }

            txtValue.Visible = false;

            // 만약 질의항목에 설명을 표시할 경우
            if (_q_item_desc_use_yn.Equals("Y"))
            {
                rBtnList.RepeatLayout  = RepeatLayout.Table;
                rBtnList.DataTextField = "Q_ITEM_DESC";
            }

            rBtnList.DataSource = ds;
            rBtnList.DataBind();

            Biz_QuestionDatas questionDatas = new Biz_QuestionDatas(COMP_ID
                                                                    , EST_ID
                                                                    , ESTTERM_REF_ID
                                                                    , ESTTERM_SUB_ID
                                                                    , this.IESTTERM_STEP_PREVIOUS_SELECT
                                                                    , 0
                                                                    , 0
                                                                    , TGT_DEPT_ID
                                                                    , TGT_EMP_ID
                                                                    , q_sbj_id);
            // 데이타 바인딩

            WebUtility.FindByValueRadioButtonList(rBtnList, questionDatas.Q_Itm_ID);
            TOTALPOINT += questionDatas.Point * weight;

            txtTextValue.Text = questionDatas.Text_Value;
            txtOpinion.Text   = questionDatas.Opinion;
            ltrPointData.Text = DataTypeUtility.GetToInt32_String(questionDatas.Point, "##.#0");
            hAttachNo.Value   = questionDatas.Attach_NO;

            SetUploadFileInfo(hAttachNo.Value, ddlFileUpload);

            if (ddlFileUpload.Items.Count > 1)
            {
                lblCnt.Text = string.Format("({0}건)", ddlFileUpload.Items.Count - 1);
            }

            //----------------- 라디오버튼 유효성 검사 시작 -------------------

            string clientIDs = "";

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (i != 0)
                {
                    clientIDs += ";";
                }

                clientIDs += rBtnList.ClientID + "_" + i.ToString();
            }

            VALID_SCRIPT += string.Format("if(ValidQuestion('{0}', '{1}') == false) return false;", dr["Q_SBJ_NAME"], clientIDs);

            //----------------- 라디오버튼 유효성 검사 끝 -------------------
        }
    }
Example #56
0
 protected void dstKpiStatus_ItemDataBound(object sender, DataListItemEventArgs e)
 {
 }
Example #57
0
 protected void DataListMyTaskFuture_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     ItemDataBound(e);
 }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        string ntype = ((Label)e.Item.FindControl("TypeLabel")).Text;

        if (ntype.Contains("Race"))
        {
            ((HyperLink)e.Item.FindControl("HyperLink1")).NavigateUrl = "~/NotificationRace.aspx?postid=" + ((Label)e.Item.FindControl("PostIdLabel")).Text;
        }
        else if (ntype.Contains("Covert"))
        {
            ((HyperLink)e.Item.FindControl("HyperLink1")).NavigateUrl = "~/NotificationCovert.aspx?postid=" + ((Label)e.Item.FindControl("PostIdLabel")).Text;
        }
        else
        {
            ((HyperLink)e.Item.FindControl("HyperLink1")).NavigateUrl = "~/NotificationPost.aspx?postid=" + ((Label)e.Item.FindControl("PostIdLabel")).Text;
        }

        Label type    = (Label)e.Item.FindControl("TypeLabel");
        Label display = (Label)e.Item.FindControl("DisplayType");

        if (type.Text == "Post_Comment")
        {
            display.Text = "written a comment on your";
        }

        if (type.Text == "Race_Comment")
        {
            display.Text = "written a comment on your race";
        }
        if (type.Text == "Covert_Comment")
        {
            display.Text = "written a comment on your covert";
        }

        if (type.Text == "Covert_Comment_Like")
        {
            display.Text = "liked your comment on covert";
        }
        if (type.Text == "Post_Like")
        {
            display.Text = "liked your";
        }
        if (type.Text == "Comment_Like")
        {
            display.Text = "liked your comment on";
        }

        if (type.Text == "Race_Comment_Like")
        {
            display.Text = "liked your comment on race";
        }
        if (type.Text == "Race_Post_Like")
        {
            display.Text = "liked your race";
        }
        if (type.Text == "Covert_Post_Like")
        {
            display.Text = "liked your covert";
        }
        if (type.Text == "Share_Post")
        {
            display.Text = "liked your shared";
        }
        if (type.Text == "Post_New")
        {
            display.Text = "posted on your profile";
        }
    }
Example #59
0
        protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {
                LoadSortFieldOptions(e);
            }
            else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
                chkList.Value = dr["POID"].ToString();

                POStatus status = (POStatus)Enum.Parse(typeof(POStatus), dr["Status"].ToString());
                if (status == POStatus.Posted || status == POStatus.Cancelled)
                {
                    chkList.Attributes.Add("disabled", "false");
                    ImageButton imgItemDelete = (ImageButton)e.Item.FindControl("imgItemDelete");
                    ImageButton imgItemEdit   = (ImageButton)e.Item.FindControl("imgItemEdit");
                    ImageButton imgItemPost   = (ImageButton)e.Item.FindControl("imgItemPost");
                    imgItemDelete.Enabled = false; imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemEdit.Enabled   = false; imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                    imgItemPost.Enabled   = false; imgItemPost.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif";
                }

                HyperLink lnkPONo = (HyperLink)e.Item.FindControl("lnkPONo");
                lnkPONo.Text = dr["PONo"].ToString();
                string stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&poid=" + Common.Encrypt(chkList.Value.ToString(), Session.SessionID) + "&isepurchaseorder=" + Common.Encrypt("true", Session.SessionID);
                lnkPONo.NavigateUrl = "Default.aspx" + stParam;

                Label lblPODate = (Label)e.Item.FindControl("lblPODate");
                lblPODate.Text = Convert.ToDateTime(dr["PODate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");

                Label lblSupplierID = (Label)e.Item.FindControl("lblSupplierID");
                lblSupplierID.Text = dr["SupplierID"].ToString();

                HyperLink lblSupplierCode = (HyperLink)e.Item.FindControl("lblSupplierCode");
                lblSupplierCode.Text = dr["SupplierCode"].ToString();
                stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(lblSupplierID.Text, Session.SessionID);
                lblSupplierCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/PurchasesAndPayables/_Vendor/Default.aspx" + stParam;

                Label lblReqDeliveryDate = (Label)e.Item.FindControl("lblReqDeliveryDate");
                lblReqDeliveryDate.Text = Convert.ToDateTime(dr["RequiredDeliveryDate"].ToString()).ToString("yyyy-MM-dd");

                Label lblBranchID = (Label)e.Item.FindControl("lblBranchID");
                lblBranchID.Text = dr["BranchID"].ToString();
                Label lblBranchCode = (Label)e.Item.FindControl("lblBranchCode");
                lblBranchCode.Text = dr["BranchCode"].ToString();

                Label lblPOSubTotal = (Label)e.Item.FindControl("lblPOSubTotal");
                lblPOSubTotal.Text = Convert.ToDecimal(dr["SubTotal"].ToString()).ToString("#,##0.#0");

                Label lblPORemarks = (Label)e.Item.FindControl("lblPORemarks");
                lblPORemarks.Text = dr["Remarks"].ToString();

                //For anchor
                HtmlGenericControl divExpCollAsst = (HtmlGenericControl)e.Item.FindControl("divExpCollAsst");

                HtmlAnchor anchorDown = (HtmlAnchor)e.Item.FindControl("anchorDown");
                anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')";
            }
        }
Example #60
0
        /// <summary>
        /// Handles the Bind event of the Files control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DataListItemEventArgs"/> instance containing the event data.</param>
        public void Files_Bind([NotNull] object sender, [NotNull] DataListItemEventArgs e)
        {
            var directoryPath = Path.Combine(YafForumInfo.ForumClientFileRoot, YafBoardFolders.Current.Avatars);

            var fname = (Literal)e.Item.FindControl("fname");

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var finfo = new FileInfo(
                    this.Server.MapPath(Convert.ToString(DataBinder.Eval(e.Item.DataItem, "name"))));

                if (this.CurrentDirectory.IsSet())
                {
                    directoryPath = this.CurrentDirectory;
                }

                string tmpExt = finfo.Extension.ToLower();

                if (tmpExt == ".gif" || tmpExt == ".jpg" || tmpExt == ".jpeg" || tmpExt == ".png" || tmpExt == ".bmp")
                {
                    string link;
                    var    encodedFileName = finfo.Name.Replace(".", "%2E");

                    if (this.returnUserID > 0)
                    {
                        link = YafBuildLink.GetLink(
                            ForumPages.admin_edituser,
                            "u={0}&av={1}",
                            this.returnUserID,
                            this.Server.UrlEncode("{0}/{1}".FormatWith(directoryPath, encodedFileName)));
                    }
                    else
                    {
                        link = YafBuildLink.GetLink(
                            ForumPages.cp_editavatar,
                            "av={0}",
                            this.Server.UrlEncode("{0}/{1}".FormatWith(directoryPath, encodedFileName)));
                    }

                    fname.Text =
                        @"<div style=""text-align:center""><a href=""{0}""><img src=""{1}"" alt=""{2}"" title=""{2}"" class=""borderless"" /></a><br /><small>{2}</small></div>{3}"
                        .FormatWith(
                            link,
                            "{0}/{1}".FormatWith(directoryPath, finfo.Name),
                            finfo.Name,
                            Environment.NewLine);
                }
            }

            if (e.Item.ItemType != ListItemType.Header)
            {
                return;
            }

            // get the previous directory...
            string previousDirectory = Path.Combine(YafForumInfo.ForumClientFileRoot, YafBoardFolders.Current.Avatars);

            var up = e.Item.FindControl("up") as LinkButton;

            up.CommandArgument = previousDirectory;
            up.Text            =
                @"<p style=""text-align:center""><img src=""{0}images/folder.gif"" alt=""Up"" /><br />UP</p>".FormatWith
                    (YafForumInfo.ForumClientFileRoot);
            up.ToolTip = this.GetText("UP_TITLE");

            // Hide if Top Folder
            if (this.CurrentDirectory.Equals(previousDirectory))
            {
                up.Visible = false;
            }
        }