コード例 #1
0
ファイル: RepeaterRowSpan.cs プロジェクト: tuankyo/QLTN
 public void SetRowValue(bool otherBreak, int index, string value, Repeater rpt, RepeaterItem item, string controlId, string width)
 {
     if (this._value == null)
     {
         Init(index, value);
         if (_total == 1)
         {
             Literal ltr = (Literal)item.FindControl(controlId);
             ltr.Text = " <td align=\"center\" style=\"width:" + width + "\">" + _value + "</td>";
         }
     }
     else
     {
         if (index == _total - 1 || index == _pageSize - 1)
         {
             if (value != this._value || otherBreak)
             {
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                 ltr = (Literal)item.FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\">" + value + "</td>";
             }
             else
             {
                 _rowCount++;
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
             }
         }
         else
             if (value != this._value || otherBreak)
             {
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                 Init(index, value);
             }
             else
             {
                 _rowCount++;
             }
     }
 }
コード例 #2
0
 private void GetHtmlButton(string name, System.Web.UI.WebControls.RepeaterItem ri, bool b)
 {
     try
     {
         Control obj1 = ri.FindControl(name);
         if (obj1 != null)
         {
             obj1.Visible = b;
         }
     }
     catch { }
 }
コード例 #3
0
 private System.Web.UI.WebControls.LinkButton GetLinkButton(string name, System.Web.UI.WebControls.RepeaterItem ri)
 {
     System.Web.UI.WebControls.LinkButton obj = null;
     try
     {
         obj = (System.Web.UI.WebControls.LinkButton)ri.FindControl(name);
     }
     catch
     {
     }
     return(obj);
 }
コード例 #4
0
 private System.Web.UI.HtmlControls.HtmlAnchor GetHtmlLink(string name, System.Web.UI.WebControls.RepeaterItem ri)
 {
     System.Web.UI.HtmlControls.HtmlAnchor obj = null;
     try
     {
         obj = (System.Web.UI.HtmlControls.HtmlAnchor)ri.FindControl(name);
     }
     catch
     {
     }
     return(obj);
 }
コード例 #5
0
ファイル: RepeaterRowSpan.cs プロジェクト: tuankyo/QLTN
        public void SetRowCheckBox(int index, string value, Repeater rpt, RepeaterItem item, string controlId, string checkBoxId)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + "";

                    CheckBox chk = (CheckBox)item.FindControl(checkBoxId);
                    chk.Visible = chk.Enabled;
                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;

                        ltr = (Literal)item.FindControl(controlId);
                        ltr.Text = " <td align=\"center\">" + "";
                        chk = (CheckBox)item.FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                    }
                    else
                    {
                        _rowCount++;
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";

                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                    }
                }
                else
                    if (value != this._value)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
コード例 #6
0
 private CategoryConditionModel GetParaCondition(int scenceId, int cateId, RepeaterItem item)
 {
     CategoryConditionModel ccmodel = null;
     Label lblPropName = item.FindControl("lblPropName") as Label;
     CheckBoxList cblPara = item.FindControl("cblPara") as CheckBoxList;
     List<string> selvals = new List<string>();
     foreach (ListItem sitem in cblPara.Items)
     {
         if (sitem.Selected)
             selvals.Add("'" + sitem.Value + "'");
     }
     if (selvals.Count > 0)
     {
         string rulvals = String.Join(",", selvals.ToArray());
         ccmodel = new CategoryConditionModel(scenceId, cateId, int.Parse(lblPropName.ToolTip), rulvals);
     }
     return ccmodel;
 }
コード例 #7
0
 /// <summary>
 /// Raises the repeater event.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="ev">The ev.</param>
 private void RaiseRepeaterEvent(RepeaterItem item, ViewEventHandler ev)
 {
     this._CurrentGroup = this.GLMinorCategoryActivityGroups[item.ItemIndex];
     this._currentMinorCategoriesControl = item.FindControl("MinorCategoryDropDown") as MultiSelectDropDown;
     this._currentActivityTypesControl = item.FindControl("ActivityTypeDropDown") as MultiSelectDropDown;
     ev();
 }
