Inheritance: WebControl, IPostBackDataHandler, IEditableTextControl, ITextControl
Esempio n. 1
0
 protected override void InitializeSkin(System.Web.UI.Control Skin)
 {
     LogTitle = (TextBox)Skin.FindControl("LogTitle");
     Search = (Button)Skin.FindControl("Search");
     Search.Click += new EventHandler(Search_Click);
     //throw new NotImplementedException();
 }
        public List<CartItem> UpdateCartItems( )
        {
            using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions())
            {
                String cartId = usersShoppingCart.GetCartId();

                ShoppingCartActions.ShoppingCartUpdates[] cartUpdates = new
                ShoppingCartActions.ShoppingCartUpdates[CartList.Rows.Count];
                for (int i =0; i < CartList.Rows.Count; i++)
                {
                    IOrderedDictionary rowValues = new OrderedDictionary();
                    rowValues = GetValues(CartList.Rows[i] );
                    cartUpdates[i].ProductId = Convert.ToInt32(rowValues["ProductID"] );

                    CheckBox cbRemove = new CheckBox();
                    cbRemove = (CheckBox) CartList.Rows[i].FindControl( "Remove" );
                    cartUpdates[i].RemoveItem = cbRemove.Checked;

                    TextBox quantityTextBox = new TextBox();
                    quantityTextBox =(TextBox) CartList.Rows[i].FindControl("PurchaseQuantity");
                    cartUpdates[i].PurchaseQuantity =Convert.ToInt16(quantityTextBox.Text.ToString());
                }
                usersShoppingCart.UpdateShoppingCartDatabase(cartId, cartUpdates);
                CartList.DataBind();
                lblTotal.Text =String.Format("{0:c}", usersShoppingCart.GetTotal());
                return usersShoppingCart.GetCartItems();
            }
        }
Esempio n. 3
0
 void EditString_Init(object sender, EventArgs e)
 {
     if (IsNotAListOfValues)
     {
         var ctlTextBox = new TextBox {TextMode = TextBoxMode.SingleLine, Rows = 1};
         CtlValueBox = ctlTextBox;
         if (ValidationRule != "")
         {
             StrValRule = ValidationRule;
             StrValMsg = ValidationMessage;
         }
     }
     else
     {
         var ctlListControl = GetListControl();
         AddListItems(ctlListControl);
         CtlValueBox = ctlListControl;
     }
     Value = DefaultValue;
     if (Required) CtlValueBox.CssClass = "dnnFormRequired";
     if (!String.IsNullOrEmpty( Style)) CtlValueBox.Style.Value = Style;
     CtlValueBox.ID = CleanID(FieldTitle);
     ValueControl = CtlValueBox;
     Controls.Add(CtlValueBox);
 }
Esempio n. 4
0
        protected override void CreateChildControls()
        {
            // base.CreateChildControls();
            // Add Literal Controls
            this.Controls.Add(new LiteralControl("<h3>Value: "));

            // Add Textbox
            TextBox box = new TextBox();
            box.Text = "0";
            box.TextChanged +=new EventHandler(this.TextBox_Changed);
            this.Controls.Add(box);

            // Add Literal Controls
            this.Controls.Add(new LiteralControl("</h3>"));

            // Add "Add" Button
            Button addButton = new Button();
            addButton.Text = "Add";
            addButton.Click += new EventHandler(this.AddBtn_Click);
            this.Controls.Add(addButton);

            // Add Literal Controls
            this.Controls.Add(new LiteralControl(" | "));

            // Add "Subtract" Button
            Button subtractButton = new Button();
            subtractButton.Text = "Subtract";
            subtractButton.Click += new EventHandler(this.SubtractBtn_Click);
            this.Controls.Add(subtractButton);

        }
Esempio n. 5
0
        protected override void CreateChildControls()
        {
            this.Title = "Custom Medalsoft properties";

            txtTitle = new TextBox();
            txtTitle.Width = new Unit("100%");

            ddlWebpartType = new DropDownList();
            ddlWebpartType.ID = "ddlWebpartType";
            ddlWebpartType.Items.Add(new ListItem("News", WebPartType.News));
            ddlWebpartType.Items.Add(new ListItem("Announcement", WebPartType.Announcement));
            ddlWebpartType.SelectedIndexChanged += new EventHandler(ddlWebpartType_SelectedIndexChanged);
            ddlWebpartType.AutoPostBack = true;

            txtPageSize = new TextBox();
            txtPageSize.Width = new Unit("20%");

            tvNewsType = GenerateTreeViewForNewsType();

            Controls.Add(new LiteralControl("<div class='MedalsoftEditorDiv'>Type a webpart title:</div>"));
            Controls.Add(txtTitle);
            Controls.Add(new LiteralControl("<div class='MedalsoftEditorDiv'>Select webpart type:</div>"));
            Controls.Add(ddlWebpartType);
            Controls.Add(new LiteralControl("<div class='MedalsoftEditorDiv'>Type a page size:</div>"));
            Controls.Add(txtPageSize);
            LiteralControl lcNewsType = new LiteralControl("<div class='MedalsoftEditorDiv'>Select displaying News Type:</div>");
            lcNewsType.ID = "lcNewsType";
            Controls.Add(lcNewsType);
            Controls.Add(tvNewsType);
        }
Esempio n. 6
0
        protected void AgregarControles(Label nombreContr, CheckBox chB, TextBox tbox, HiddenField nuevoHidF, Label hrReg, Label observ)
        {
            try
            {
                PanelConVisita.Controls.Add(new LiteralControl("<tr>"));
                PanelConVisita.Controls.Add(new LiteralControl("<td>"));
                PanelConVisita.Controls.Add(nombreContr);
                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                PanelConVisita.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;"));
                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                if (hrReg == null)
                {
                    PanelConVisita.Controls.Add(chB);
                }
                else
                {
                    PanelConVisita.Controls.Add(hrReg);
                }

                PanelConVisita.Controls.Add(new LiteralControl("</td><td>"));
                if (hrReg == null)
                {
                    PanelConVisita.Controls.Add(tbox);
                }
                else
                {
                    PanelConVisita.Controls.Add(observ);
                }
                PanelConVisita.Controls.Add(new LiteralControl("</td></tr>"));
            }
            catch (Exception ex)
            {
                return;
            }
        }
Esempio n. 7
0
 protected override void AttachChildControls()
 {
     this.txtShipTo = (TextBox) this.FindControl("txtShipTo");
     this.txtAddress = (TextBox) this.FindControl("txtAddress");
     this.txtZipcode = (TextBox) this.FindControl("txtZipcode");
     this.txtTelPhone = (TextBox) this.FindControl("txtTelPhone");
     this.txtCellPhone = (TextBox) this.FindControl("txtCellPhone");
     this.dropRegionsSelect = (RegionSelector) this.FindControl("dropRegions");
     this.btnAddAddress = ButtonManager.Create(this.FindControl("btnAddAddress"));
     this.btnCancel = ButtonManager.Create(this.FindControl("btnCancel"));
     this.btnEditAddress = ButtonManager.Create(this.FindControl("btnEditAddress"));
     this.dtlstRegionsSelect = (Common_Address_AddressList) this.FindControl("list_Common_Consignee_ConsigneeList");
     this.lblAddressCount = (Literal) this.FindControl("lblAddressCount");
     this.btnAddAddress.Click += new EventHandler(this.btnAddAddress_Click);
     this.btnEditAddress.Click += new EventHandler(this.btnEditAddress_Click);
     this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
     this.dtlstRegionsSelect.ItemCommand += new Common_Address_AddressList.CommandEventHandler(this.dtlstRegionsSelect_ItemCommand);
     PageTitle.AddSiteNameTitle("我的收货地址", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         this.lblAddressCount.Text = HiContext.Current.Config.ShippingAddressQuantity.ToString();
         this.dropRegionsSelect.DataBind();
         this.Reset();
         this.btnEditAddress.Visible = false;
         this.BindList();
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Opens a popup Calendar
        /// </summary>
        /// <param name="Field">TextBox to return the date value</param>
        /// <returns></returns>
        /// <remarks>
        /// </remarks>
        public static string InvokePopupCal( TextBox Field )
        {
            // Define character array to trim from language strings
            char[] TrimChars = new char[] {',', ' '};

            // Get culture array of month names and convert to string for
            // passing to the popup calendar
            string MonthNameString = "";
            foreach( string Month in DateTimeFormatInfo.CurrentInfo.MonthNames )
            {
                MonthNameString += Month + ",";
            }
            MonthNameString = MonthNameString.TrimEnd( TrimChars );

            // Get culture array of day names and convert to string for
            // passing to the popup calendar
            string DayNameString = "";
            foreach( string Day in DateTimeFormatInfo.CurrentInfo.AbbreviatedDayNames )
            {
                DayNameString += Day + ",";
            }
            DayNameString = DayNameString.TrimEnd( TrimChars );

            // Get the short date pattern for the culture
            string FormatString = DateTimeFormatInfo.CurrentInfo.ShortDatePattern.ToString();
            if( !ClientAPI.IsClientScriptBlockRegistered( Field.Page, "PopupCalendar.js" ) )
            {
                ClientAPI.RegisterClientScriptBlock( Field.Page, "PopupCalendar.js", "<script src=\"" + ClientAPI.ScriptPath + "PopupCalendar.js\"></script>" );
            }

            string strToday = ClientAPI.GetSafeJSString( Localization.GetString( "Today" ) );
            string strClose = ClientAPI.GetSafeJSString( Localization.GetString( "Close" ) );
            string strCalendar = ClientAPI.GetSafeJSString( Localization.GetString( "Calendar" ) );
            return "javascript:popupCal('Cal','" + Field.ClientID + "','" + FormatString + "','" + MonthNameString + "','" + DayNameString + "','" + strToday + "','" + strClose + "','" + strCalendar + "'," + (int)DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek + ");";
        }
 private void ChangeVisible(int index, DropDownList dropDownList, TextBox txtBox)
 {
     if (index == 1)
         dropDownList.Style["visibility"] = "visible";
     if(index == 2)
         txtBox.Style["visibility"] = "visible";
 }
Esempio n. 10
0
        /// <summary>
        /// Creates a multi-line <see cref="System.Web.UI.WebControls.TextBox">TextBox</see> with a class
        /// called 'markdown-editor'. All Javascript and CSS files are added to the page.
        /// </summary>
        protected override System.Web.UI.Control AddEditor(System.Web.UI.Control container)
        {
            Page page = HttpContext.Current.Handler as System.Web.UI.Page;

            if (page == null)
            {
                Literal literalError = new Literal() { Text = "unable to get current page from HttpContext.Current.Handler!" };
                container.Controls.Add(literalError);
                return literalError;
            }
            else
            {

                page.Header.Controls.Add(new Literal() { Text = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/Addons/Markdown/Wmd/wmd.css\" />" });
                page.Header.Controls.Add(new Literal() { Text = "<script type=\"text/javascript\" src=\"/Addons/Markdown/Wmd/showdown.js\"></script>" });
                page.Header.Controls.Add(new Literal() { Text = "<script type=\"text/javascript\" src=\"/Addons/Markdown/Wmd/wmd.js\"></script>" });

                container.Controls.Add(new Literal() { Text = "<div id=\"wmd-button-bar\" class=\"wmd-panel\"></div>" });

                // Make the control
                TextBox textbox = new TextBox();
                textbox.CssClass = "wmd-panel wmd-textarea";
                textbox.TextMode = TextBoxMode.MultiLine;
                container.Controls.Add(textbox);

                return textbox;
            }
        }
Esempio n. 11
0
		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);

			LiteralControl lastExport = CreateLastExport();

			tbFrom = new TextBox();
			tbFrom.ID = "tbFrom";
			tbFrom.Text = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy.MM.dd");

			tbTo = new TextBox();
			tbTo.ID = "tbTo";
			tbTo.Text = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).ToString("yyyy.MM.dd");

			Button btnExport = new Button();
			btnExport.ID = "btnExport";
			btnExport.Text = HttpContext.GetGlobalResourceObject("FormPortlet", "ExportToCsv") as string;//"Export to .csv";
			btnExport.Click += new EventHandler(btnExport_Click);

			Controls.Add(new LiteralControl(HttpContext.GetGlobalResourceObject("FormPortlet", "DateFrom") as string));
			Controls.Add(tbFrom);
			Controls.Add(new LiteralControl(HttpContext.GetGlobalResourceObject("FormPortlet", "DateTo") as string));
			Controls.Add(tbTo);
			Controls.Add(btnExport);
		    if (lastExport != null) Controls.Add(lastExport);
		}
