protected void InitControls() { this.bTitle.Text = ""; this.bOrder.Text = StringPlus.NullToString(dal.GetRecordCount("") + 1); this.bContent.Text = ""; ScriptManager1.SetFocus(this.bTitle); }
/// <summary> /// Order fins based on customer and PO/Invoice /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ibtnHeaderFind_Click(object sender, ImageClickEventArgs e) { if (txtCustomerNumber.Text != "") { string ddlbind = ddlconditionBind(); if (ddlHeaderType.SelectedValue == "PO" && ViewState["CustomerNumber"] != null && txtCustomerNumber.Text.Trim() != "" && txtSOInvoiceNo.Text.Trim() != "") { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "' and CustPONo='" + txtSOInvoiceNo.Text + "'" + deleteCondition; } else if (ddlHeaderType.SelectedValue == "IN" && txtCustomerNumber.Text.Trim() != "" && txtSOInvoiceNo.Text.Trim() != "") { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "' and Invoiceno='" + txtSOInvoiceNo.Text + "'" + deleteCondition; } else { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "'"; } whereClause = whereClause + ddlbind; BindDataGrid(); } else { ScriptManager.RegisterClientScriptBlock(ibtnHeaderFind, ibtnHeaderFind.GetType(), "required", "alert('Enter Customer Number');", true); ScriptManager1.SetFocus(txtCustomerNumber); } }
protected void Btn_Send_Click(object sender, EventArgs e) { InsertMessage(null); GetMessage(); litMessages.SelectedIndex = litMessages.Items.Count - 1; ScriptManager1.SetFocus(txtMessage.ClientID); }
protected void Timer1_OnTick(object sender, EventArgs e) { this.GetLoggedInUsers(); this.GetMessages(); if ((string)Session["IsChatroomInFocus"] == null) { ScriptManager1.SetFocus(txtMessage); } }
protected void BtnSend_Click(object sender, EventArgs e) { if (txtMessage.Text.Length > 0) { this.InsertMessage(null); this.GetMessages(); txtMessage.Text = String.Empty; ScriptManager1.SetFocus(txtMessage.ClientID); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { soNumber = txtSONumber.Text = Request.QueryString["SONumber"].ToString().Trim().ToUpper(); ViewState["SONumber"] = soNumber; string dtSource = null; if (!IsPostBack && Session["OrderTableName"] != null) { dtSource = soShipStatus.ValidateSoNumber("OrderNo='" + soNumber.Trim().Replace("W", "") + "'", Session["OrderTableName"].ToString()); } else if (soNumber.Contains("W")) { dtSource = soShipStatus.ValidateSoNumber("OrderNo='" + soNumber.Trim() + "'", "SOheaderrel"); } if (dtSource != null) { hidTableName.Value = dtSource; BindOrderDetails(); // Display Just Header on LOAD (By passing empty parameter) if (gvControl.Rows.Count <= 0) { DataTable dsControl = soShipStatus.GetGridControl(soNumber.Replace("W", "")); dsControl.Rows.Clear(); dsControl.Rows.Add(dsControl.NewRow()); gvControl.ShowFooter = false; gvControl.DataSource = dsControl; gvControl.DataBind(); } if (gvDetail.Rows.Count <= 0) { dsDetail = soShipStatus.GetGridDetail(""); dsDetail.Rows.Clear(); dsDetail.Rows.Add(dsDetail.NewRow()); gvDetail.ShowFooter = false; gvDetail.DataSource = dsDetail; gvDetail.DataBind(); } } else { utility.DisplayMessage(MessageType.Failure, noRecordMessage, lblMessage); upMessage.Update(); ClearControl(); } ScriptManager1.SetFocus(txtSONumber); } }
public void EditResultsGrid(Object sender, GridViewEditEventArgs e) { try { ResultEditUpdatePanel.Visible = true; EditItemLabel.Text = ResultsGrid.Rows[e.NewEditIndex].Cells[1].Text; EditToPackTextBox.Text = ResultsGrid.Rows[e.NewEditIndex].Cells[5].Text; EditIDHidden.Value = ResultsGrid.Rows[e.NewEditIndex].Cells[11].Text; ResultEditUpdatePanel.Update(); ScriptManager1.SetFocus("EditToPackTextBox"); } catch (Exception e2) { ShowPageMessage("Edit Error " + e2.Message + ", " + e2.ToString(), 2); } }
protected void Button1_Click(object sender, EventArgs e) { TextBox1.Text = "pan 1"; ScriptManager1.SetFocus(TextBox2); //string script = "document.getElementById('" + TextBox1.ClientID + "').focus();"; //script = script + " WebForm_AutoFocus('" + TextBox1.ClientID + "');"; //Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "script1", script, true); //ScriptManager sm = new ScriptManager(); //sm.SetFocus(TextBox2); //CallbackPanel1.Controls.Add(new LiteralControl(String.Format(@"<script type=""text/javascript"">document.getElementById(""{0}"").focus();</script>", TextBox1.ClientID))); //string timeout="setTimeout(\"$('"+ TextBox2.ClientID + "').focus(); \",1000);"; //ClientScript.RegisterStartupScript(this.GetType(), "onkeypress", timeout, true); //System.Web.UI.ClientScriptManager a = new ClientScriptManager(); //ClientScript.RegisterStartupScript(this.GetType, "focusit", timeout, true); //TextBox2.Focus(); }
protected void InitControls() { this.bTitle.Text = ""; PaducnSoft.DAL.ay_prodclass dal_class = new PaducnSoft.DAL.ay_prodclass(); DataSet ds = dal_class.GetList(""); DropDownListHelp ddlHelper = new DropDownListHelp(); this.bClassID.Items.Clear(); ddlHelper.createDropDownTree(ds.Tables[0], "bParent", "0", "bId", "bName", "bId", this.bClassID); this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0")); this.bKeywords.Text = ""; this.bPic.Text = ""; this.bIsNew.Checked = false; this.bIsTop.Checked = false; this.bIsBest.Checked = false; this.bIsPass.Checked = true; this.bClick.Text = "0"; this.bContent.Text = ""; ScriptManager1.SetFocus(this.bTitle); }
protected void InitControls() { this.bTitle.Text = ""; this.bClassID.Items.Clear(); PaducnSoft.DAL.ay_newsclass dal_class = new PaducnSoft.DAL.ay_newsclass(); DataSet dsClass = dal_class.GetList(""); this.bClassID.DataTextField = "bName"; this.bClassID.DataValueField = "bId"; this.bClassID.DataSource = dsClass; this.bClassID.DataBind(); this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0")); this.bKeywords.Text = ""; this.bPic.Text = ""; this.bIsTop.Checked = false; this.bIsBest.Checked = false; this.bIsPass.Checked = true; this.bClick.Text = "0"; this.bContent.Text = ""; ScriptManager1.SetFocus(this.bTitle); }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["ctrlName"] != null) { hidfname.Value = Request.QueryString["ctrlName"].ToString(); } if (!IsPostBack) { customer = PFC.SOE.Securitylayer.Cryptor.Decrypt(Request.QueryString["Customer"].ToString()); if (!customer.Contains("%")) { customer += "%"; } txtCustName.Text = customer; BindCustomer(); } else { customer = txtCustName.Text; if (!customer.Contains("%")) { customer += "%"; } txtCustName.Text = customer; } ScriptManager1.SetFocus(txtCustName); pnlCustomerSearch.Update(); } catch (Exception ex) { } }
protected void btnProduct_Click(object sender, EventArgs e) { try { if ((this.lblErrorMessage.Text.Length != 0) || (this.lblSuccessMessage.Text.Length != 0)) { this.lblSuccessMessage.Text = ""; this.lblErrorMessage.Text = ""; } if (this.ddlProductName.SelectedValue == "") { return; } ProductInfoDTO oProductInfoDTO = new ProductInfoDTO(); Facade facade = Facade.GetInstance(); if (this.ddlProductName.SelectedValue != "") { oProductInfoDTO = ProductInfoBLImp.LoadProductInfoDTO((Guid)TypeDescriptor.GetConverter(oProductInfoDTO.PrimaryKey).ConvertFromString(this.ddlProductName.SelectedValue)); this.txtOpeningQty.Text = "1"; this.txtOpeningRate.Text = oProductInfoDTO.P_CostPrice.ToString("####.##"); this.txtOpeningDiscount.Text = oProductInfoDTO.P_Discount.ToString("####.##"); this.hfProductCode.Value = oProductInfoDTO.P_Code; this.HiddenField1.Value = oProductInfoDTO.PrimaryKey.ToString(); } } catch (Exception exp) { lblErrorMessage.Text = cls.ErrorString(exp); } finally { ScriptManager1.SetFocus(txtOpeningDate); } }
/// <summary> /// Page Load Event Handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { soNumber = Request.QueryString["SONumber"].ToString().Replace("W", ""); if (!IsPostBack) { //Bind Expense Code dropdown BindExpenseCode(); SoHeader.SONumber = soNumber; BindDataGrid(); PrintDialogue1.CustomerNo = SoHeader.CustNumber; PrintDialogue1.PageUrl = Server.UrlEncode("ExpenseEntryExport.aspx?SONumber=" + soNumber); PrintDialogue1.PageTitle = "Enter Expenses for " + soNumber; // Maintain Mode of operation ViewState["Mode"] = "ADD"; ScriptManager1.SetFocus(ddlCode); } if (Session["UserSecurity"].ToString() == "") { ibtnSave.Visible = false; } }
protected void btnClickProductCategory_Click(object sender, EventArgs e) { try { if (this.ddlProductCategory.SelectedValue == "") { return; } ProductInfoDTO pddlDTO = DDLPopulate(); Facade facade = Facade.GetInstance(); IProductSubCategoryInfoBL subCategoryList = facade.createProductSubCategoryBL(); List <ProductSubCategoryInfoDTO> oArrayList = subCategoryList.showDataSubCategoryInfoByPC(pddlDTO.PC_PrimaryKey); int i = 0; ddlProductSubCategory.Items.Clear(); ddlProductSubCategory.Items.Add("(Select any sub category)"); this.ddlProductSubCategory.Items[i].Value = ""; foreach (ProductSubCategoryInfoDTO newDto in oArrayList) { i++; this.ddlProductSubCategory.Items.Add(newDto.PSC_Description); this.ddlProductSubCategory.Items[i].Value = newDto.PrimaryKey.ToString(); } } catch (Exception exp) { lblErrorMessage.Text = cls.ErrorString(exp); } finally { ScriptManager1.SetFocus(ddlProductSubCategory); } }
protected void Button2_Click(object sender, EventArgs e) { TextBox2.Text = Request.UserHostAddress.ToString(); //TextBox1.Focus(); ScriptManager1.SetFocus(TextBox1); }
/// <summary> /// Order serach based on customer no /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void txtCustomerNumber_TextChanged(object sender, EventArgs e) { if (txtCustomerNumber.Text.Trim() != "") { string strCustNo = txtCustomerNumber.Text; int strCnt = 0; bool textIsNumeric = true; try { int.Parse(strCustNo); } catch { textIsNumeric = false; } if ((strCustNo != "") && !textIsNumeric) { if (isNumeric(strCustNo.Remove(strCustNo.Length - 1, 1), System.Globalization.NumberStyles.Integer) == false) { strCnt = Convert.ToInt32(cntCustName(strCustNo)); } else { strCnt = Convert.ToInt32(cntCustNo(strCustNo)); } int maxRowCount = custDet.GetSQLWarningRowCount(); if (strCnt < maxRowCount) { ScriptManager.RegisterClientScriptBlock(txtCustomerNumber, txtCustomerNumber.GetType(), "Customer", "LoadCustomerLookup('" + Server.UrlEncode(PFC.SOE.Securitylayer.Cryptor.Encrypt(strCustNo)) + "');", true); } else { ScriptManager.RegisterClientScriptBlock(txtCustomerNumber, txtCustomerNumber.GetType(), "Customer", "alert('Maximum row exceeds for this search.please enter additional data.');", true); } } else { DataTable dtCustomer = sOEFind.ValidateCustomer(txtCustomerNumber.Text.Trim()); if (dtCustomer != null && dtCustomer.Rows.Count > 0) { ClearControl(); txtCustomerNumber.Text = dtCustomer.Rows[0]["CustNo"].ToString(); ViewState["CustomerNumber"] = dtCustomer.Rows[0]["CustNo"].ToString(); lblContractNumber.Text = dtCustomer.Rows[0]["ContractNo"].ToString(); lblSalesRepNumber.Text = dtCustomer.Rows[0]["SlsRepNo"].ToString(); lblSalesRepName.Text = dtCustomer.Rows[0]["RepName"].ToString(); lblPriceCode.Text = dtCustomer.Rows[0]["PriceCd"].ToString(); ddlUserId.SelectedIndex = -1; ListItem lstItem = ddlUserId.Items.FindByValue(dtCustomer.Rows[0]["SlsRepNo"].ToString().Trim()) as ListItem; if (lstItem != null) { lstItem.Selected = true; } whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "'" + deleteCondition; upCustomerSearch.Update(); ScriptManager1.SetFocus(txtSOInvoiceNo); //BindDataGrid(); } else { ViewState["CustomerNumber"] = null; utility.DisplayMessage(PFC.SOE.Enums.MessageType.Failure, invalidCustomer, lblMessage); upMessage.Update(); ClearControl(); } } } }
protected void btnLoadItem_Click(object sender, EventArgs e) { GetItemLabelValues(); ScriptManager1.SetFocus(ddlLocation); }