コード例 #8
0
 private void ChangeCallLogRepeaterColumnVisibility(RepeaterItem item, string colName, bool visibility)
 {
     HtmlTableCell cell = (HtmlTableCell)item.FindControl(colName);
     if (null != cell) cell.Visible = visibility;
 }
コード例 #9
0
        /// <summary>
        /// gets called for every item and alternating item template being instantiated by this
        /// repeater during databinding
        /// </summary>
        /// <param name="item"></param>
        protected virtual void OnFilterItemCreated(RepeaterItem item) {
            var filter = item.FindControl(DynamicFilterContainerId) as FilterUserControlBase;
            if (filter == null) {
                throw new InvalidOperationException(
                    String.Format(CultureInfo.CurrentCulture,
                        DynamicDataResources.FilterRepeater_CouldNotFindControlInTemplate,
                        ID,
                        typeof(FilterUserControlBase).FullName,
                        DynamicFilterContainerId));
            }

            var column = (MetaColumn)item.DataItem;
            filter.TableName = column.Table.Name;
            filter.DataField = column.Name;
            filter.ContextTypeName = column.Table.DataContextType.AssemblyQualifiedName;

            // Keep track of all the filters we create
            _filters.Add(filter);
        }
コード例 #10
0
ファイル: ImageManager.ascx.cs プロジェクト: superhaz/WebShop
        //public void BindItemImageManually()
        //{
        //    ItemRepeaterPlaceHolder.Visible = true;
        //    SavePlaceHolder.Visible = false;
        //    BindItemImage();
        //}
        /// <summary>
        /// Initialized and set the images size for hovering with javascript
        /// </summary>
        private void BindItemImage(RepeaterItem item)
        {
            if (string.IsNullOrEmpty(ItemID))
                return;

            System.Web.UI.WebControls.Image itemImage = item.FindControl("ItemImage") as System.Web.UI.WebControls.Image;
            string filename = (item.FindControl("FileNameHiddenField") as HiddenField).Value;
            string filesize = (item.FindControl("FileSizeHiddenField") as HiddenField).Value;
            string priority = (item.FindControl("PriorityHiddenField") as HiddenField).Value;

            itemImage.AlternateText = itemImage.ToolTip = "namn: " + filename + "\nstorlek: " + FileHelper.ConvertSizeToKBOrMBOrGBOrTB(filesize) + "\nprioritet: " + priority;

            // default image
            SetImageSize(itemImage, filename, 150, 150);
            // large image
            //SetImageSize(LargeItemImage, imageUrl, 250, 250);

            // add javascript attributes
            //itemImage.Attributes.Add("onmouseover", "HighlightImage('ItemImageDiv')");
            //itemImage.Attributes.Add("onmouseout", "RemoveImageHighlight('ItemImageDiv')");
            //itemImage.Attributes.Add("onclick", "ShowLargeImage('LargeImageDiv')");
        }
コード例 #11
0
        /// <summary>
        /// 在Repeater Item中找Label值
        /// </summary>
        /// <param name="item"></param>
        /// <param name="controlName"></param>
        /// <returns></returns>
        public static string GetLabelValueByRepeater(RepeaterItem item, string controlName)
        {
            Label label = ((Label)item.FindControl(controlName));
            if (label != null)
            {
                return label.Text;
            }

            return string.Empty;
        }
コード例 #12
0
        /// <summary>
        /// 在Repeater Item中找TextBox值
        /// </summary>
        /// <param name="item"></param>
        /// <param name="controlName"></param>
        /// <returns></returns>
        public static string GetTextBoxValueByRepeater(RepeaterItem item, string controlName)
        {
            TextBox textBox = ((TextBox)item.FindControl(controlName));
            if (textBox != null)
            {
                return textBox.Text;
            }

            return string.Empty;

        }
コード例 #13
0
        private void AdicionarDespesasDeTodosOsMeses(List<DespesaDeViagemDTO> despesasDeViagemDto, RepeaterItem valoresTotaisItem)
        {
            var despesaDeViagemDto = new DespesaDeViagemDTO();

            var rptContas = (Repeater)valoresTotaisItem.FindControl("rptContas");

            AdicionarDespesasMesAMes(despesaDeViagemDto, rptContas);

            despesasDeViagemDto.Add(despesaDeViagemDto);
        }