Esempio n. 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     pnlAttrtype = new Panel();
     pnlAttrtype.ID = "pnl" + _ProfileAttributeType.Type;
     lblAtriTypeName = new Label();
     System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
     lblAtriTypeName.Text = _ProfileAttributeType.Type;
     pnlAttrtype.Controls.Add(lblAtriTypeName);
     pnlAttrtype.Controls.Add(br);
     this.Controls.Add(pnlAttrtype);
     _ProfileAttribute = _Repository.GetProfileAttributesByProfileIDAndType(_profile.ProfileID, _ProfileAttributeType.ProfileAttributeTypeID);
     foreach (ProfileAttribute attribute in _ProfileAttribute)
     {
         System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
         Label label = new Label();
         label.Width = 200;
         label.Height = 20;
         label.ID = "lbl" + attribute.ProfileAttributeName;
         label.Text = attribute.ProfileAttributeName;
         TextBox textbox = new TextBox();
         textbox.Width = 250;
         textbox.Height = 20;
         textbox.ID = "txt" + attribute.ProfileAttributeName;
         textbox.Text = attribute.Response;
         pnlAttrtype.Controls.Add(label);
         pnlAttrtype.Controls.Add(textbox);
         pnlAttrtype.Controls.Add(brTab);
     }
 }
Esempio n. 13
0
        public DynamicTime()
        {
            _textBox = new TextBox();
            _textBox.CausesValidation = false;

            _mskEditExtender = new MaskedEditExtender();
            _mskEditExtender.TargetControlID = _textBox.ID;
            _mskEditExtender.Mask = "99:99";
            _mskEditExtender.MaskType = MaskedEditType.Time;
            _mskEditExtender.AcceptAMPM = false;
            _mskEditExtender.UserTimeFormat = MaskedEditUserTimeFormat.TwentyFourHour;
            _mskEditExtender.AutoComplete = true;

            _mskEditValidator = new MaskedEditValidator();
            _mskEditValidator.ControlExtender = _mskEditExtender.ID;
            _mskEditValidator.ControlToValidate = _textBox.ID;
            _mskEditValidator.EnableClientScript = true;
            _mskEditValidator.Display = ValidatorDisplay.Dynamic;
            _mskEditValidator.InvalidValueBlurredMessage = "*";
            _mskEditValidator.InvalidValueMessage = "invalid value message";
            _mskEditValidator.EmptyValueMessage = "empty value message";
            _mskEditValidator.EmptyValueBlurredText = "*";

            this.Controls.Add(_textBox);
            this.Controls.Add(_mskEditExtender);
            this.Controls.Add(_mskEditValidator);

            this._timePickerXml = new DynamicTimeXml();
        }
Esempio n. 14
0
        public DynamicTime(DynamicTimeXml xml)
        {
            _textBox = new TextBox();
            _textBox.CausesValidation = false;
            _mskEditExtender = new MaskedEditExtender();
            _mskEditExtender.Mask = xml.Mask;
            _mskEditExtender.MaskType = xml.MaskedType;
            _mskEditExtender.InputDirection = xml.InputDirection;
            //_mskEditExtender.AcceptAMPM = false;
            //_mskEditExtender.UserTimeFormat = MaskedEditUserTimeFormat.TwentyFourHour;
            //_mskEditExtender.AutoComplete = true;

            _mskEditValidator = new MaskedEditValidator();
            _mskEditValidator.IsValidEmpty = xml.IsValidEmpty;
            _mskEditValidator.EnableClientScript = true;
            _mskEditValidator.Display = ValidatorDisplay.Dynamic;
            _mskEditValidator.InvalidValueBlurredMessage = "*";
            _mskEditValidator.InvalidValueMessage = xml.InvalidValueMessage;
            _mskEditValidator.EmptyValueMessage = xml.EmptyValueMessage;
            _mskEditValidator.EmptyValueBlurredText = "*";
            this.ValidationGroup = xml.ValidationGroup;
            this.Visible = xml.Visible;
            this.ID = xml.Name;

            this.Controls.Add(_textBox);
            this.Controls.Add(_mskEditExtender);
            this.Controls.Add(_mskEditValidator);

            this._timePickerXml = xml;

            _textBox.Text = xml.Text;
        }
        public static SimpleFieldTemplateUserControl CreateTextTemplate(MetaColumn column, bool readOnly) {
            SimpleFieldTemplateUserControl control = new SimpleFieldTemplateUserControl();
            if (readOnly) {
                var literal = new Literal();
                literal.DataBinding += (sender, e) => {
                    literal.Text = control.FieldValueString;
                };
                control.Controls.Add(literal);
            }
            else {
                var textBox = new TextBox();                
                textBox.DataBinding += (sender, e) => {                    
                    textBox.Text = control.FieldValueEditString;                    
                };
                // Logic copied from BoundField
                if (column.ColumnType.IsPrimitive) {
                    textBox.Columns = 5;
                }
                control._valueExtrator = () => textBox.Text;
                textBox.CssClass = "DDTextBox";
                textBox.ID = TextBoxID;
                control.Controls.Add(textBox);
                control.CreateValidators(column);
            }

            return control;
        }
Esempio n. 16
0
 protected void LogoSourceSelectionList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LogoSourceSelectionList.SelectedValue == "Computer")
     {
         Label LogoLabel = new Label();
         Label BreakLine = new Label();
         FileUpload LogotypeFileUpload = new FileUpload();
         BreakLine.Text = "<br />";
         LogoLabel.Text = "Please select an image from your computer:";
         LogotypePlaceHolder.Controls.Add(LogoLabel);
         LogotypePlaceHolder.Controls.Add(BreakLine);
         LogotypePlaceHolder.Controls.Add(LogotypeFileUpload);
     }
     if (LogoSourceSelectionList.SelectedValue == "Internet")
     {
         Label LogoLabel = new Label();
         Label BreakLine = new Label();
         TextBox LogoUrlTextBox = new TextBox();
         BreakLine.Text = "<br />";
         LogoLabel.Text = "Please specify the URL to the location of your logotype. Please make sure to specify an absolute path such as: http://www.something.com/image.png";
         LogoUrlTextBox.Text = "http://";
         LogotypePlaceHolder.Controls.Add(LogoLabel);
         LogotypePlaceHolder.Controls.Add(BreakLine);
         LogotypePlaceHolder.Controls.Add(LogoUrlTextBox);
     }
 }