コード例 #14
0
ファイル: Default.aspx.cs プロジェクト: superhaz/WebShop
        /// <summary>
        /// Initialized and set the images size for hovering with javascript
        /// </summary>
        private void BindItemImage(RepeaterItem item, string folderUrl)
        {
            System.Web.UI.WebControls.Image itemImage = item.FindControl("ItemImage") as System.Web.UI.WebControls.Image;
            string filename = (item.FindControl("FileNameHiddenField") as HiddenField).Value;

            // default image
            SetImageSize(itemImage, filename, 150, 150, folderUrl);
            // large image
            //SetImageSize(LargeItemImage, imageUrl, 250, 250);

            // add javascript attributes
            //itemImage.Attributes.Add("onmouseover", "HighlightImage('ItemImageDiv')");
            //itemImage.Attributes.Add("onmouseout", "RemoveImageHighlight('ItemImageDiv')");
            //itemImage.Attributes.Add("onclick", "ShowLargeImage('LargeImageDiv')");
        }
コード例 #15
0
ファイル: MultiTable.ascx.cs プロジェクト: porter1130/C-A
        private DataRow ConvertToDataRow(RepeaterItem item)
        {
            CADateTimeControl caStartDate = (CADateTimeControl)item.FindControl("datetimeForm");
            CADateTimeControl caEndDate = (CADateTimeControl)item.FindControl("datetimeTo");

            TextBox txtDays = (TextBox)item.FindControl("txtDays");
            DDLLeaveType ddlType = (DDLLeaveType)item.FindControl("ddlType");
            DropDownList ddlFromTime = (DropDownList)item.FindControl("ddlFromTime");
            DropDownList ddlFromTo = (DropDownList)item.FindControl("ddlFromTo");

            DataRow row = this.DataTableRecord.NewRow();
            row["DateFrom"] = caStartDate.IsDateEmpty ? null : caStartDate.SelectedDate.ToShortDateString();
            row["DateFromTime"] = ddlFromTime.SelectedValue;
            row["DateTo"] = caEndDate.IsDateEmpty ? null : caEndDate.SelectedDate.ToShortDateString();
            row["DateToTime"] = ddlFromTo.SelectedValue;
            row["LeaveType"] = ddlType.SelectedValue;
            row["LeaveDays"] = txtDays.Text;

            return row;
        }
コード例 #16
0
        /// <summary>
        /// 在Repeater Item中找Image的url
        /// </summary>
        /// <param name="item"></param>
        /// <param name="controlName"></param>
        /// <returns></returns>
        public static string GetImageUrlByRepeater(RepeaterItem item, string controlName)
        {
            Image image = ((Image)item.FindControl(controlName));
            if (image != null)
            {
                return image.ImageUrl;
            }

            return string.Empty;
        }
コード例 #17
0
        protected string GetClientId(object container)
        {
            System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
            MetricTrac.Bll.MetricValue.Extend      val = ri.DataItem as MetricTrac.Bll.MetricValue.Extend;
            string ClientId = String.Empty;

            switch (val.MetricDataTypeID)
            {
            case 2:
                System.Web.UI.WebControls.TextBox tbValue = (System.Web.UI.WebControls.TextBox)ri.FindControl("tbValue");
                ClientId = tbValue.ClientID;
                break;

            case 3:
                System.Web.UI.WebControls.CheckBox chbValue = (System.Web.UI.WebControls.CheckBox)ri.FindControl("chbValue");
                ClientId = chbValue.ClientID;
                break;

            case 4:
                Telerik.Web.UI.RadDatePicker rdpDateValue = (Telerik.Web.UI.RadDatePicker)ri.FindControl("rdpDateValue");
                ClientId = rdpDateValue.ClientID;
                break;

            case 1:
            default:
                Telerik.Web.UI.RadNumericTextBox rntValue = (Telerik.Web.UI.RadNumericTextBox)ri.FindControl("rntValue");
                ClientId = rntValue.ClientID;
                break;
            }
            return(ClientId);
        }
コード例 #18
0
        /// <summary>
        /// 在Repeater中找Hidden字段值
        /// </summary>
        /// <param name="item"></param>
        /// <param name="controlName"></param>
        /// <returns></returns>
        public static string GetHiddenValueByRepeater(RepeaterItem item, string controlName)
        {
            HiddenField hdControl = (HiddenField)item.FindControl(controlName);
            if (hdControl != null && !string.IsNullOrEmpty(hdControl.Value))
            {
                return hdControl.Value;
            }

            return string.Empty;
        }
コード例 #19
0
ファイル: Func.cs プロジェクト: tuankyo/QLTN
 /// <summary>
 /// Set value for an item of a row of gridview
 /// </summary>
 /// <param name="checkItem">row needed to set value</param>
 /// <param name="checkName">column name</param>
 /// <param name="value">record value set for item</param>
 public static void SetGridCheckValue(RepeaterItem item, string name, bool value)
 {
     CheckBox control = (CheckBox)item.FindControl(name);
     if (control != null)
     {
         control.Checked = value;
     }
 }
コード例 #20
0
        /// <summary>
        /// Repeater中FindControl并赋值
        /// </summary>
        /// <param name="gridViewRow"></param>
        /// <param name="controlName"></param>
        /// <param name="controlValue"></param>
        public static void SetControlValueByRepeater(RepeaterItem item,
            string controlName, string controlValue)
        {
            Control currentControl = (Control)item.FindControl(controlName);
            if (currentControl == null)
            {
                return;
            }

            if (currentControl is HiddenField)
            {
                ((HiddenField)currentControl).Value = controlValue;
                return;
            }

            if (currentControl is TextBox)
            {
                ((TextBox)currentControl).Text = controlValue;
                return;
            }

            if (currentControl is Label)
            {
                ((Label)currentControl).Text = controlValue;
                return;
            }
        }
コード例 #21
0
ファイル: DataForm.ascx.cs プロジェクト: porter1130/C-A
        private DataRow ConvertToDataRow(RepeaterItem item)
        {
            TextBox txtHardName1 = (TextBox)item.FindControl("txtHardName");
            TextBox txtCost1 = (TextBox)item.FindControl("txtCost");

            DataRow row = this.DataTableRecord.NewRow();
            row["HardwareOrSoftwareName"] = txtHardName1.Text;
            row["Cost"] = txtCost1.Text;

            return row;
        }
        protected void UpdateShoppingCart(RepeaterItem rptHeadItem)
        {
            if (!IsShoppingCart)
                return;

            ApplyCheckoutAttributes();
            bool hasErrors = ValidateCartItems(rptHeadItem);

            Repeater rptShoppingCart = (Repeater)rptHeadItem.FindControl("rptShoppingCart");

            if (!hasErrors)
            {
                foreach (RepeaterItem item in rptShoppingCart.Items)
                {
                    var txtQuantity = item.FindControl("txtQuantity") as TextBox;
                    var lblShoppingCartItemId = item.FindControl("lblShoppingCartItemId") as Label;
                    var cbRemoveFromCart = item.FindControl("cbRemoveFromCart") as CheckBox;

                    int shoppingCartItemId = 0;
                    int quantity = 0;

                    if (txtQuantity != null && lblShoppingCartItemId != null && cbRemoveFromCart != null)
                    {
                        int.TryParse(lblShoppingCartItemId.Text, out shoppingCartItemId);
                        if (cbRemoveFromCart.Checked)
                        {
                            this.ShoppingCartService.DeleteShoppingCartItem(shoppingCartItemId, true);
                        }
                        else
                        {
                            int.TryParse(txtQuantity.Text, out quantity);
                            List<string> addToCartWarning = this.ShoppingCartService.UpdateCart(shoppingCartItemId, quantity, true);
                        }
                    }
                }

                Response.Redirect(SEOHelper.GetShoppingCartUrl());
            }
        }