Esempio n. 17
0
        /// <summary>
        /// Initializes controls
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnLoad(e);
            PropertyPanel allowedPropertyPanel = new PropertyPanel();
            allowedPropertyPanel.Text = "Allowed Macros";
            allowedPropertyPanel.Controls.Add(_macroList);
            Controls.Add(allowedPropertyPanel);

            PropertyPanel numberPropertyPanel = new PropertyPanel();
            numberPropertyPanel.Text = "Max Number";
            _txtMaxNumber = new TextBox();
            _txtMaxNumber.ID = "maxnumber";
            numberPropertyPanel.Controls.Add(_txtMaxNumber);
            Controls.Add(numberPropertyPanel);

            PropertyPanel widthPropertyPanel = new PropertyPanel();
            widthPropertyPanel.Text = "Prefered width";
            _txtPreferedWidth = new TextBox();
            _txtPreferedWidth.ID = "prefwidth";
            widthPropertyPanel.Controls.Add(_txtPreferedWidth);
            Controls.Add(widthPropertyPanel);

            PropertyPanel heightPropertyPanel = new PropertyPanel();
            heightPropertyPanel.Text = "Prefered height";
            _txtPreferedHeight = new TextBox();
            _txtPreferedHeight.ID = "prefheight";
            heightPropertyPanel.Controls.Add(_txtPreferedHeight);
            Controls.Add(heightPropertyPanel);

        }
Esempio n. 18
0
        protected override void CreateChildControls()
        {
            Random random = new Random();
            _firstInt = random.Next(0, 20);
            _secondInt = random.Next(0, 20);

            ResourceManager rm = new ResourceManager("SystemWebExtensionsAUT.LocalizingClientResourcesWalkthrough.VerificationResources", this.GetType().Assembly);
            Controls.Clear();

            _firstLabel = new Label();
            _firstLabel.ID = "firstNumber";
            _firstLabel.Text = _firstInt.ToString();

            _secondLabel = new Label();
            _secondLabel.ID = "secondNumber";
            _secondLabel.Text = _secondInt.ToString();

            _answer = new TextBox();
            _answer.ID = "userAnswer";

            _button = new Button();
            _button.ID = "Button";
            _button.Text = rm.GetString("Verify");
            _button.OnClientClick = "return CheckAnswer();";

            Controls.Add(_firstLabel);
            Controls.Add(new LiteralControl(" + "));
            Controls.Add(_secondLabel);
            Controls.Add(new LiteralControl(" = "));
            Controls.Add(_answer);
            Controls.Add(_button);
        }
Esempio n. 19
0
    public override void AddValidatorSettingsEdit(Control parentCtrl)
    {
      Portal.API.Controls.Label lbl = new Portal.API.Controls.Label();
      lbl.LanguageRef = "MinimumLength";
      parentCtrl.Controls.Add(lbl);

      // Minimale Länge.
      TextBox lengthBox = new TextBox();
      lengthBox.ID = "_minLength";
      int length = 0;
      if(TryGetProperty("MinimumLength", ref length))
        lengthBox.Text = length.ToString();

      parentCtrl.Controls.Add(lengthBox);

      parentCtrl.Controls.Add(new LiteralControl("</br>"));

      // Maximale Länge.
      lbl = new Portal.API.Controls.Label();
      lbl.LanguageRef = "MaximumLength";
      parentCtrl.Controls.Add(lbl);

      lengthBox = new TextBox();
      lengthBox.ID = "_maxLength";
      if (TryGetProperty("MaximumLength", ref length))
        lengthBox.Text = length.ToString();
        
      parentCtrl.Controls.Add(lengthBox);
    }
Esempio n. 20
0
 internal static void MoreInformation(string UserName, TextBox txtField, string field)
 {
     SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString);
     string str = "select * from moreinformation where user_id = @id";
     SqlCommand cmd = new SqlCommand(str, con);
     cmd.Parameters.AddWithValue("id", LoGiN.UserId(UserName));
     try
     {
         con.Open();
         SqlDataReader dr = cmd.ExecuteReader();
         if (dr.HasRows)
         {
             dr.Read();
             txtField.Text = dr[field].ToString();
         }
     }
     catch (Exception)
     {
         throw new ApplicationException("Не удалось отобразить дополнительную информацию");
     }
     finally
     {
         con.Close();
     }
 }
Esempio n. 21
0
        protected override void InitializeSkin(System.Web.UI.Control Skin)
        {
            KeyWords=(TextBox)Skin.FindControl("KeyWords");
            AllowPsd = (CheckBox)Skin.FindControl("AllowPsd");
            IsEnReply = (CheckBox)Skin.FindControl("IsEnReply");
            IsIndexShow = (CheckBox)Skin.FindControl("IsIndexShow");
            AllowPsd.Attributes.Add("onclick", "AllowPsd()");
            TextBox1 = (TextBox)Skin.FindControl("TextBox1");
            TextBox2 = (TextBox)Skin.FindControl("TextBox2");  //js把logId写入

            CreateTime = (TextBox)Skin.FindControl("CreateTime");
            if (!Page.IsPostBack)
            {
                CreateTime.Text = DateTime.Now.ToString();
            }

            LogIdTex = (TextBox)Skin.FindControl("LogId");//没有用到啊···
            Title = (TextBox)Skin.FindControl("title");
            Add = (Button)Skin.FindControl("Add");
            AddDraft = (Button)Skin.FindControl("AddDraft");
            Cansel = (Button)Skin.FindControl("Cansel");
            Editor = (TextBox)Skin.FindControl("txtContent");
            LogCategory = (DropDownList)Skin.FindControl("LogCategory");
            this.DataBind();
        }
Esempio n. 22
0
 public static void Validate(TextBox textBox, string tip, string validatetype, string warning, string error)
 {
     textBox.Attributes.Add("tip", tip);
     textBox.Attributes.Add("validatetype", validatetype);
     textBox.Attributes.Add("warning", warning);
     textBox.Attributes.Add("error", error);
 }
Esempio n. 23
0
 protected void AgregarControles(Label nombreContr, TextBox txt, DropDownList cmb, HiddenField nhf, int cont)
 {
     try
     {
         /*
         pnlSeleccionarDatos.Controls.Add(nombreContr);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         pnlSeleccionarDatos.Controls.Add(cmb);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         pnlSeleccionarDatos.Controls.Add(txt);
         pnlSeleccionarDatos.Controls.Add(new LiteralControl(" "));
         */
         Panel1.Controls.Add(new LiteralControl("<tr>"));
         Panel1.Controls.Add(new LiteralControl("<td>"));
         Panel1.Controls.Add(nombreContr);
         Panel1.Controls.Add(new LiteralControl("</td><td>"));
         Panel1.Controls.Add(cmb);
         Panel1.Controls.Add(new LiteralControl("</td><td>"));
         Panel1.Controls.Add(txt);
         Panel1.Controls.Add(nhf);
         Panel1.Controls.Add(new LiteralControl("</td></tr>"));
     }
     catch (Exception ex)
     {
         return;
     }
 }
Esempio n. 24
0
		private void Page_Load(object sender, System.EventArgs e) 
		{
			HtmlForm frm  = (HtmlForm)FindControl("Form1");
			GHTTestBegin(frm);

			// Negative Rows value:
			GHTSubTestBegin("Negative Rows value");
			try 
			{
				System.Web.UI.WebControls.TextBox tb = new System.Web.UI.WebControls.TextBox();
				//tb.TextMode = TextBoxMode.MultiLine
				tb.Rows = -1;
				GHTSubTestExpectedExceptionNotCaught("ArgumentOutOfRangeException");
			}
			catch (ArgumentOutOfRangeException ex)
			{
				GHTSubTestExpectedExceptionCaught(ex);
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTTestEnd();
		}
Esempio n. 25
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Label lbl = new Label();

            TextBox txt = new TextBox();
            Button btn = new Button();
            DateTime dt = DateTime.Now;
            btn.Text = "Show All Lists";
            btn.Click += delegate
            {
                do
                {
                    SPWebCollection Webs;
                    SPListCollection lists;
                    Webs = SPContext.Current.Site.AllWebs;
                    foreach (SPWeb web in Webs)
                    {
                        lists = web.Lists;
                        foreach (SPList list in lists)
                            lbl.Text = lbl.Text + "<br>" + list.Title;
                    }
                }
                while (dt.AddSeconds(int.Parse(txt.Text)).CompareTo(DateTime.Now) > 0);
            };
            Controls.Add(txt);
            Controls.Add(btn);

            Controls.Add(lbl);
        }
Esempio n. 26
0
        public NiceEditAdapter()
        {

            control = new TextBox();
            control.TextMode = TextBoxMode.MultiLine;
            control.ID = "editor";
        }
Esempio n. 27
0
        /***************************** PRIVATE *****************************/
        /// <summary>
        /// Creates the html objects
        /// </summary>
        private Control BuildHtmlContent()
        {
            try
            {
                HtmlObjects table = new HtmlObjects("div");
                table.AddAttribute("class", "table");

                for (int i = 0; i < _inputBox.Count; i++)
                {
                    HtmlObjects row         = new HtmlObjects("div"); row.AddAttribute("class", "row");
                    HtmlObjects cellLabel   = new HtmlObjects("div"); cellLabel.AddAttribute("class", "cell");
                    HtmlObjects cellTextBox = new HtmlObjects("div"); cellTextBox.AddAttribute("class", "cell");

                    HtmlObjects label       = new HtmlObjects("span") { Text = _inputBox[i] + ":" };
                    label.AddAttribute("class", "label");

                    TextBox textbox         = new TextBox {ID = "value" + i, CssClass = "textbox"};

                    cellLabel.AddControls(label.GetObject);
                    cellTextBox.AddControls(textbox);

                    row.AddControls(cellLabel.GetObject);
                    row.AddControls(cellTextBox.GetObject);

                    table.AddControls(row.GetObject);
                }

                return table.GetObject;
            }
            catch (Exception ex)
            {
                throw new Exception("error building html input boxs " + ex.Message);
            }
        }
Esempio n. 28
0
 private void AddLastValueHiddenField(Panel p)
 {
     this.lastValueHiddenTextBox = new TextBox();
     this.lastValueHiddenTextBox.ID = "LastValueHidden";
     this.lastValueHiddenTextBox.Style.Add("display", "none;");
     p.Controls.Add(this.lastValueHiddenTextBox);
 }
 protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowState rowState)
 {
     //base.InitializeDataCell(cell, rowState);
     TextBox textBox = new TextBox();
     textBox.ID = this.ControlID;
     textBox.Width = new Unit(GridColumn.Width, UnitType.Pixel);
     if (GridColumn.Size != 0) textBox.MaxLength = GridColumn.Size;
     textBox.DataBinding += new EventHandler(this.textBox_DataBinding);
     base.InitializeDataCell(cell, rowState);
     cell.Controls.Add(textBox);
     CompareValidator vld = new CompareValidator();
     vld.ControlToValidate = textBox.ID;
     vld.ID = textBox.ID + "vld";
     vld.Operator = ValidationCompareOperator.DataTypeCheck;
     vld.ErrorMessage = "не верный формат (2)";
     vld.Text = "! (2)";
     vld.Display = ValidatorDisplay.Dynamic;
     if (GridColumn.Type == typeof(int)) vld.Type = ValidationDataType.Integer;
     if (GridColumn.Type == typeof(decimal)) vld.Type = ValidationDataType.Double;
     if (GridColumn.Type == typeof(string)) vld.Type = ValidationDataType.String;
     cell.Controls.Add(vld);
     if (!GridColumn.AllowNULL)
     {
         RequiredFieldValidator reqvld = new RequiredFieldValidator();
         reqvld.ControlToValidate = textBox.ID;
         reqvld.ID = textBox.ID + "reqvld";
         reqvld.ErrorMessage = "поле не может быть пустым (1)";
         reqvld.Text = "! (1)";
         reqvld.Display = ValidatorDisplay.Dynamic;
         cell.Controls.Add(reqvld);
     }
 }
Esempio n. 30
0
		private void Page_Load(object sender, System.EventArgs e) 
		{
			HtmlForm frm = (HtmlForm)this.FindControl("Form1");
			GHTTestBegin(frm);

			// Negative columns value - Shoud throw an exception:
			GHTSubTestBegin("Negative columns value");
			try 
			{
				System.Web.UI.WebControls.TextBox tb = new System.Web.UI.WebControls.TextBox();
				tb.Columns = -1;
				GHTSubTestExpectedExceptionNotCaught("ArgumentOutOfRangeException");
			}
			catch (ArgumentOutOfRangeException ex)
			{
				GHTSubTestExpectedExceptionCaught(ex);
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTTestEnd();
		}
Esempio n. 31
0
 protected override void CreateChildControls()
 {
     treeDiv = new System.Web.UI.HtmlControls.HtmlGenericControl(HtmlElm_DIV);
     this.Controls.Add(treeDiv);
     hdnOpenTreeNodes = new System.Web.UI.WebControls.TextBox();
     this.hdnOpenTreeNodes.Style[StyleDisplay] = StyleDisplay_Value_None;
     this.hdnOpenTreeNodes.ID = hdnOpenTreeNodesID;
     this.Controls.Add(hdnOpenTreeNodes);
 }
Esempio n. 32
0
 /// <summary>
 /// Armar Fecha
 /// </summary>
 /// <param name="txbCampo"></param>
 public static void armarFecha(ref System.Web.UI.WebControls.TextBox txbCampo, String strTitulo = "")
 {
     //Aplicando Atributos para Armar Fecha
     txbCampo.Attributes.Add("type", "date");
     txbCampo.Attributes.Add("data-toggle", "tooltip");
     txbCampo.Attributes.Add("data-trigger", "hover");
     txbCampo.Attributes.Add("data-placement", "top");
     txbCampo.Attributes.Add("data-title", strTitulo.Trim());
 }
Esempio n. 33
0
        private void lkbtncancleCheck_Click(object sender, System.EventArgs e)
        {
            int  num  = 0;
            bool flag = true;

            System.Collections.Generic.Dictionary <string, int> dictionary = new System.Collections.Generic.Dictionary <string, int>();
            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdAuthorizeProducts.Rows)
            {
                System.Web.UI.WebControls.GridView gridView = gridViewRow.FindControl("grdSkus") as System.Web.UI.WebControls.GridView;
                foreach (System.Web.UI.WebControls.GridViewRow gridViewRow2 in gridView.Rows)
                {
                    System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow2.FindControl("checkboxCol");
                    System.Web.UI.WebControls.TextBox  textBox  = gridViewRow2.FindControl("txtNum") as System.Web.UI.WebControls.TextBox;
                    if (checkBox != null && checkBox.Checked)
                    {
                        num++;
                        int value;
                        if (!int.TryParse(textBox.Text.Trim(), out value) || int.Parse(textBox.Text.Trim()) <= 0 || textBox.Text.Trim().Contains("."))
                        {
                            flag = false;
                            break;
                        }
                        dictionary.Add((string)gridView.DataKeys[gridViewRow2.RowIndex].Value, value);
                    }
                }
                if (!flag)
                {
                    break;
                }
            }
            if (num == 0)
            {
                this.ShowMsg("请先选择要添加的商品", false);
                return;
            }
            if (!flag)
            {
                this.ShowMsg("数量不能为空,必需为大于零的正整数", false);
                return;
            }
            int num2 = 0;

            foreach (System.Collections.Generic.KeyValuePair <string, int> current in dictionary)
            {
                if (SubsiteSalesHelper.DeletePurchaseShoppingCartItem(current.Key))
                {
                    num2++;
                }
            }
            if (num2 > 0)
            {
                this.ShowMsg(string.Format("成功取消了{0}件商品", num2), true);
                this.BindData();
                return;
            }
            this.ShowMsg("取消商品失败", false);
        }