コード例 #23
0
        public void ChangeHeaderCssClass(RepeaterItem item)
        {
            string thName = string.Empty;
            if (DashBoardViewType == Globals.Dashboard.ViewType.JobSummaryView)
            {
                switch (JobSummarySortColumn)
                {
                    case Globals.Common.Sort.JobSummarySortColumns.Division:
                        thName = "thDivision";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.JobNumber:
                        thName = "thJobNumber";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.CustomerResource:
                        thName = "thCustomerResource";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.JobStatus:
                        thName = "thJobStatus";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.Location:
                        thName = "thLocation";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.ProjectManager:
                        thName = "thProjectManager";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.ModifiedBy:
                        thName = "thModifiedBy";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastModification:
                        thName = "thLastModification";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.InitialCallDate:
                        thName = "thInitialCallDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.PresetDate:
                        thName = "thPresetDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastCallType:
                        thName = "thLastCallType";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastCallDate:
                        thName = "thLastCallDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.None:
                    default:
                        thName = string.Empty;
                        break;
                }
            }
            else if (DashBoardViewType == Globals.Dashboard.ViewType.JobCallLogView)
            {
                switch (JobCallLogSortColumn)
                {
                    case Globals.Common.Sort.JobCallLogSortColumns.Division:
                        thName = "thDivision";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.JobNumber:
                        thName = "thJobNumber";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.Customer:
                        thName = "thCustomer";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallType:
                        thName = "thCallType";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CalledInBy:
                        thName = "thCalledInBy";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallDate:
                        thName = "thCallDate";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallTime:
                        thName = "thCallTime";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.ModifiedBy:
                        thName = "thModifiedBy";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.Details:
                        thName = "thDetails";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.None:
                    default:
                        thName = string.Empty;
                        break;
                }
            }

            string[] items = OrderBy;
            if (!string.IsNullOrEmpty(thName))
            {
                HtmlTableCell control = item.FindControl(thName) as HtmlTableCell;
                if (null != control)
                {
                    if (items[1] == "1")
                        control.Attributes.Add("class", control.Attributes["class"] + " Ascending");
                    else
                        control.Attributes.Add("class", control.Attributes["class"] + " Descending");
                }
            }
        }
        /// <summary>
        /// Validates shopping cart items
        /// </summary>
        /// <returns>Indicates whether there're some warnings/errors</returns>
        protected bool ValidateCartItems(RepeaterItem rptHeadItem)
        {
            bool hasErrors = false;

            Repeater rptDetail = (Repeater)rptHeadItem.FindControl("rptShoppingCart");
            //individual items
            foreach (RepeaterItem item in rptDetail.Items)
            {
                var txtQuantity = item.FindControl("txtQuantity") as TextBox;
                var lblShoppingCartItemId = item.FindControl("lblShoppingCartItemId") as Label;
                var cbRemoveFromCart = item.FindControl("cbRemoveFromCart") as CheckBox;
                var pnlWarnings = item.FindControl("pnlWarnings") as Panel;
                var lblWarning = item.FindControl("lblWarning") as Label;

                int shoppingCartItemId = 0;
                int quantity = 0;

                if (txtQuantity != null && lblShoppingCartItemId != null && cbRemoveFromCart != null)
                {
                    int.TryParse(lblShoppingCartItemId.Text, out shoppingCartItemId);

                    if (!cbRemoveFromCart.Checked)
                    {
                        int.TryParse(txtQuantity.Text, out quantity);
                        var sci = this.ShoppingCartService.GetShoppingCartItemById(shoppingCartItemId);

                        var warnings = this.ShoppingCartService.GetShoppingCartItemWarnings(
                            sci.ShoppingCartType,
                            sci.ProductVariantId,
                            sci.AttributesXml,
                            sci.CustomerEnteredPrice,
                            quantity);

                        if (warnings.Count > 0)
                        {
                            hasErrors = true;
                            if (pnlWarnings != null && lblWarning != null)
                            {
                                pnlWarnings.Visible = true;
                                lblWarning.Visible = true;

                                var addToCartWarningsSb = new StringBuilder();
                                for (int i = 0; i < warnings.Count; i++)
                                {
                                    addToCartWarningsSb.Append(Server.HtmlEncode(warnings[i]));
                                    if (i != warnings.Count - 1)
                                    {
                                        addToCartWarningsSb.Append("<br />");
                                    }
                                }

                                lblWarning.Text = addToCartWarningsSb.ToString();
                            }
                        }
                    }
                }
            }
            return hasErrors;
        }
コード例 #25
0
 private void ChangeRowVisibility(RepeaterItem item, string trName, bool visibility)
 {
     HtmlTableRow row = (HtmlTableRow)item.FindControl(trName);
     if (null != row) row.Visible = visibility;
 }
コード例 #26
0
 private ShoppingCartItem GetCartItem(RepeaterItem item)
 {
     var key = SparePartPriceKey.Parse(((Label)item.FindControl("_hiddenItemKey")).Text);
     int qty = ((CheckBox)item.FindControl("_chkRemove")).Checked ? 0 :
         Convert.ToInt32(((TextBox)item.FindControl("_txtQty")).Text);
     string refid = ((TextBox) item.FindControl("_txtReferenceID")).Text.ToString();
     // deas 28.02.2011 task2401
     // добавлен учет ItemID для разделения строк с разными референсами
     int itemID = 0;
     int.TryParse( ( (HiddenField)item.FindControl( "_itemID" ) ).Value, out itemID );
     // deas 28.04.2011 task3929 добавление в корзине флага отправить в заказ
     bool addToOrder = ( (CheckBox)item.FindControl( "_chkAddToOrder" ) ).Checked;
     var options = (OrderLineOptions)item.FindControl("_options");
     return new ShoppingCartItem()
     {
         AddToOrder = addToOrder,
         ItemID = itemID,
         Manufacturer = key.Mfr,
         PartNumber = key.PN,
         SupplierID = key.SupplierId,
         Qty = qty,
         ReferenceID = refid,
         VinCheckupDataID = options.VinCheckupDataId,
         StrictlyThisNumber = options.StrictlyThisNumber
     };
 }
コード例 #27
0
        private Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation GetAffiliationFromThePage(RepeaterItem ri)
        {
            // Get the controls for this item.
            DropDownList ddlEmpVis = (DropDownList)ri.FindControl("ddlEmpVis");

            Label lblProfilesID = (Label)ri.FindControl("lblProfilesID");
            Label lblAffiliationTypeID = (Label)ri.FindControl("lblAffiliationTypeID");
            Label lblDepartmentName = (Label)ri.FindControl("lblDepartmentName");
            Label lblRoleTitle = (Label)ri.FindControl("lblRoleTitle");
            Label lblStartDate = (Label)ri.FindControl("lblStartDate");
            Label lblEndDate = (Label)ri.FindControl("lblEndDate");
            Label lblOrganizationName = (Label)ri.FindControl("lblOrganizationName");
            Label lblOrganizationCity = (Label)ri.FindControl("lblOrganizationCity");
            Label lblOrganizationRegion = (Label)ri.FindControl("lblOrganizationRegion");
            Label lblOrganizationCountry = (Label)ri.FindControl("lblOrganizationCountry");
            Label lblDisambiguationID = (Label)ri.FindControl("lblDisambiguationID");
            Label lblDisambiguationSource = (Label)ri.FindControl("lblDisambiguationSource");

            Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation personAffiliation = new Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation();
            personAffiliation.DecisionID = int.Parse(ddlEmpVis.SelectedValue.ToString());
            personAffiliation.ProfilesID = int.Parse(lblProfilesID.Text);
            personAffiliation.AffiliationTypeID = int.Parse(lblAffiliationTypeID.Text);
            if (!lblDepartmentName.Text.Equals(string.Empty))
            {
                personAffiliation.DepartmentName = lblDepartmentName.Text;
            }
            personAffiliation.RoleTitle = lblRoleTitle.Text;
            if (!lblStartDate.Text.Equals(string.Empty))
            {
                personAffiliation.StartDate = DateTime.Parse(lblStartDate.Text);
            }
            if (!lblEndDate.Text.Equals(string.Empty))
            {
                personAffiliation.EndDate = DateTime.Parse(lblEndDate.Text);
            }
            personAffiliation.OrganizationName = lblOrganizationName.Text;
            if (!lblOrganizationCity.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationCity = lblOrganizationCity.Text;
            }
            if (!lblOrganizationRegion.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationRegion = lblOrganizationRegion.Text;
            }
            if (!lblOrganizationCountry.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationCountry = lblOrganizationCountry.Text;
            }

            if (!lblDisambiguationID.Text.Equals(string.Empty))
            {
                personAffiliation.DisambiguationID = lblDisambiguationID.Text;
                personAffiliation.DisambiguationSource = lblDisambiguationSource.Text;
            }
            return personAffiliation;
        }