Esempio n. 34
0
    protected void gv_refdata_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("ADD"))
        {
            System.Web.UI.WebControls.DropDownList bah            = (System.Web.UI.WebControls.DropDownList)gv_refdata.FooterRow.FindControl("lbladdwilayah_1");
            System.Web.UI.WebControls.TextBox      txtAddName     = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddName");
            System.Web.UI.WebControls.TextBox      txtAddcode     = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddcode");
            System.Web.UI.WebControls.TextBox      txtAddcode_amt = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddcode_amt");
            DropDownList lbladdkodID = (DropDownList)gv_refdata.FooterRow.FindControl("lbladdkodID");
            DropDownList ddlStatus   = (DropDownList)gv_refdata.FooterRow.FindControl("ddlStatus");
            if (txtAddName.Text != "" && txtAddcode.Text != "")
            {
                string set_cnt = string.Empty, set_cnt1 = string.Empty, mcnt = string.Empty;
                string sno1 = string.Empty, sno2 = string.Empty, sno3 = string.Empty, cnt_value = string.Empty;
                string sso1 = string.Empty, sso2 = string.Empty, sso3 = string.Empty, entry = string.Empty, pv = string.Empty;
                string chk_role = string.Empty;


                DataTable dtcenter = new DataTable();
                ref_table();
                dtcenter = Dblog.Ora_Execute_table("select * from " + tn1 + " where " + tc6 + " = '" + bah.SelectedValue + "' and " + tc2 + "='" + txtAddName.Text + "'");

                if (dtcenter.Rows.Count == 0)
                {
                    string Inssql = "insert into " + tn1 + " (" + tc1 + "," + tc2 + "," + tc3 + "," + tc6 + "," + tc7 + ") values('" + txtAddName.Text + "','" + txtAddcode.Text + "','" + ddlStatus.SelectedValue + "','" + bah.SelectedValue + "','" + txtAddcode_amt.Text + "')";
                    Status = DBCon.Ora_Execute_CommamdText(Inssql);
                    if (Status == "SUCCESS")
                    {
                        //if (sel_rt.SelectedValue == "23")
                        //{
                        //    entry = "D";
                        //    pv = "K";

                        //    string Inssql_main = "Insert into KW_ref_jurnal_inter (jur_module,jur_item,jur_desc,jur_desc_cd,crt_id,crt_dt,status,jur_entry_type,jur_pv_type) values ('M0001','" + sel_rt.SelectedItem.Text + "','" + txtAddcode.Text + "','" + txtAddName.Text + "','" + Session["New"].ToString() + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','A','" + entry + "','" + pv + "')";
                        //    Status = DBCon.Ora_Execute_CommamdText(Inssql_main);
                        //}
                        sel_val();
                        //service.audit_trail("P0202", "Simpan", "TUNTUTAN", txtAddcode.Text);
                        ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Berjaya Disimpan.',{'type': 'confirmation','title': 'Success','auto_close': 2000});", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Sudah Wujud.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Nilai.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                sel_val();
            }
        }

        string script1 = " $(function () {  $(" + gv_refdata.ClientID + ") .prepend($('<thead></thead>').append($(this).find('tr:first'))).DataTable({'responsive': true,'sPaginationType': 'full_numbers',  'iDisplayLength': 15,'aLengthMenu': [[15, 30, 50, 100], [15, 30, 50, 100]]});});";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
    }
Esempio n. 35
0
    protected void gv_refdata_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        //sel_val();
        System.Web.UI.WebControls.DropDownList edit_bah        = (System.Web.UI.WebControls.DropDownList)gv_refdata.Rows[e.RowIndex].FindControl("lbleditwilayah_1");
        System.Web.UI.WebControls.TextBox      Id              = (System.Web.UI.WebControls.TextBox)gv_refdata.Rows[e.RowIndex].FindControl("Id");
        System.Web.UI.WebControls.TextBox      lblEditName     = (System.Web.UI.WebControls.TextBox)gv_refdata.Rows[e.RowIndex].FindControl("lblEditName");
        System.Web.UI.WebControls.TextBox      txtEditcode     = (System.Web.UI.WebControls.TextBox)gv_refdata.Rows[e.RowIndex].FindControl("txtEditcode");
        System.Web.UI.WebControls.TextBox      txtEditcode_amt = (System.Web.UI.WebControls.TextBox)gv_refdata.Rows[e.RowIndex].FindControl("txtEditcode_amt");
        DropDownList lbleditkodID  = (DropDownList)gv_refdata.Rows[e.RowIndex].FindControl("lbleditkodID");
        DropDownList editddlStatus = (DropDownList)gv_refdata.Rows[e.RowIndex].FindControl("editddlStatus");
        DataTable    dtcenter      = new DataTable();

        ref_table();
        dtcenter = Dblog.Ora_Execute_table("select * from " + tn1 + " where " + tc6 + "='" + edit_bah.SelectedValue + "' and " + tc2 + "='" + txtEditcode.Text + "' AND " + tc4 + " != '" + Id.Text + "'");
        if (dtcenter.Rows.Count == 0)
        {
            string set_cnt = string.Empty, set_cnt1 = string.Empty, mcnt = string.Empty;
            string sno1 = string.Empty, sno2 = string.Empty, sno3 = string.Empty, cnt_value = string.Empty, entry = string.Empty, pv = string.Empty;

            string Inssql = "update " + tn1 + " set " + tc1 + "='" + lblEditName.Text + "'," + tc2 + "='" + txtEditcode.Text + "'," + tc3 + "='" + editddlStatus.SelectedValue + "'," + tc6 + "='" + edit_bah.SelectedValue + "'," + tc7 + "='" + txtEditcode_amt.Text + "' where " + tc4 + "='" + Id.Text + "'";
            Status = DBCon.Ora_Execute_CommamdText(Inssql);
            if (Status == "SUCCESS")
            {
                //if (sel_rt.SelectedValue == "23")
                //{
                //    entry = "D";
                //    pv = "K";

                //    string Inssql_main = string.Empty;
                //    DataTable dd1 = new DataTable();
                //    dd1 = DBCon.Ora_Execute_table("select * from KW_ref_jurnal_inter where jur_module='M0001' and jur_item='" + sel_rt.SelectedItem.Text + "' and jur_desc_cd='" + lblEditName.Text + "'");
                //    if (dd1.Rows.Count != 0)
                //    {
                //        Inssql_main = "update KW_ref_jurnal_inter set jur_desc='" + txtEditcode.Text + "',upd_id='" + Session["New"].ToString() + "',upd_dt='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',status='A',jur_entry_type='" + entry + "',jur_pv_type='" + pv + "' where jur_module='M0001' and jur_item='" + sel_rt.SelectedItem.Text + "' and jur_desc_cd='" + lblEditName.Text + "'";
                //        Status = DBCon.Ora_Execute_CommamdText(Inssql_main);
                //    }
                //    else
                //    {
                //        Inssql_main = "Insert into KW_ref_jurnal_inter (jur_module,jur_item,jur_desc,jur_desc_cd,crt_id,crt_dt,status,jur_entry_type,jur_pv_type) values ('M0001','" + sel_rt.SelectedItem.Text + "','" + txtEditcode.Text + "','" + lblEditName.Text + "','" + Session["New"].ToString() + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','A','" + entry + "','" + pv + "')";
                //        Status = DBCon.Ora_Execute_CommamdText(Inssql_main);
                //    }
                //}
                gv_refdata.EditIndex = -1;
                sel_val();
                //service.audit_trail("P0202", "Kemaskini", "TUNTUTAN", txtEditcode.Text);
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Berjaya Dikemaskini.',{'type': 'confirmation','title': 'Success','auto_close': 2000});", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Sudah Wujud.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
        }

        string script1 = " $(function () {  $(" + gv_refdata.ClientID + ") .prepend($('<thead></thead>').append($(this).find('tr:first'))).DataTable({'responsive': true,'sPaginationType': 'full_numbers',  'iDisplayLength': 15,'aLengthMenu': [[15, 30, 50, 100], [15, 30, 50, 100]]});});";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
    }
Esempio n. 36
0
    protected void gv_refdata_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("ADD"))
        {
            System.Web.UI.WebControls.TextBox      txtAddName = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddName");
            System.Web.UI.WebControls.TextBox      txtAddcode = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddcode");
            System.Web.UI.WebControls.DropDownList lbladdhdr  = (System.Web.UI.WebControls.DropDownList)gv_refdata.FooterRow.FindControl("lbladd_hdr");
            System.Web.UI.WebControls.DropDownList lbladdhdr1 = (System.Web.UI.WebControls.DropDownList)gv_refdata.FooterRow.FindControl("lbladd_hdr1");
            DropDownList lbladdkodID = (DropDownList)gv_refdata.FooterRow.FindControl("lbladdkodID");
            DropDownList ddlStatus   = (DropDownList)gv_refdata.FooterRow.FindControl("ddlStatus");
            if (txtAddName.Text != "" && txtAddcode.Text != "")
            {
                string    set_cnt = string.Empty, set_cnt1 = string.Empty, mcnt = string.Empty;
                string    sno1 = string.Empty, sno2 = string.Empty, sno3 = string.Empty, cnt_value = string.Empty;
                string    sso1 = string.Empty, sso2 = string.Empty, sso3 = string.Empty;
                string    chk_role = string.Empty;
                DataTable dtcenter = new DataTable();
                ref_table();
                dtcenter = Dblog.Ora_Execute_table("select * from " + tn1 + " where " + tc2 + "='" + txtAddName.Text + "'");

                if (dtcenter.Rows.Count == 0)
                {
                    string up_val = string.Empty;
                    if (sel_rt.SelectedValue == "02")
                    {
                        up_val = lbladdhdr1.SelectedValue;
                    }
                    else
                    {
                        up_val = lbladdhdr.SelectedValue;
                    }

                    string Inssql = "insert into " + tn1 + " (" + tc1 + "," + tc2 + "," + tc3 + "," + tc5 + "," + tc6 + ",crt_id,cr_dt) values('" + txtAddName.Text + "','" + txtAddcode.Text + "','" + ddlStatus.SelectedValue + "','" + up_val + "','" + tc7 + "','" + Session["new"].ToString() + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')";
                    Status = DBCon.Ora_Execute_CommamdText(Inssql);
                    if (Status == "SUCCESS")
                    {
                        Session["get_cd"] = "";
                        sel_val();
                        ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Berjaya Disimpan.',{'type': 'confirmation','title': 'Success','auto_close': 2000});", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Sudah Wujud.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Nilai.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                sel_val();
            }
        }

        string script1 = " $(function () {  $(" + gv_refdata.ClientID + ") .prepend($('<thead></thead>').append($(this).find('tr:first'))).DataTable({'responsive': true,'sPaginationType': 'full_numbers',  'iDisplayLength': 15,'aLengthMenu': [[15, 30, 50, 100], [15, 30, 50, 100]]});});";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
    }
Esempio n. 37
0
    protected void yukle()
    {
        System.Web.UI.WebControls.TextBox txtmiktar = (System.Web.UI.WebControls.TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("miktar");
        System.Web.UI.WebControls.TextBox txfiyat   = (System.Web.UI.WebControls.TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("fiyat");

        txfiyat.ReadOnly   = false;
        txtmiktar.ReadOnly = false;
        Button1.Enabled    = false;
    }
Esempio n. 38
0
        public Text()
        {
            this.Name        = "Text";
            this.Description = "Will render a text input";


            tb     = new TextBox();
            _value = new List <object>();
        }
Esempio n. 39
0
    protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        string text  = this.TreeView1.SelectedNode.Text.ToString().Trim().Trim().Substring(0, this.TreeView1.SelectedNode.Text.ToString().LastIndexOf("[")).Trim();
        string text2 = this.TreeView1.SelectedNode.Value.ToString().Trim();

        if (this.fcnum.Value.ToString().Trim() == "1")
        {
            if (!this.isexit("HumanName", text))
            {
                System.Web.UI.WebControls.TextBox expr_A0 = this.TBoxConsignee;
                expr_A0.Text = expr_A0.Text + this.TreeView1.SelectedNode.Text.ToString().Trim().Substring(0, this.TreeView1.SelectedNode.Text.ToString().LastIndexOf("[")).Trim() + ",";
                System.Web.SessionState.HttpSessionState session;
                (session = this.Session)["HumanName"] = session["HumanName"] + text + ",";
                if (!this.isexit("HumanCode", text2))
                {
                    System.Web.SessionState.HttpSessionState session2;
                    (session2 = this.Session)["HumanCode"] = session2["HumanCode"] + text2 + "!";
                    return;
                }
            }
        }
        else
        {
            if (this.fcnum.Value.ToString().Trim() == "2")
            {
                if (!this.isexit("HumanName2", text))
                {
                    System.Web.UI.WebControls.TextBox expr_196 = this.txtCopy;
                    expr_196.Text = expr_196.Text + this.TreeView1.SelectedNode.Text.ToString().Trim().Substring(0, this.TreeView1.SelectedNode.Text.ToString().LastIndexOf("[")).Trim() + ",";
                    System.Web.SessionState.HttpSessionState session3;
                    (session3 = this.Session)["HumanName2"] = session3["HumanName2"] + text + ",";
                    if (!this.isexit("HumanCode2", text2))
                    {
                        System.Web.SessionState.HttpSessionState session4;
                        (session4 = this.Session)["HumanCode2"] = session4["HumanCode2"] + text2 + "!";
                        return;
                    }
                }
            }
            else
            {
                if (this.fcnum.Value.ToString().Trim() == "3" && !this.isexit("HumanName3", text))
                {
                    System.Web.UI.WebControls.TextBox expr_290 = this.txtSecret;
                    expr_290.Text = expr_290.Text + this.TreeView1.SelectedNode.Text.ToString().Trim().Substring(0, this.TreeView1.SelectedNode.Text.ToString().LastIndexOf("[")).Trim() + ",";
                    System.Web.SessionState.HttpSessionState session5;
                    (session5 = this.Session)["HumanName3"] = session5["HumanName3"] + text + ",";
                    if (!this.isexit("HumanCode3", text2))
                    {
                        System.Web.SessionState.HttpSessionState session6;
                        (session6 = this.Session)["HumanCode3"] = session6["HumanCode3"] + text2 + "!";
                    }
                }
            }
        }
    }
Esempio n. 40
0
        /// <summary>
        /// 检查分数是否合格,合格返回true,否则返回false
        /// </summary>
        /// <returns></returns>
        private bool CheckScores()
        {
            List <string> tempScores = new List <string>();

            for (int i = 0; i < Grid1.Rows.Count; i++)
            {
                GridRow row = Grid1.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score1") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            for (int i = 0; i < Grid2.Rows.Count; i++)
            {
                GridRow row = Grid2.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score2") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            for (int i = 0; i < Grid3.Rows.Count; i++)
            {
                GridRow row = Grid3.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score3") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            for (int i = 0; i < Grid4.Rows.Count; i++)
            {
                GridRow row = Grid4.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score4") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            for (int i = 0; i < Grid5.Rows.Count; i++)
            {
                GridRow row = Grid5.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score5") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            for (int i = 0; i < Grid6.Rows.Count; i++)
            {
                GridRow row = Grid6.Rows[i];
                System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score6") as System.Web.UI.WebControls.TextBox;
                tempScores.Add(tb.Text.Trim());
            }

            string[] tempScoreArray = tempScores.ToArray();
            if (CheckNull(tempScoreArray) && isNumber(tempScoreArray) && isProperty(tempScoreArray))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 41
0
    protected void gvEmp_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label otd_dt = (Label)e.Row.FindControl("lbl1");

            System.Web.UI.WebControls.TextBox val2 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lbl2");
            System.Web.UI.WebControls.TextBox val3 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lbl3");
            System.Web.UI.WebControls.TextBox val4 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lbl5");
            System.Web.UI.WebControls.TextBox val5 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lbl4");
            System.Web.UI.WebControls.Label   val6 = (System.Web.UI.WebControls.Label)e.Row.FindControl("hrs_id");
            System.Web.UI.WebControls.Label   val7 = (System.Web.UI.WebControls.Label)e.Row.FindControl("mins_id");

            CheckBox chkinst = (CheckBox)e.Row.FindControl("rbtnSelect2");

            DateTime  ot_dt        = DateTime.ParseExact(otd_dt.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DataTable get_otd_info = new DataTable();
            get_otd_info = DBCon.Ora_Execute_table("select * from hr_daily_ot where otd_staff_no='" + Session["New"].ToString() + "' and otd_month='" + DropDownList1.SelectedValue + "' and otd_year='" + Tahun_kew.SelectedItem.Text + "' and otd_work_dt='" + ot_dt.ToString("yyyy-MM-dd") + "'");


            if (get_otd_info.Rows.Count != 0)
            {
                val2.Text = get_otd_info.Rows[0]["otd_time_start"].ToString();
                val3.Text = get_otd_info.Rows[0]["otd_time_end"].ToString();
                val4.Text = get_otd_info.Rows[0]["otd_desc"].ToString();
                val5.Text = get_otd_info.Rows[0]["otd_total_hour"].ToString();
                string[] words = val5.Text.Split('.');
                //chkinst.Checked = true;
                val6.Text = words[0].ToString();
                val7.Text = words[1].ToString();
                if (get_otd_info.Rows[0]["otd_klm"].ToString() == "1")
                {
                    rr1_chk.Checked = true;
                }
                else
                {
                    rr1_chk.Checked = false;
                }
                if (get_otd_info.Rows[0]["otd_repl_leave"].ToString() == "1")
                {
                    rr1_ch2.Checked = true;
                }
                else
                {
                    rr1_ch2.Checked = false;
                }
            }
            else
            {
                //chkinst.Checked = false;
            }
        }
        if (e.Row.RowType == DataControlRowType.Footer)
        {
        }
    }
Esempio n. 42
0
 protected override void AttachChildControls()
 {
     if (this.Context.Request.IsAuthenticated)
     {
         System.Web.Security.FormsAuthentication.SignOut();
         System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(HiContext.Current.User.Username, true);
         IUserCookie           userCookie = HiContext.Current.User.GetUserCookie();
         if (userCookie != null)
         {
             userCookie.DeleteCookie(authCookie);
         }
         RoleHelper.SignOut(HiContext.Current.User.Username);
     }
     if (!string.IsNullOrEmpty(this.Page.Request["action"]) && this.Page.Request["action"] == "Common_UserLogin")
     {
         string text  = this.UserLogin(this.Page.Request["username"], this.Page.Request["password"]);
         string text2 = string.IsNullOrEmpty(text) ? "Succes" : "Fail";
         this.Page.Response.Clear();
         this.Page.Response.ContentType = "application/json";
         string s = string.Concat(new string[]
         {
             "{\"Status\":\"",
             text2,
             "\",\"Msg\":\"",
             text,
             "\"}"
         });
         this.Page.Response.Write(s);
         this.Page.Response.End();
     }
     this.txtUserName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtPassword = (System.Web.UI.WebControls.TextBox) this.FindControl("txtPassword");
     this.btnLogin    = ButtonManager.Create(this.FindControl("btnLogin"));
     this.ddlPlugins  = (System.Web.UI.WebControls.DropDownList) this.FindControl("ddlPlugins");
     this.currFlag    = (System.Web.UI.WebControls.HiddenField) this.FindControl("currFlag");
     if (this.ddlPlugins != null)
     {
         this.ddlPlugins.Items.Add(new System.Web.UI.WebControls.ListItem("请选择登录方式", ""));
         System.Collections.Generic.IList <OpenIdSettingsInfo> configedItems = MemberProcessor.GetConfigedItems();
         if (configedItems != null && configedItems.Count > 0)
         {
             foreach (OpenIdSettingsInfo current in configedItems)
             {
                 this.ddlPlugins.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.OpenIdType));
             }
         }
         this.ddlPlugins.SelectedIndexChanged += new System.EventHandler(this.ddlPlugins_SelectedIndexChanged);
     }
     if (this.Page.Request.UrlReferrer != null && !string.IsNullOrEmpty(this.Page.Request.UrlReferrer.OriginalString))
     {
         Login.ReturnURL = this.Page.Request.UrlReferrer.OriginalString;
     }
     this.txtUserName.Focus();
     PageTitle.AddSiteNameTitle("用户登录");
     this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
 }
Esempio n. 43
0
        private void tbxChineseScore_DataBinding(object sender, EventArgs e)
        {
            AspNet.TextBox tbxChineseScore = (AspNet.TextBox)sender;

            IDataItemContainer dataItemContainer = (IDataItemContainer)tbxChineseScore.NamingContainer;

            int chineseScore = Convert.ToInt32(((DataRowView)dataItemContainer.DataItem)["ChineseScore"]);

            tbxChineseScore.Text = chineseScore.ToString();
        }
Esempio n. 44
0
 protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
 {
     System.Web.UI.WebControls.TextBox txtmiktar = (System.Web.UI.WebControls.TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("miktar");
     System.Web.UI.WebControls.TextBox txfiyat   = (System.Web.UI.WebControls.TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("fiyat");
     txfiyat.ReadOnly    = false;
     txtmiktar.ReadOnly  = false;
     Button1.Enabled     = true;
     GridView1.EditIndex = -1;
     BindData();
 }
Esempio n. 45
0
        protected override void CreateChildControls()
        {
            ctrl    = new System.Web.UI.WebControls.TextBox();
            ctrl.ID = "ctrl";
            Controls.Add(ctrl);

            ctrlRegularExpressionValidator    = new System.Web.UI.WebControls.RegularExpressionValidator();
            ctrlRegularExpressionValidator.ID = "ctrlRegularExpressionValidator";
            Controls.Add(ctrl);
        }
Esempio n. 46
0
 protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.TextBox textBox = (System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[0];
         textBox.Attributes.Add("size", "4");
         textBox = (System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0];
         textBox.Attributes.Add("size", "20");
     }
 }
Esempio n. 47
0
        private TextBox TextBox(string SelectID)
        {
            TextBox Tb = new System.Web.UI.WebControls.TextBox();

            Tb.ID     = SelectID + id.ToString();
            Tb.Width  = 80;
            Tb.Height = 10;

            return(Tb);
        }
Esempio n. 48
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var webService = new textWebService.TextWebService();

            System.Web.UI.WebControls.Label   toLowerLabel = (System.Web.UI.WebControls.Label)FindControl("toLowerLabel");
            System.Web.UI.WebControls.Label   toUpperLabel = (System.Web.UI.WebControls.Label)FindControl("toUpperLabel");
            System.Web.UI.WebControls.TextBox TextBox1     = (System.Web.UI.WebControls.TextBox)FindControl("TextBox1");
            toLowerLabel.Text = webService.ToLower(TextBox1.Text);
            toUpperLabel.Text = webService.ToUpper(TextBox1.Text);
        }
Esempio n. 49
0
 protected override void AttachChildControls()
 {
     this.txtPromoteSalesName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtPromoteSalesName");
     this.fckDescription      = (KindeditorControl)this.FindControl("fckDescription");
     if (!this.Page.IsPostBack && this.promotion != null)
     {
         this.txtPromoteSalesName.Text = this.promotion.Name;
         this.fckDescription.Text      = this.promotion.Description;
     }
 }
Esempio n. 50
0
    protected void gv_refdata_RowCommand(object sender, GridViewCommandEventArgs e)

    {
        if (e.CommandName.Equals("ADD"))

        {
            System.Web.UI.WebControls.TextBox txtAddName = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddName");

            System.Web.UI.WebControls.TextBox txtAddcode = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddcode");

            System.Web.UI.WebControls.TextBox txtAddwgt = (System.Web.UI.WebControls.TextBox)gv_refdata.FooterRow.FindControl("txtAddwgt");

            DropDownList ddlStatus = (DropDownList)gv_refdata.FooterRow.FindControl("ddlStatus");

            if (txtAddName.Text != "" && txtAddcode.Text != "")
            {
                DataTable dtcenter = new DataTable();

                dtcenter = Dblog.Ora_Execute_table("select * from Ref_hr_type_klm where typeklm_desc='" + txtAddName.Text + "'");
                if (dtcenter.Rows.Count == 0)
                {
                    conn.Open();


                    string cmdstr = "insert into Ref_hr_type_klm (typeklm_desc,typeklm_cd,typeklm_weight,Status) values(@typeklm_desc,@typeklm_cd,@typeklm_weight,@Status)";

                    SqlCommand cmd = new SqlCommand(cmdstr, conn);

                    cmd.Parameters.AddWithValue("@typeklm_desc", txtAddcode.Text);
                    cmd.Parameters.AddWithValue("@typeklm_cd", txtAddName.Text);
                    cmd.Parameters.AddWithValue("@typeklm_weight", txtAddwgt.Text);
                    cmd.Parameters.AddWithValue("@Status", ddlStatus.SelectedValue);

                    cmd.ExecuteNonQuery();

                    conn.Close();

                    sel_val();
                    service.audit_trail("P0214", "Simpan", "KLM", txtAddcode.Text);
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Berjaya Simpan.',{'type': 'confirmation','title': 'Success','auto_close': 2000});", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Sudah Wujud.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan Nilai.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true);
                sel_val();
            }
            string script1 = " $(function () {  $(" + gv_refdata.ClientID + ") .prepend($('<thead></thead>').append($(this).find('tr:first'))).DataTable({'responsive': true,'sPaginationType': 'full_numbers',  'iDisplayLength': 15,'aLengthMenu': [[15, 30, 50, 100], [15, 30, 50, 100]]});});";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
        }
    }
Esempio n. 51
0
        private void btnGuardarComponentes_Click(object sender, System.EventArgs e)
        {
            //Validaciones
            string valor;
            double valorR;
            int    numComponentes = dgrComponentes.Items.Count;

            bool[] componentes = new bool[numComponentes];
            //Placa
            if (ddlplaca.SelectedValue.Length == 0)
            {
                Utils.MostrarAlerta(Response, "  Debe seleccionar la placa.");
                return;
            }
            //Encargado
            string nitResponsable = DBFunctions.SingleData("select mnit_nit from DBXSCHEMA.susuario where susu_login='******';");

            if (nitResponsable.Length == 0)
            {
                Utils.MostrarAlerta(Response, "  El usuario actual (responsable) no tiene un NIT asociado.");
                return;
            }
            //Valores
            for (int nC = 0; nC < numComponentes; nC++)
            {
                valor = ((TextBox)dgrComponentes.Items[nC].FindControl("txtValorComponente")).Text.Replace(",", "").Trim();
                if (valor.Length > 0)
                {
                    try{
                        valorR          = Double.Parse(valor);
                        componentes[nC] = true;
                    }
                    catch {
                        Utils.MostrarAlerta(Response, "  El valor de un componente no es válido.");
                        return;
                    }
                }
                else
                {
                    componentes[nC] = false;
                }
            }
            //Borrar anteriores valores
            DBFunctions.NonQuery("delete from dbxschema.mbus_componente where MCAT_PLACA='" + ddlplaca.SelectedValue + "'");
            //Guardar nuevos valores
            for (int nC = 0; nC < numComponentes; nC++)
            {
                if (componentes[nC])
                {
                    valorR = Double.Parse(((TextBox)dgrComponentes.Items[nC].FindControl("txtValorComponente")).Text.Replace(",", "").Trim());
                    DBFunctions.NonQuery("insert into dbxschema.mbus_componente values(" + dgrComponentes.DataKeys[nC] + ",'" + ddlplaca.SelectedValue + "'," + valorR + ",'" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + nitResponsable + "')");
                }
            }
            imgCambia = "<script language='javascript'>cargarPlacaDB(document.getElementById('" + ddlplaca.ClientID + "'));</script>";
        }
Esempio n. 52
0
        private void grdAttribute_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            int rowIndex               = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex;
            int attributeId            = (int)this.grdAttribute.DataKeys[rowIndex].Value;
            int displaySequence        = int.Parse((this.grdAttribute.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None);
            int num                    = 0;
            int replaceDisplaySequence = 0;

            if (e.CommandName == "saveAttributeName")
            {
                System.Web.UI.WebControls.TextBox textBox = this.grdAttribute.Rows[rowIndex].FindControl("txtAttributeName") as System.Web.UI.WebControls.TextBox;
                AttributeInfo attribute = ProductTypeHelper.GetAttribute(attributeId);
                if (string.IsNullOrEmpty(textBox.Text.Trim()) || textBox.Text.Trim().Length > 15)
                {
                    string str = string.Format("ShowMsg(\"{0}\", {1});", "属性名称限制在1-15个字符以内", "false");
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ServerMessageScript2", "<script language='JavaScript' defer='defer'>setTimeout(function(){" + str + "},300);</script>");
                    return;
                }
                attribute.AttributeName = Globals.HtmlEncode(textBox.Text);
                ProductTypeHelper.UpdateAttributeName(attribute);
                base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
            }
            if (e.CommandName == "SetYesOrNo")
            {
                AttributeInfo attribute2 = ProductTypeHelper.GetAttribute(attributeId);
                if (attribute2.IsMultiView)
                {
                    attribute2.UsageMode = AttributeUseageMode.View;
                }
                else
                {
                    attribute2.UsageMode = AttributeUseageMode.MultiView;
                }
                ProductTypeHelper.UpdateAttributeName(attribute2);
                base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
            }
            if (e.CommandName == "Fall")
            {
                if (rowIndex < this.grdAttribute.Rows.Count - 1)
                {
                    num = (int)this.grdAttribute.DataKeys[rowIndex + 1].Value;
                    replaceDisplaySequence = int.Parse((this.grdAttribute.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None);
                }
            }
            else if (e.CommandName == "Rise" && rowIndex > 0)
            {
                num = (int)this.grdAttribute.DataKeys[rowIndex - 1].Value;
                replaceDisplaySequence = int.Parse((this.grdAttribute.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text, System.Globalization.NumberStyles.None);
            }
            if (num > 0)
            {
                ProductTypeHelper.SwapAttributeSequence(attributeId, num, displaySequence, replaceDisplaySequence);
                this.BindAttribute();
            }
        }
Esempio n. 53
0
  /// <summary>GridViewURI_RowUpdating().</summary>
  public void GridViewURI_RowUpdating
  (
   Object                   sender, 
   GridViewUpdateEventArgs  e
  ) 
  {
   int                                rowIndex     =  -1;
   
   DateTime                           dated;

   String                             keyword      =  null;
   String                             title        =  null;
   String                             uri          =  null;
      
   GridViewRow                        gridViewRow  =  null;
   System.Web.UI.WebControls.TextBox  textBox      =  null;

   /*
   gridViewRow = GridViewURI.Rows[e.RowIndex];

   if ( gridViewRow != null )
   {
    textBox = ( System.Web.UI.WebControls.TextBox ) gridViewRow.FindControl("URI");
    if ( gridViewRow != null )
    {
     Response.Write( textBox.Text );
    }//if ( gridViewRow != null )
   }//if ( gridViewRow != null )
   */

   rowIndex  =  e.RowIndex;
   
   uri       =  (String) e.Keys["URI"]; 

   dated     =  Convert.ToDateTime( e.NewValues["Dated"] );
   keyword   =  (String)   e.NewValues["Keyword"];
   title     =  (String)   e.NewValues["Title"];
   
   Feedback = "e.Keys[" + e.Keys.Count + ']';
   Feedback = Feedback + "| e.OldValues[" + e.OldValues.Count + ']';
   Feedback = Feedback + "| e.NewValues[" + e.NewValues.Count + ']';
   
   for ( int keyIndex = 0; keyIndex < e.Keys.Count; ++keyIndex )
   {
   	Feedback += e.Keys[ keyIndex ];
   	Feedback += '|';
   }//for ( int keyIndex = 0; keyIndex <= e.Keys.Count, ++keyIndex )

   for ( int newValuesIndex = 0; newValuesIndex < e.NewValues.Count; ++newValuesIndex )
   {
   	Feedback += e.NewValues[ newValuesIndex ];
   	Feedback += '|';
   }//for ( int newValuesIndex = 0; newValuesIndex < e.NewValues.Count; ++newValuesIndex )
 
  }//public void GridViewURI_RowUpdating    
Esempio n. 54
0
    protected void gvEmp_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            var ddl = (DropDownList)e.Row.FindControl("Col1");
            //int CountryId = Convert.ToInt32(e.Row.Cells[0].Text);
            SqlCommand     cmd = new SqlCommand("select kod_akaun,(kod_akaun + ' | ' + nama_akaun) as name from KW_Ref_Carta_Akaun where jenis_akaun_type !='1' and Status='A' order by kod_akaun asc", con);
            SqlDataAdapter da  = new SqlDataAdapter(cmd);
            DataSet        ds  = new DataSet();
            da.Fill(ds);
            con.Close();
            ddl.DataSource     = ds;
            ddl.DataTextField  = "name";
            ddl.DataValueField = "kod_akaun";
            ddl.DataBind();
            ddl.SelectedValue = ((DataRowView)e.Row.DataItem)["Col1"].ToString();
            ddl.Items.Insert(0, new ListItem("--- PILIH ---", ""));


            var samp = Request.Url.Query;
            if (samp != "")
            {
                System.Web.UI.WebControls.TextBox txt = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("Col3");
                System.Web.UI.WebControls.TextBox txt1 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("Col4");
                float sval1 = 0, sval2 = 0;
                if (txt.Text == "")
                {
                    sval1 = 0;
                }
                else
                {
                    sval1 = (float)Convert.ToDecimal(txt.Text);
                }

                if (txt1.Text == "")
                {
                    sval2 = 0;
                }
                else
                {
                    sval2 = (float)Convert.ToDecimal(txt1.Text);
                }

                total  += sval1;
                total1 += sval2;
            }
        }
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            System.Web.UI.WebControls.TextBox lblamount1 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lblTotal1");
            System.Web.UI.WebControls.TextBox lblamount2 = (System.Web.UI.WebControls.TextBox)e.Row.FindControl("lblTotal2");
            lblamount1.Text = total.ToString("C").Replace("RM", "").Replace("$", "");
            lblamount2.Text = total1.ToString("C").Replace("RM", "").Replace("$", "");
        }
    }
Esempio n. 55
0
        public void RenderBindingObject(HtmlTextWriter output)
        {
            if (this.BindingObject == null)
            {
                return;
            }
            TableMapAttribute     tableAttribute = DomainObjectUtility.GetTableMapAttribute(this.BindingObject);
            Hashtable             hs             = DomainObjectUtility.GetAttributeMemberInfos(this.BindingObject);
            IDictionaryEnumerator myEnumerator   = hs.GetEnumerator();
            int cols  = 0;
            int perTd = 100 / (this.Columns * 2);

            while (myEnumerator.MoveNext())
            {
                if ((cols % this.Columns) == 0)
                {
                    if (cols != 0)
                    {
                        output.RenderEndTag();
                    }
                    output.RenderBeginTag(HtmlTextWriterTag.Tr);
                }

                output.AddStyleAttribute(HtmlTextWriterStyle.Width, perTd.ToString() + "%");
                output.AddAttribute(HtmlTextWriterAttribute.Align, "right");
                output.RenderBeginTag(HtmlTextWriterTag.Td);

                System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
                lbl.ID   = "lbl" + ((FieldMapAttribute)myEnumerator.Key).FieldName;
                lbl.Text = ((MemberInfo)myEnumerator.Value).Name;
                lbl.RenderControl(output);
                output.RenderEndTag();

                output.AddStyleAttribute(HtmlTextWriterStyle.Width, perTd.ToString() + "%");
                output.AddAttribute(HtmlTextWriterAttribute.Align, "left");
                output.RenderBeginTag(HtmlTextWriterTag.Td);

                Type type1 = ((MemberInfo)myEnumerator.Value is FieldInfo) ? ((FieldInfo)myEnumerator.Value).FieldType : ((PropertyInfo)myEnumerator.Value).PropertyType;

                System.Web.UI.WebControls.TextBox txtBox = new System.Web.UI.WebControls.TextBox();
                txtBox.ID = "txt" + ((FieldMapAttribute)myEnumerator.Key).FieldName;
                //txtBox.Text		= DomainObjectUtility.XMLEncodeValue(((FieldMapAttribute)myEnumerator.Key).DataType, type1, DomainObjectUtility.GetValue(this.BindingObject , ((MemberInfo)myEnumerator.Value), null));
                txtBox.RenderControl(output);
                output.RenderEndTag();
                cols = cols + 1;
            }

            if (((cols - 1) % this.Columns) != 0)
            {
                if (cols > 0)
                {
                    output.RenderEndTag();
                }
            }
        }
Esempio n. 56
0
    private void AddNewRow()
    {
        int rowIndex = 0;

        if (ViewState["CurrentTable"] != null)
        {
            DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
            DataRow   drCurrentRow   = null;
            //if (dtCurrentTable.Rows.Count < 2)
            //{
            if (dtCurrentTable.Rows.Count > 0)
            {
                for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
                {
                    DropDownList v1 =
                        (DropDownList)grvStudentDetails.Rows[rowIndex].Cells[1].FindControl("Col1");
                    System.Web.UI.WebControls.TextBox v2 =
                        (System.Web.UI.WebControls.TextBox)grvStudentDetails.Rows[rowIndex].Cells[2].FindControl("Col2");
                    System.Web.UI.WebControls.TextBox v2_1 =
                        (System.Web.UI.WebControls.TextBox)grvStudentDetails.Rows[rowIndex].Cells[3].FindControl("Col3");


                    drCurrentRow = dtCurrentTable.NewRow();
                    drCurrentRow["RowNumber"] = i + 1;

                    dtCurrentTable.Rows[i - 1]["Col1"] = v1.SelectedValue;
                    dtCurrentTable.Rows[i - 1]["Col2"] = v2.Text;
                    dtCurrentTable.Rows[i - 1]["Col3"] = v2_1.Text;

                    rowIndex++;
                    //if (v3.Text != "")
                    //{
                    //    decimal amt1 = Convert.ToDecimal(v3.Text);
                    //    total += (double)amt1;
                    //}
                    //if (v4.Text != "")
                    //{
                    //    decimal amt2 = Convert.ToDecimal(v4.Text);
                    //    total1 += (double)amt2;
                    //}
                }
                dtCurrentTable.Rows.Add(drCurrentRow);
                ViewState["CurrentTable"] = dtCurrentTable;

                grvStudentDetails.DataSource = dtCurrentTable;
                grvStudentDetails.DataBind();
            }
        }
        else
        {
            Response.Write("ViewState is null");
        }
        SetPreviousData();
    }
Esempio n. 57
0
        /// <summary>
        /// 设置数值控件
        /// </summary>
        /// <param name="webCtrl">文本控件</param>
        /// <param name="intBit">整数位</param>
        /// <param name="decBit">小数位</param>
        /// <param name="ifRight">是否居右</param>
        public static void SetNumberControl(System.Web.UI.WebControls.TextBox webCtrl, int intBit, int decBit, bool ifRight)
        {
            if (true == ifRight)
            {
                webCtrl.Style.Add("TEXT-ALIGN", "right");
            }

            webCtrl.Attributes.Add("onkeypress", "javascript:return ComVerifyControl_onkeypress(this,1," + intBit.ToString() + "," + decBit.ToString() + ");");
            webCtrl.Attributes.Add("onpropertychange", "javascript:return ComVerifyControl_onpropertychange(this,1," + intBit.ToString() + "," + decBit.ToString() + ");");
            //webCtrl.Attributes.Add("onkeydown", "javascript:javascript:return ComVerifyControl_onpropertychange(this," + inputType.ToString() + "," + intBit.ToString() + "," + decBit.ToString() + ");");
        }
Esempio n. 58
0
 protected void GridView9_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "modi")
     {
         var     row  = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         TextBox note = row.Cells[6].FindControl("TextBox1") as TextBox;
         TextBox net  = row.Cells[7].FindControl("TextBox2") as TextBox;
         note.Enabled = true;
         net.Enabled  = true;
     }
 }
Esempio n. 59
0
 protected void Unnamed1_Click(object sender, EventArgs e)
 {
     foreach (Control ct in Panel1.Controls)
     {
         if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.Panel1"))
         {
             TextBox cb = (TextBox)ct;
             cb.Text = "";
         }
     }
 }
Esempio n. 60
0
  }//public String Feedback

  /// <summary>ButtonReset_Click()</summary>
  public void ButtonReset_Click
  (
   Object sender, 
   EventArgs e
  )
  {
   CheckBoxXml.Checked  =  false;
   Feedback             =  null;
   TextBoxText          =  null;
   TextBoxText.Focus();   
  }//public void ButtonReset_Click()