コード例 #28
0
 public void UpdateSchedule(RepeaterItem ri)
 {
     CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
     TextInfo textInfo = cultureInfo.TextInfo;
     DropDownList drp_scheduletype = (DropDownList)ri.FindControl("ddlscheduletypeE");
     Label lblscheduleday = (Label)ri.FindControl("lblscheduledayE");
     TextBox txtscheduedate = (TextBox)ri.FindControl("txtscheduedateE");
     //if (checkedit_scheduledate(txtscheduedate.Text) == true)
     //{
     TextBox txtschedule_sttime = (TextBox)ri.FindControl("txtschedule_sttimeE");
     TextBox txtschedule_endtime = (TextBox)ri.FindControl("txtschedule_endtimeE");
     TextBox txtschedulenotes = (TextBox)ri.FindControl("txtschedulenotesE");
     HiddenField hdnscheduleid = (HiddenField)ri.FindControl("hdnscheduleid");
     string schedule_type, schedule_days, schedule_stime, schedule_endtime, notes;
     Nullable<DateTime> schedulde_date;
     schedulde_date = Convert.ToDateTime(txtscheduedate.Text);
     schedule_type = drp_scheduletype.SelectedItem.Text;
     schedule_days = textInfo.ToTitleCase(Convert.ToDateTime(txtscheduedate.Text).DayOfWeek.ToString().Substring(0, 3));
     schedule_stime = Convert.ToString(txtschedule_sttime.Text);
     schedule_endtime = Convert.ToString(txtschedule_endtime.Text);
     notes = txtschedulenotes.Text;
     ScheduleData objsch = new ScheduleData();
     string msg = objsch.Engagementschedule_Update(engagementid, Convert.ToInt32(hdnscheduleid.Value), schedule_type, schedulde_date, schedule_days, schedule_stime, schedule_endtime, notes);
     if (msg == "")
     {
         lbl_msg.Text = "Schedule updated successfully!";
         lbl_msg.ForeColor = System.Drawing.Color.Green;
         bindScheduleDetails(Convert.ToInt32(engagementid));
     }
     else
     {
         lbl_msg.Text = msg;
         lbl_msg.ForeColor = System.Drawing.Color.Orange;
     }
     // }
 }
コード例 #29
0
ファイル: RepeaterRowSpan.cs プロジェクト: tuankyo/QLTN
        public void SetBannerRowValue(int index, string value, Repeater rpt, RepeaterItem item, string controlId, string sumRowId)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + _value + "</td>";
                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value)
                    {
                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(controlId);
                            ltr.Text = " <td align=\"center\" rowspan=\"1\">" + value + "</td>";
                            ltr = (Literal)rpt.Items[index - 1].FindControl(sumRowId);
                            ltr.Text = GetBannerData(rpt, _rowCount, index);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(controlId);
                            ltr.Text = " <td align=\"center\">" + value + "</td>";
                        }
                    }
                    else
                    {
                        _rowCount++;
                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(sumRowId); //last record
                            ltr.Text = GetBannerData(rpt, _rowCount, index, item);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                        }
                    }
                }
                else
                    if (value != this._value)
                    {

                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)rpt.Items[index - 1].FindControl(sumRowId);
                            ltr.Text = GetBannerData(rpt, _rowCount, index);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                        }
                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
コード例 #30
0
ファイル: Func.cs プロジェクト: tuankyo/QLTN
 /// <summary>
 /// Set value for an item of a row of gridview
 /// </summary>
 /// <param name="linkItem">row needed to set value</param>
 /// <param name="linkName">colum name</param>
 /// <param name="linkValue">record value set for item</param>
 public static void SetGridTextValue(RepeaterItem item, string name, string textValue)
 {
     Literal control = (Literal)item.FindControl(name);
     if (control != null)
     {
         control.Text = textValue;
     }
 }
コード例 #31
0
ファイル: RepeaterRowSpan.cs プロジェクト: tuankyo/QLTN
        public void SetRowControl(bool otherBreak, int index, string value, Repeater rpt, RepeaterItem item, string controlId, string id)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + "";
                    ((Control)item.FindControl(id)).Visible = true;

                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value || otherBreak)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                        ltr = (Literal)item.FindControl(controlId);
                        ltr.Text = " <td align=\"center\">" + "";
                        ((Control)item.FindControl(id)).Visible = true;
                    }
                    else
                    {
                        _rowCount++;
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";

                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                    }
                }
                else
                    if (value != this._value || otherBreak)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
コード例 #32
0
ファイル: Func.cs プロジェクト: tuankyo/QLTN
 /// <summary>
 /// Set value for an item of a row of gridview
 /// </summary>
 /// <param name="textItem">row needed to set value</param>
 /// <param name="linkName">column name</param>
 /// <param name="textValue">record value set for item</param>
 public static void SetGridLinkValue(RepeaterItem item, string name, string linkValue)
 {
     LinkButton control = (LinkButton)item.FindControl(name);
     if (control != null)
     {
         control.Text = linkValue;
     }
 }
コード例 #33
0
ファイル: LabourType.ascx.cs プロジェクト: AAGJKPRT/LMT
        private void VisibleUnvisibleControl(bool value, RepeaterItem selectedRptItem)
        {
            ((Label)selectedRptItem.FindControl("lblLabourType")).Visible = !value;
            ((TextBox)selectedRptItem.FindControl("txtLabourType")).Visible = value;

            ((Label)selectedRptItem.FindControl("lblSector")).Visible = !value;
            ((DropDownList)selectedRptItem.FindControl("ddlSector")).Visible = value;

            ((Label)selectedRptItem.FindControl("lblIsVerify")).Visible = !value;
            ((CheckBox)selectedRptItem.FindControl("chkIsVerify")).Visible = value;
            ((Button)selectedRptItem.FindControl("btnEdit")).Visible = !value;
            ((Button)selectedRptItem.FindControl("btnDelete")).Visible = !value;
            if (((LinkButton)selectedRptItem.FindControl("lbtnInsert")).Visible == true)
            {
                ((LinkButton)selectedRptItem.FindControl("lbtnUpdate")).Visible = !value;
                //((Button)selectedRptItem.FindControl("btnDelete")).Visible = !value;
                ((LinkButton)selectedRptItem.FindControl("lbtnCancel")).Visible = value;
            }
            else
            {
                ((LinkButton)selectedRptItem.FindControl("lbtnUpdate")).Visible = value;
                //((Button)selectedRptItem.FindControl("btnDelete")).Visible = value;
                ((LinkButton)selectedRptItem.FindControl("lbtnCancel")).Visible = value;
            }
        }
コード例 #34
0
ファイル: Func.cs プロジェクト: tuankyo/QLTN
 /// <summary>
 /// Set value for an item of a row of gridview
 /// </summary>
 /// <param name="textItem">row needed to set value</param>
 /// <param name="linkName">column name</param>
 /// <param name="textValue">record value set for item</param>
 public static void SetGridTextboxValue(RepeaterItem item, string name, string linkValue)
 {
     TextBox control = (TextBox)item.FindControl(name);
     if (control != null)
     {
         control.Text = linkValue;
     }
 }
コード例 #35
0
 protected string GetSelectClientId(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
     System.Web.UI.WebControls.DropDownList ddlApprovalStatus = (System.Web.UI.WebControls.DropDownList)ri.FindControl("ddlApprovalStatus");
     return(ddlApprovalStatus.ClientID);
 }
コード例 #36
0
 private void GetButton(string name, System.Web.UI.WebControls.RepeaterItem ri, bool b)
 {
     try
     {
         System.Web.UI.WebControls.Button obj = (System.Web.UI.WebControls.Button)ri.FindControl(name);
         if (obj != null)
         {
             obj.Visible = b;
         }
     }
     catch
     {
         GetHtmlButton(name, ri, b);
     }
 }