protected void rgProduct_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadTextBox catnames = (RadTextBox)item.FindControl("catname"); RadNumericTextBox amount = (RadNumericTextBox)item.FindControl("amt"); string id = code.Text; string catname = catnames.Text; int amounts = Convert.ToInt32(amount.Text); if (string.IsNullOrEmpty(catname)) { ShowMessage("Category Name Cannot be empty"); return; } /*var validateprodcode = validatetransaction(prodcode); * if (validateprodcode.Rows.Count > 0) * { * ShowMessage("already used in transaction"); * return; * }*/ if (amounts == 0) { ShowMessage("Please fill amount"); return; } update(catname, amounts, id); }
protected void PlayerMoneyChanged(object sender, EventArgs e) { RadNumericTextBox moneyPerPlayer = (RadNumericTextBox)sender; int value = 12000 - ((int)moneyPerPlayer.Value * (int)PlayerCount.Value); BankMoney.Value = value; }
// client side validation function for overtime detail input form public void ValidatePremTypeDetail(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadComboBox ddlDayType = (editForm.FindControl("ddlDayType") as RadComboBox); CheckBox cbSpecVal = (editForm.FindControl("cbSpecVal") as CheckBox); RadNumericTextBox txtfromval = (editForm.FindControl("txtfromval") as RadNumericTextBox); RadNumericTextBox txttoval = (editForm.FindControl("txttoval") as RadNumericTextBox); RadNumericTextBox txtdefval = (editForm.FindControl("txtdefval") as RadNumericTextBox); if (update != null) { update.Attributes.Add("onclick", "return ValidatePremTypeDetail('" + ddlDayType.ClientID + "','" + cbSpecVal.ClientID + "','" + txtfromval.ClientID + "','" + txttoval.ClientID + "','" + txtdefval.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidatePremTypeDetail('" + ddlDayType.ClientID + "','" + cbSpecVal.ClientID + "','" + txtfromval.ClientID + "','" + txttoval.ClientID + "','" + txtdefval.ClientID + "')"); } }
protected void txtIdCte_OnTextChanged(object sender, EventArgs e) { try { RadNumericTextBox txt = (RadNumericTextBox)sender; RadComboBox Cmb_Id_Cte = (RadComboBox)txt.Parent.FindControl("Cmb_Id_Cte"); RadComboBox Cmb_Id_Ter = (RadComboBox)txt.Parent.FindControl("Cmb_Id_Ter"); RadNumericTextBox txtIdTer = (RadNumericTextBox)txt.Parent.FindControl("txtIdTer"); if (txt.Text.Contains("-") | txt.Text == "0") { txt.Text = ""; return; } Cmb_Id_Cte.SelectedValue = txt.Text; //cargar territorio del cliente a txtIdTer y Cmb_Id_Ter, despues de escribir en txtIdCte: Sesion Sesion = new Sesion(); Sesion = (Sesion)Session["Sesion" + Session.SessionID]; CapaNegocios.CN__Comun CN_Comun = new CapaNegocios.CN__Comun(); CN_Comun.LlenaCombo(Sesion.Id_Emp, Sesion.Id_Cd_Ver, Convert.ToInt32(txt.Text), Sesion.Emp_Cnx, "spCatTerritorioCte_Combo", ref Cmb_Id_Ter); if (Cmb_Id_Ter.SelectedValue != "-1") { txtIdTer.Text = Cmb_Id_Ter.SelectedValue; } txtIdTer.Focus(); } catch (Exception ex) { ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name); } }
protected void gv_layout_RowUpdating(object sender, GridViewUpdateEventArgs e) { Conexion Ocoon = new Conexion(); try { GridViewRow row = gv_layout.Rows[e.RowIndex]; Label lbl_IdDetll_layout = (Label)row.FindControl("lbl_IdDetll_layout"); RadNumericTextBox txt_gvl_objetivo = (RadNumericTextBox)row.FindControl("txt_gvl_objetivo"); RadNumericTextBox txt_gvl_cantidad = (RadNumericTextBox)row.FindControl("txt_gvl_cantidad"); RadNumericTextBox txt_gvl_frentes = (RadNumericTextBox)row.FindControl("txt_gvl_frentes"); RadDateTimePicker RadDateTimePicker_fec_reg = (RadDateTimePicker)row.FindControl("RadDateTimePicker_fec_reg"); string sUser = Session["sUser"].ToString(); Ocoon.ejecutarDataReader("UP_WEBXPLORA_OPE_ACTUALIZAR_REPORTE_LAYOUT_DETALLE_CANTIDADES", lbl_IdDetll_layout.Text.Trim(), txt_gvl_objetivo.Text, txt_gvl_cantidad.Text, txt_gvl_frentes.Text, RadDateTimePicker_fec_reg.DbSelectedDate, sUser, DateTime.Now); gv_layout.EditIndex = -1; cargarGrilla_Layout(); } catch (Exception ex) { ex.Message.ToString(); Response.Redirect("~/err_mensaje_seccion.aspx", true); } }
protected void grdProducts_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridEditableItem item = e.Item as GridEditableItem; Products product = e.Item.DataItem as Products; if (DealProducts != null) { ProductsChildRelationship dealProduct = DealProducts.Where(dp => dp.ChildProductId == product.ProductID).FirstOrDefault(); if (dealProduct != null) { CheckBox chk = item.FindControl("OptionCheckBox") as CheckBox; RadNumericTextBox quantity = item.FindControl("Quantity") as RadNumericTextBox; RadNumericTextBox unitPrice = item.FindControl("UnitPrice") as RadNumericTextBox; RadNumericTextBox FreeTopping = item.FindControl("FreeTopping") as RadNumericTextBox; CheckBox isCustomizable = item.FindControl("AllowCustomization") as CheckBox; chk.Checked = true; quantity.Text = dealProduct.Quantity.ToString(); unitPrice.Text = dealProduct.UnitPrice.ToString(); FreeTopping.Text = dealProduct.NumberOfFreeTopping.ToString(); isCustomizable.Checked = dealProduct.IsCustomizable; } } } }
void grdClient_UpdateCommand(object source, GridCommandEventArgs e) { if (Page.IsValid) { GridEditableItem editiedItem = e.Item as GridEditableItem; RadNumericTextBox rntClientPalletBalance = e.Item.FindControl("rntClientPalletBalance") as RadNumericTextBox; HiddenField hidWoodenPallets = e.Item.FindControl("hidWoodenPallets") as HiddenField; // Update the Pallet balance for the Client int identityID = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IdentityId"].ToString()); int palletTypeID = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PalletTypeId"].ToString()); int balance = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Balance"].ToString()); int PaperPallets = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PaperPallets"].ToString()); int oldWoodenBalance = int.Parse(hidWoodenPallets.Value); int newWoodenBalance = Convert.ToInt32(rntClientPalletBalance.Value); int oldBalance = oldWoodenBalance + PaperPallets; int newBalance = newWoodenBalance + PaperPallets; int difference = oldBalance - newBalance; using (Facade.IPalletBalance facPalletBalance = new Facade.Pallet()) { facPalletBalance.UpdateClientPalletBalance(null, null, null, identityID, palletTypeID, difference, ((Entities.CustomPrincipal)Page.User).UserName); } grdClient.Rebind(); } }
//protected void ddlBillingCode_SelectedIndexChanged(object sender, EventArgs e) //{ // DropDownList list = (DropDownList)sender; // GridDataItem item = (GridDataItem)list.NamingContainer; // int ChkSI = item.RowIndex; // Decimal GrandTotal = 0; // string str = list.SelectedValue; // if (ChkSI == 2) // { // foreach (GridDataItem Itm in FoodBillingListView.Items) // { // DropDownList dlist = (DropDownList)Itm.FindControl("ddlBillingCode"); // dlist.SelectedValue = str; // } // } // foreach (GridDataItem Item in FoodBillingListView.Items) // { // SqlProcsNew sqlobj = new SqlProcsNew(); // DataSet TxtRate = new DataSet(); // DropDownList ddlist = (DropDownList)Item.FindControl("ddlBillingCode"); // TxtRate = sqlobj.ExecuteSP("[SP_FetchBillingRatetotextbox]", // new SqlParameter() { ParameterName = "@IMODE", SqlDbType = SqlDbType.Int, Value = 1 }, // new SqlParameter() { ParameterName = "@BCode", SqlDbType = SqlDbType.NVarChar, Value = ddlist.SelectedValue }); // if (TxtRate.Tables[0].Rows.Count > 0) // { // RadNumericTextBox TxtBillfor = (RadNumericTextBox)Item.FindControl("TxtBillFor"); // RadNumericTextBox BRate = (RadNumericTextBox)Item.FindControl("TxtBillCodeRate"); // BRate.Text = TxtRate.Tables[0].Rows[0]["Rate"].ToString(); // Decimal BillingRate = Convert.ToDecimal(TxtRate.Tables[0].Rows[0]["Rate"].ToString()); // Decimal Billfor = Decimal.Parse(TxtBillfor.Text.ToString()); // RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); // Amount.Text = Convert.ToString(Billfor * BillingRate); // GrandTotal = GrandTotal + Convert.ToDecimal(Amount.Text.ToString()); // } // else // { // WebMsgBox.Show("Select Billing Code and Billing Date."); // return; // } // } // GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; // RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); // Total.Text = GrandTotal.ToString(); //} protected void FoodBillingListView_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = e.Item as GridDataItem; DropDownList dropdownlist = (DropDownList)dataItem.FindControl("ddlBillingCode"); RadNumericTextBox TxtBillCodeRate = (RadNumericTextBox)dataItem.FindControl("TxtBillCodeRate"); try { SqlProcsNew sqlobj = new SqlProcsNew(); DataSet ddlBCode = new DataSet(); ddlBCode = sqlobj.ExecuteSP("SP_FetchBillingCodeDropDown", new SqlParameter() { ParameterName = "@IMODE", SqlDbType = SqlDbType.Int, Value = 2 }); dropdownlist.DataSource = ddlBCode.Tables[0]; dropdownlist.DataValueField = "BCode"; dropdownlist.DataTextField = "BCodeDescription"; dropdownlist.DataBind(); dropdownlist.Dispose(); dropdownlist.Items.Insert(0, new ListItem("--Select--", "0")); } catch (Exception ex) { WebMsgBox.Show(ex.Message.ToString()); } } }
private DataTable GetGadeWiseAMount() { DataTable dt = GetGridDataTable(); try { RadNumericTextBox txtMinTenureMonths, txtMaxTenureMonths, txtInterest; RadComboBox rdProcessType; foreach (GridDataItem d in RG_TrainingApproval.Items) { txtMinTenureMonths = new RadNumericTextBox(); txtMinTenureMonths = d.FindControl("rtxt_Min") as RadNumericTextBox; txtMaxTenureMonths = new RadNumericTextBox(); txtMaxTenureMonths = d.FindControl("rtxt_Max") as RadNumericTextBox; txtInterest = new RadNumericTextBox(); txtInterest = d.FindControl("rtxt_Interest") as RadNumericTextBox; rdProcessType = new RadComboBox(); rdProcessType = d.FindControl("rc_LoanProcessType") as RadComboBox; dt.Rows.Add(Convert.ToInt32(d.Cells[2].Text), rdProcessType.SelectedItem.Text, Convert.ToInt32(txtMinTenureMonths.Text), Convert.ToInt32(txtMaxTenureMonths.Text), Convert.ToDecimal(txtInterest.Text)); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LoanSetup", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } return(dt); }
protected void txtTerritorio_TextChanged(object sender, EventArgs e) { RadNumericTextBox txtcliente = ((sender as RadNumericTextBox).Parent.FindControl("txtIdCte") as RadNumericTextBox); txtCliente_TextChanged(txtcliente, null); txtcliente.Focus(); }
protected void ActualizarItems() { int vIdTabuladorEmpleado; foreach (GridDataItem item in grdPlaneacionIncrementos.MasterTableView.Items) { vIdTabuladorEmpleado = int.Parse(item.GetDataKeyValue("ID_TABULADOR_EMPLEADO").ToString()); RadNumericTextBox vNuevoSueldo = (RadNumericTextBox)item.FindControl("txnSueldoNuevo"); E_PLANEACION_INCREMENTOS vLineaTabulador = vObtienePlaneacionIncrementos.FirstOrDefault(f => f.ID_TABULADOR_EMPLEADO.Equals(vIdTabuladorEmpleado)); vLineaTabulador.MN_SUELDO_NUEVO = (decimal)vNuevoSueldo.Value; } foreach (E_PLANEACION_INCREMENTOS item in vObtienePlaneacionIncrementos) { item.CUARTIL_SELECCIONADO = int.Parse(cmbCuartilIncremento.SelectedValue); item.MN_MINIMO_CUARTIL = CalculaMinimo(int.Parse(cmbCuartilIncremento.SelectedValue), item.MN_MINIMO_MINIMO, item.MN_MINIMO_PRIMER_CUARTIL, item.MN_MINIMO_MEDIO, item.MN_MINIMO_SEGUNDO_CUARTIL, item.MN_MINIMO_MAXIMO); item.MN_MAXIMO_CUARTIL = CalculaMaximo(int.Parse(cmbCuartilIncremento.SelectedValue), item.MN_MAXIMO_MINIMO, item.MN_MAXIMO_PRIMER_CUARTIL, item.MN_MAXIMO_MEDIO, item.MN_MAXIMO_SEGUNDO_CUARTIL, item.MN_MAXIMO_MAXIMO); item.DIFERENCIA = CalculoPrDiferencia(item.MN_MINIMO_CUARTIL, item.MN_MAXIMO_CUARTIL, item.MN_SUELDO_ORIGINAL); item.COLOR_DIFERENCIA = VariacionColor(item.DIFERENCIA, item.MN_SUELDO_ORIGINAL); item.ICONO = ObtenerIconoDifrencia(item.DIFERENCIA, item.MN_SUELDO_ORIGINAL); item.DIFERENCIA_NUEVO = CalculoPrDiferencia(item.MN_MINIMO_CUARTIL, item.MN_MAXIMO_CUARTIL, item.MN_SUELDO_NUEVO); item.COLOR_DIFERENCIA_NUEVO = VariacionColor(item.DIFERENCIA_NUEVO, item.MN_SUELDO_NUEVO); item.ICONO_NUEVO = ObtenerIconoDifrencia(item.DIFERENCIA_NUEVO, item.MN_SUELDO_NUEVO); } }
private DataTable GetAllowance(out string errorMsg) { errorMsg = string.Empty; DataTable dt = GetGridAllowance(); try { RadNumericTextBox rntbDependent, rntbEligible; foreach (GridDataItem d in RG_Allowance.Items) { rntbDependent = new RadNumericTextBox(); rntbEligible = new RadNumericTextBox(); rntbDependent = d.FindControl("rntbDependent") as RadNumericTextBox; rntbEligible = d.FindControl("rntbEligible") as RadNumericTextBox; dt.Rows.Add(Convert.ToInt32(Session["ORG_ID"]), Convert.ToInt32(rcmb_FromPeriod.SelectedValue), Convert.ToInt32(d.Cells[3].Text), rntbDependent.Text, rntbEligible.Text, valID, payItemID); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Allowance", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } return(dt); }
// client side function to validate expat form input public void ValidateExpatriate(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadNumericTextBox txtEsngfrm = (editForm.FindControl("txtEsngfrm") as RadNumericTextBox); RadNumericTextBox txtBxEsngtoo = (editForm.FindControl("txtBxEsngtoo") as RadNumericTextBox); RadNumericTextBox txtBxEmarfrm = (editForm.FindControl("txtBxEmarfrm") as RadNumericTextBox); RadNumericTextBox txtBxEmartoo = (editForm.FindControl("txtBxEmartoo") as RadNumericTextBox); RadComboBox ddlEGrade = (editForm.FindControl("ddlEGrade") as RadComboBox); if (update != null) { update.Attributes.Add("onclick", "return ValidateExpatriate('" + txtEsngfrm.ClientID + "','" + txtBxEsngtoo.ClientID + "','" + txtBxEmarfrm.ClientID + "','" + txtBxEmartoo.ClientID + "','" + ddlEGrade.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidateExpatriate('" + txtEsngfrm.ClientID + "','" + txtBxEsngtoo.ClientID + "','" + txtBxEmarfrm.ClientID + "','" + txtBxEmartoo.ClientID + "','" + ddlEGrade.ClientID + "')"); } }
private DataTable GetGadeWiseAMount() { DataTable dt = new DataTable(); try { dt.Columns.Add("EMPLOYEEGRADE_ID", typeof(string)); dt.Columns.Add("MEDICALBENFIT_MAXAMOUNT", typeof(string)); Label lID; RadNumericTextBox tAmount; foreach (GridDataItem d in RadGrid1.Items) { lID = new Label(); tAmount = new RadNumericTextBox(); lID = d.FindControl("lbl_EMPLOYEEGRADE_ID") as Label; tAmount = d.FindControl("txt_MEDICALBENFIT_MAXAMOUNT") as RadNumericTextBox; dt.Rows.Add(lID.Text, tAmount.Text); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_MaxLoanEligibility", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } return(dt); }
// client side function for calender master form input public void ValidateCalender(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadTextBox txtcalcode = (editForm.FindControl("txtcalcode") as RadTextBox); RadTextBox txtcaldsc = (editForm.FindControl("txtcaldsc") as RadTextBox); RadComboBox ddlBasedOn = (editForm.FindControl("ddlBasedOn") as RadComboBox); RadComboBox ddlDaysRounding = (editForm.FindControl("ddlDaysRounding") as RadComboBox); RadNumericTextBox txtgrtsom = (editForm.FindControl("txtgrtsom") as RadNumericTextBox); RadNumericTextBox txtBxgrtamt = (editForm.FindControl("txtBxgrtamt") as RadNumericTextBox); if (update != null) { update.Attributes.Add("onclick", "return ValidateCalender('" + txtcalcode.ClientID + "','" + txtcaldsc.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidateCalender('" + txtcalcode.ClientID + "','" + txtcaldsc.ClientID + "')"); } }
protected void txtId_TextChanged(object sender, EventArgs e) { try { Sesion sesion = (Sesion)Session["Sesion" + Session.SessionID]; RadNumericTextBox cmbProd = sender as RadNumericTextBox; Producto prd = new Producto(); CN_CatProducto cnProducto = new CN_CatProducto(); int id_prd = Convert.ToInt32(cmbProd.Value.HasValue ? cmbProd.Value.Value : -1); try { cnProducto.ConsultaProducto(ref prd, sesion.Emp_Cnx, sesion.Id_Emp, sesion.Id_Cd_Ver, id_prd); } catch (Exception ex) { AlertaFocus(ex.Message, (sender as RadNumericTextBox).ClientID); (cmbProd.Parent.FindControl("txtDescripcion") as RadTextBox).Text = ""; (sender as RadNumericTextBox).Text = ""; return; } (cmbProd.Parent.FindControl("txtDescripcion") as RadTextBox).Text = prd.Prd_Descripcion; } catch (Exception) { throw; } }
protected void txtIdPrd_TextChanged(object sender, EventArgs e) { try { Sesion sesion = (Sesion)Session["Sesion" + Session.SessionID]; RadNumericTextBox combo = (RadNumericTextBox)sender; CN_CatProducto clsProducto = new CN_CatProducto(); Producto producto = new Producto(); producto.Id_Prd = Convert.ToInt32((sender as RadNumericTextBox).Value.HasValue ? (sender as RadNumericTextBox).Value : -1); clsProducto.ConsultaProducto(ref producto, sesion.Emp_Cnx, sesion.Id_Emp, producto.Id_Prd, sesion.Id_Cd_Ver, Convert.ToInt32(combo.Value)); if (producto.Prd_Descripcion != null) { txtProducto.Text = producto.Prd_Descripcion; txtProducto.Focus(); } else { txtProducto.Text = ""; Alerta("El Producto no existe o esta inactivo"); } } catch (Exception ex) { ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name); } }
protected void rgDetalles_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) { GridEditableItem editItem = (GridEditableItem)e.Item; this.rgDetalles.Columns.FindByUniqueName("EditCommandColumn").Visible = true; RadComboBox rcmbFac = editItem.FindControl("rcbSerie") as RadComboBox; RadNumericTextBox txtFact = editItem.FindControl("txtFact") as RadNumericTextBox; new CN__Comun().LlenaCombo(sesion.Id_Emp, sesion.Id_Cd_Ver, sesion.Emp_Cnx, "spConsecutivos_Combo", ref rcmbFac); Control insertbtn = (Control)editItem.FindControl("PerformInsertButton"); if (insertbtn != null) { txtFact.Enabled = true; (e.Item.FindControl("txtFact") as RadNumericTextBox).Enabled = true; } } else if (e.Item.IsDataBound) { GridDataItem item = (GridDataItem)e.Item; item["EditCommandColumn"].Controls[0].Visible = false; } //TODO: AGREGAR PARA PONER EL FOCUS if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem form = (GridEditableItem)e.Item; RadNumericTextBox dataField = (RadNumericTextBox)form["Factura"].FindControl("txtFact"); dataField.Focus(); } }
protected void btnPalletMove_Click(object sender, EventArgs e) { Button btnPalletMove = sender as Button; int listItemIndex = int.Parse(btnPalletMove.Attributes["ListItemIndex"]); int sourceResourceID = int.Parse(btnPalletMove.Attributes["ResourceID"]); int targetResourceID = -1; RadComboBox rcbAlternateResources = lvEmptyPallets.Items[listItemIndex].FindControl("rcbAlternateResources") as RadComboBox; ListView lvItems = lvEmptyPallets.Items[listItemIndex].FindControl("lvItems") as ListView; targetResourceID = int.Parse(rcbAlternateResources.SelectedValue); IList <KeyValuePair <int, int> > palletTypeCount = new List <KeyValuePair <int, int> >(); foreach (ListViewDataItem lvdi in lvItems.Items) { HiddenField hdnPalletType = lvdi.FindControl("hdnPalletType") as HiddenField; RadNumericTextBox rntNoOfPallets = lvdi.FindControl("rntNoOfPallets") as RadNumericTextBox; int palletTypeID = int.Parse(hdnPalletType.Value); int palletCount = (int)rntNoOfPallets.Value; palletTypeCount.Add(new KeyValuePair <int, int>(palletTypeID, palletCount)); } Facade.IPalletBalance facPalletBalance = new Facade.Pallet(); if (facPalletBalance.MovePalletsFromSourcetoTargetResource(m_job.JobId, sourceResourceID, targetResourceID, palletTypeCount, ((Entities.CustomPrincipal)Page.User).UserName)) { ConfigureDisplay(); } }
protected void btn_guardar_Click(object sender, EventArgs e) { lbl_msj.Text = ""; try { icompany = Convert.ToInt32(this.Session["companyid"]); sUser = this.Session["sUser"].ToString(); for (int i = 0; i < gv_RangoDG.Items.Count; i++) { GridItem item = gv_RangoDG.Items[i]; RadNumericTextBox txt_min_dg_xplora = item.FindControl("txt_min_dg_xplora") as RadNumericTextBox; RadNumericTextBox txt_max_dg_xplora = item.FindControl("txt_max_dg_xplora") as RadNumericTextBox; RadNumericTextBox txt_min_dg_cliente = item.FindControl("txt_min_dg_cliente") as RadNumericTextBox; RadNumericTextBox txt_max_dg_cliente = item.FindControl("txt_max_dg_cliente") as RadNumericTextBox; Label lbl_id_ProductCategory = item.FindControl("lbl_id_ProductCategory") as Label; Label lbl_id_ReportsPlanning = item.FindControl("lbl_id_ReportsPlanning") as Label; oCoon.ejecutarDataReader("UP_WEBXPLORA_CLIE_V2_INSERT_UPDATE_RANGO_DIASGIRO_BYPERIODO", icompany, lbl_id_ProductCategory.Text.Trim(), lbl_id_ReportsPlanning.Text.Trim(), txt_min_dg_xplora.DbValue, txt_max_dg_xplora.DbValue, txt_min_dg_cliente.DbValue, txt_max_dg_cliente.DbValue, sUser, DateTime.Now, sUser, DateTime.Now); lbl_msj.ForeColor = System.Drawing.Color.Green; lbl_msj.Text = "El cambio se guardo con exito"; } } catch (Exception ex) { ex.Message.ToString(); lbl_msj.ForeColor = System.Drawing.Color.Red; lbl_msj.Text = "Ocurrió un error, intentelo más tarde. Gracias"; } }
protected void cbSpecVal_CheckedChanged(object sender, EventArgs e) { CheckBox cbSpecVal = sender as CheckBox; GridEditFormItem.EditFormTableCell editForm = cbSpecVal.Parent as GridEditFormItem.EditFormTableCell; RadNumericTextBox txtfromval = (editForm.FindControl("txtfromval") as RadNumericTextBox); RadNumericTextBox txttoval = (editForm.FindControl("txttoval") as RadNumericTextBox); RequiredFieldValidator RFVtxtfromval = (editForm.FindControl("RFVtxtfromval") as RequiredFieldValidator); RequiredFieldValidator RFVtxttoval = (editForm.FindControl("RFVtxttoval") as RequiredFieldValidator); if (cbSpecVal.Checked) { txtfromval.Enabled = true; txttoval.Enabled = true; RFVtxtfromval.Enabled = true; RFVtxttoval.Enabled = true; } else { txtfromval.Enabled = false; txttoval.Enabled = false; //txtfromval.Text = ""; //txttoval.Text = ""; RFVtxtfromval.Enabled = false; RFVtxttoval.Enabled = false; } }
protected void rntxt_TextChanged(object sender, EventArgs e) { try { //int previous = 0; RadNumericTextBox rntxt_value = sender as RadNumericTextBox; string s = Convert.ToString(rntxt_value.ID); TextBox txt_Total = new TextBox(); GridDataItem item; item = rntxt_value.Parent.Parent.Parent.Parent as GridDataItem; DataList dlst = item.FindControl("dlTxtBox") as DataList; int count = dlst.Controls.Count - 1; txt_Total = dlst.Controls[count].FindControl("txtTotal") as TextBox; int sum = 0; RadNumericTextBox rntxtsum = new RadNumericTextBox(); for (int txtbxcount = 0; txtbxcount < dlst.Items.Count; txtbxcount++) { if ((dlst.Items[txtbxcount].FindControl("rntxt") as RadNumericTextBox).Text != string.Empty) { rntxtsum.Text = (dlst.Items[txtbxcount].FindControl("rntxt") as RadNumericTextBox).Text; sum += Convert.ToInt32(rntxtsum.Text); } } txt_Total.Text = Convert.ToString(sum); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Empcomponents", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void grdDocVentaDetalle_ItemCreated(object sender, GridItemEventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("~/Security/frmCerrar.aspx"); } try { if (e.Item is GridDataItem) { RadNumericTextBox txtPrecio = (RadNumericTextBox)e.Item.FindControl("txtPrecio"); txtPrecio.Attributes["href"] = "javascript:void(0);"; RadNumericTextBox txtCantidad = (RadNumericTextBox)e.Item.FindControl("txtCantidad"); txtCantidad.Attributes["href"] = "javascript:void(0);"; txtPrecio.Attributes["onkeyup"] = String.Format("return CalcularDevolucion('{0}');", e.Item.ItemIndex); txtCantidad.Attributes["onkeyup"] = String.Format("return CalcularDevolucion('{0}');", e.Item.ItemIndex); } } catch (Exception ex) { lblMensaje.Text = ex.Message; lblMensaje.CssClass = "mensajeError"; } }
public string InsXMLBenefit() { string XmlData = ""; if (Benefits.Items.Count != 0) { StringBuilder XMLBenefit = new StringBuilder(); XMLBenefit.Append("<Root>"); foreach (GridDataItem dataItem in Benefits.Items) { CheckBox Chk = (CheckBox)dataItem.FindControl("Chk"); if (Chk.Checked) { Label id = (Label)dataItem.FindControl("lblBenefitID"); RadNumericTextBox ndate = (RadNumericTextBox)dataItem.FindControl("Eligibility"); XMLBenefit.Append("<Benefit"); XMLBenefit.Append(" BenefitID=\""); XMLBenefit.Append(id.Text + "\""); XMLBenefit.Append(" Eligibility=\""); XMLBenefit.Append(ndate.Text + "\""); XMLBenefit.Append("/>"); } } XMLBenefit.Append("</Root>"); XmlData = XMLBenefit.ToString(); } if (XmlData == "<Root></Root>") { XmlData = ""; } return(XmlData); }
protected void cbSpecVal_CheckedChanged(object sender, EventArgs e) { CheckBox cbSpecVal = sender as CheckBox; GridEditFormItem editForm = cbSpecVal.NamingContainer as GridEditFormItem; Label lblfromval = (editForm.FindControl("lblfromval") as Label); Label lbltoval = (editForm.FindControl("lbltoval") as Label); RadNumericTextBox txtfromval = (editForm.FindControl("txtfromval") as RadNumericTextBox); RadNumericTextBox txttoval = (editForm.FindControl("txttoval") as RadNumericTextBox); RequiredFieldValidator RFVtxtfromval = (editForm.FindControl("RFVtxtfromval") as RequiredFieldValidator); RequiredFieldValidator RFVtxttoval = (editForm.FindControl("RFVtxttoval") as RequiredFieldValidator); if (cbSpecVal.Checked) { lblfromval.Visible = true; lbltoval.Visible = true; txtfromval.Visible = true; txttoval.Visible = true; RFVtxtfromval.Enabled = true; RFVtxttoval.Enabled = true; } else { lblfromval.Visible = false; lbltoval.Visible = false; txtfromval.Visible = false; txttoval.Visible = false; RFVtxtfromval.Enabled = false; RFVtxttoval.Enabled = false; } }
protected void cmbProductoDet_TextChanged(object sender, EventArgs e) { RadNumericTextBox txtProd = sender as RadNumericTextBox; CN_CatClienteMatriz cm_Matriz = (CN_CatClienteMatriz)Session["cm_Matriz"]; var prd = cm_Matriz.ConsultaProductoInfo(Convert.ToInt32(txtProd.Value)); (txtProd.Parent.FindControl("txtDescripcion") as RadTextBox).Text = prd.Prd_Descripcion; if (txtProd.Parent.FindControl("txtUnidad") != null) { (txtProd.Parent.FindControl("txtUnidad") as Label).Text = prd.Prd_UniNs; } if (txtProd.Parent.FindControl("txtPresentacion") != null) { (txtProd.Parent.FindControl("txtPresentacion") as Label).Text = prd.Prd_Presentacion; } Boolean EsGarantia = false; if (!EsGarantia) { (txtProd.Parent.FindControl("dblPrecio") as RadNumericTextBox).Focus(); } else { (txtProd.Parent.FindControl("dblPrecio") as RadNumericTextBox).DbValue = 0.00; (txtProd.Parent.FindControl("txtCantidad") as RadNumericTextBox).Focus(); } // ConsultaProductoInfo }
protected void Benefits_DataBound(object sender, EventArgs e) { if (Session["Sid"] != null && Session["Sid"].ToString() != "0") { DataSet ds = Repository.Shops.Select_ShopBenefits(Session["Sid"].ToString()); if (ds.Tables[0].Rows.Count > 0) { foreach (GridDataItem Item in Benefits.Items) { CheckBox Chk = (CheckBox)Item.FindControl("Chk"); Label id = (Label)Item.FindControl("lblBenefitID"); RadNumericTextBox ndate = (RadNumericTextBox)Item.FindControl("Eligibility"); for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { if (id.Text == ds.Tables[0].Rows[i]["BenefitID"].ToString()) { Chk.Checked = true; ndate.Text = ds.Tables[0].Rows[i]["Eligibility"].ToString(); break; } else { Chk.Checked = false; ndate.Text = ""; } } } } } }
protected void rgTransInProd_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadComboBox cmbprodhdr = (RadComboBox)item.FindControl("RadCmbProdHdr"); RadComboBox cmbtranshdr = (RadComboBox)item.FindControl("RadCmbTransHdr"); RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadNumericTextBox amt = (RadNumericTextBox)item.FindControl("amount"); string transcode = cmbtranshdr.SelectedValue; string prodcode = cmbprodhdr.SelectedValue; int amount = Convert.ToInt32(amt.Text); string codes = code.Text; if (transcode == "") { ShowMessage("Transaction Information Cannot be empty"); return; } if (prodcode == "") { ShowMessage("Product Information Cannot be empty"); return; } if (amount == 0) { ShowMessage("Product Amount Cannot be empty"); return; } update(prodcode, transcode, amount, codes); }
protected void gv_sod_RowUpdating(object sender, GridViewUpdateEventArgs e) { Conexion Ocoon = new Conexion(); try { GridViewRow row = gv_SOD.Rows[gv_SOD.EditIndex]; Label lbl_id_rpsd = (Label)row.FindControl("lbl_id_rpsd"); RadNumericTextBox txt_gvsod_Exhib_Primaria = (RadNumericTextBox)row.FindControl("txt_gvsod_Exhib_Primaria"); RadNumericTextBox txt_gvsod_Exhib_Secundaria = (RadNumericTextBox)row.FindControl("txt_gvsod_Exhib_Secundaria"); RadDateTimePicker RadDateTimePicker_fec_reg = (RadDateTimePicker)row.FindControl("RadDateTimePicker_fec_reg"); Ocoon.ejecutarDataReader("UP_WEBXPLORA_OPE_ACTUALIZAR_REPORTE_SOD_DETALLE_EXIBICION", lbl_id_rpsd.Text.Trim(), txt_gvsod_Exhib_Primaria.DbValue, txt_gvsod_Exhib_Secundaria.DbValue, RadDateTimePicker_fec_reg.DbSelectedDate, Session["sUser"].ToString(), DateTime.Now); gv_SOD.EditIndex = -1; cargarGrilla_SOD(); } catch (Exception ex) { ex.Message.ToString(); Response.Redirect("~/err_mensaje_seccion.aspx", true); } }
public void SetAdvancedPagerStyle(GridPagerItem item) { //Traduce el Pager del RadGrid y asigna tooltips Label goToPageLabel = item.FindControl("GoToPageLabel") as Label; Label pageOfLabel = item.FindControl("PageOfLabel") as Label; RadNumericTextBox changePageSizeTextBox = item.FindControl("ChangePageSizeTextBox") as RadNumericTextBox; RadNumericTextBox goToPageTextBox = item.FindControl("GoToPageTextBox") as RadNumericTextBox; Button goToPageLinkButton = item.FindControl("GoToPageLinkButton") as Button; Button changePageSizeLinkButton = item.FindControl("ChangePageSizeLinkButton") as Button; if (goToPageLabel != null) goToPageLabel.Text = "Página:"; if (pageOfLabel != null) pageOfLabel.Text = "de " + item.Paging.PageCount.ToString(string.Format("n0")); if (changePageSizeTextBox != null) { changePageSizeTextBox.MaxValue = 1000; changePageSizeTextBox.Attributes.Add("data-toggle", "tooltip"); } if (goToPageTextBox != null) goToPageTextBox.Attributes.Add("data-toggle", "tooltip"); if (goToPageLinkButton != null) { goToPageLinkButton.Text = "Ver"; goToPageLinkButton.CssClass = changePageSizeLinkButton.CssClass = "btn btn-primary btn-sm"; goToPageLinkButton.Attributes.Add("data-toggle", "tooltip"); } if (changePageSizeLinkButton != null) { changePageSizeLinkButton.Text = "Cambiar"; changePageSizeLinkButton.Attributes.Add("data-toggle", "tooltip"); } }
private void parseDocsCode(int Order, DataRow drDetail, ref System.Web.UI.HtmlControls.HtmlGenericControl divDocsCode, ref RadComboBox cbDocsCode , ref RadNumericTextBox tbNoOfOriginals, ref RadNumericTextBox tbNoOfCopies) { string DocsCode = drDetail["DocsCode" + Order].ToString(); divDocsCode.Visible = !string.IsNullOrEmpty(DocsCode); if (divDocsCode.Visible) { cbDocsCode.SelectedValue = DocsCode; if (drDetail["NoOfOriginals" + Order] != DBNull.Value) tbNoOfOriginals.Value = Convert.ToInt32(drDetail["NoOfOriginals" + Order]); if (drDetail["NoOfCopies" + Order] != DBNull.Value) tbNoOfCopies.Value = Convert.ToInt32(drDetail["NoOfCopies" + Order]); } }
private void setDocsCodeData(DataRow drDetail, int stt, ref RadComboBox cboDocsCode, ref RadNumericTextBox txtNumOfOriginals, ref RadNumericTextBox txtNumOfCopies, ref RadTextBox txtOtherDocs) { cboDocsCode.SelectedValue = drDetail["DocsCode" + stt].ToString(); if (drDetail["NoOfOriginals" + stt] != DBNull.Value) txtNumOfOriginals.Value = Convert.ToDouble(drDetail["NoOfOriginals" + stt]); if (drDetail["NoOfCopies" + stt] != DBNull.Value) txtNumOfCopies.Value = Convert.ToDouble(drDetail["NoOfCopies" + stt]); if (drDetail["OtherDocs" + stt] != DBNull.Value) txtOtherDocs.Text = drDetail["OtherDocs" + stt].ToString(); switch (stt) { case 1: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 2: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 3: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; } }
private void parseTabCharge(DataRow drDetail, ref RadComboBox cbChargeCode, ref RadComboBox cbChargeCcy, ref RadComboBox cbChargeAcct , ref RadNumericTextBox tbChargeAmt, ref RadComboBox cbPartyCharged, ref RadComboBox cbOmortCharges , ref System.Web.UI.WebControls.Label lblTaxCode, ref System.Web.UI.WebControls.Label lblTaxAmt) { cbChargeCode.SelectedValue = drDetail["Chargecode"].ToString(); cbChargeCcy.SelectedValue = drDetail["ChargeCcy"].ToString(); LoadChargeAcct(hiddenCustomerName.Value, cbChargeCcy.SelectedValue, ref cbChargeAcct); cbChargeAcct.SelectedValue = drDetail["ChargeAcct"].ToString(); if (drDetail["ChargeAmt"] != DBNull.Value) tbChargeAmt.Value = Convert.ToInt32(drDetail["ChargeAmt"]); cbPartyCharged.SelectedValue = drDetail["PartyCharged"].ToString(); cbOmortCharges.SelectedValue = drDetail["OmortCharges"].ToString(); lblTaxCode.Text = drDetail["TaxCode"].ToString(); if (drDetail["TaxAmt"] != DBNull.Value) lblTaxAmt.Text = drDetail["TaxAmt"].ToString(); }
private void loadLCDocsCode(string DocsCode, int? NoOfOriginals, int? NoOfCopies, string OtherDocs, ref RadComboBox rcbDocsCode, ref RadNumericTextBox txtNoOfOriginals, ref RadNumericTextBox txtNoOfCopies/*, ref RadTextBox txtOtherDocs*/) { rcbDocsCode.SelectedValue = DocsCode; txtNoOfOriginals.Value = NoOfOriginals; txtNoOfCopies.Value = NoOfCopies; //txtOtherDocs.Text = OtherDocs; }
private void setDocsCodeData(BEXPORT_DOCUMENTPROCESSING dsDetail, int stt, ref RadComboBox cboDocsCode, ref RadNumericTextBox txtNumOfOriginals, ref RadNumericTextBox txtNumofCopies, ref RadTextBox txtOtherDocs) { cboDocsCode.SelectedValue = dsDetail.DocsCode1; if (stt == 1) { if (dsDetail.NoOfOriginals1 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals1); } if (dsDetail.OtherDocs1 != null) { txtOtherDocs.Text = dsDetail.OtherDocs1; } } else if (stt == 2) { if (dsDetail.NoOfOriginals2 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals2); } if (dsDetail.OtherDocs2 != null) { txtOtherDocs.Text = dsDetail.OtherDocs2; } } else if (stt == 3) { if (dsDetail.NoOfOriginals3 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals3); } if (dsDetail.OtherDocs3 != null) { txtOtherDocs.Text = dsDetail.OtherDocs3; } } switch (stt) { case 1: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 2: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 3: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; } }
/// <summary> /// Sets the initial values of the controls for a date range bound. /// </summary> /// <param name="bound">The bound to load</param> /// <param name="rangeBoundList">The main range bound list.</param> /// <param name="specificDatePicker">The picker for the specific date.</param> /// <param name="windowAmountTextBox">The text box for the window amount.</param> /// <param name="windowIntervalList">The window interval list.</param> private void LoadBoundSettings(DateRangeBound bound, ListControl rangeBoundList, RadDatePicker specificDatePicker, RadNumericTextBox windowAmountTextBox, ListControl windowIntervalList) { Utility.LocalizeListControl(rangeBoundList, this.LocalResourceFile); Utility.LocalizeListControl(windowIntervalList, this.LocalResourceFile); SelectListValue(rangeBoundList, DateRangeBoundJsonTransferObject.GetListValueForBound(bound)); if (bound.IsSpecificDate) { specificDatePicker.SelectedDate = bound.SpecificDate; } else if (bound.IsWindow) { windowAmountTextBox.Value = bound.WindowAmount; SelectListValue(windowIntervalList, bound.WindowInterval.Value.ToString()); } }
public void AddNewRow() { DataSet dst = DataProvider.KhanhND.B_BDYNAMICCONTROLS_Update("0", Request.QueryString["tabid"].ToString(), this.ID.ToString(), "", "", Session["DataKey"].ToString()); Label lb = new Label(); lb.ID = "lbl" + dst.Tables[0].Rows[0]["DataControlID"].ToString(); lb.Text = VVTLabel; RadNumericTextBox tb = new RadNumericTextBox(); tb.ID = "txtName" + dst.Tables[0].Rows[0]["DataControlID"].ToString(); tb.AutoPostBack = true; tb.TextChanged += tb_TextChanged; tb.Text = ""; tb.Width = Unit.Parse(Width); if (OnBlur != "") tb.Attributes.Add("onblur", OnBlur + "(this,'" + this.ID + "');"); ImageButton ibt = new ImageButton(); ibt.ID = "ibt" + dst.Tables[0].Rows[0]["DataControlID"].ToString(); IbtId = ibt.ID; ibt.ImageUrl = "~/Icons/Sigma/Delete_16X16_Standard.png"; ibt.Click += ibt_Click; TableRow tr = new TableRow(); tr.ID = dst.Tables[0].Rows[0]["DataControlID"].ToString(); TableCell tc = new TableCell(); tc.CssClass = "MyLable"; tc.Controls.Add(lb); tc.Width = Unit.Parse(LBWidth); TableCell tc2 = new TableCell(); tc2.CssClass = "MyContent"; tc2.Width = Unit.Parse(Width); tc2.Controls.Add(tb); TableCell tc3 = new TableCell(); tc3.Controls.Add(ibt); tr.Cells.Add(tc); tr.Cells.Add(tc2); if (Icon) tr.Cells.Add(tc3); if (tblMain == null) tblMain = new Table(); tblMain.Rows.Add(tr); }
private void loadCharge(DataRow drCharge, ref RadComboBox cboChargeCode, ref RadComboBox cboChargeCcy, ref RadComboBox cboChargeAcc, ref RadNumericTextBox txtChargeAmt , ref RadComboBox cboPartyCharged, ref RadComboBox cboAmortCharge, ref RadTextBox txtTaxCode, ref RadNumericTextBox txtTaxAmt) { cboChargeCode.SelectedValue = drCharge["ChargeCode"].ToString(); cboChargeCcy.SelectedValue = drCharge["ChargeCcy"].ToString(); cboPartyCharged.SelectedValue = drCharge["PartyCharged"].ToString(); //bc.Commont.initRadComboBox(ref cboChargeAcc, "Display", "Id", bd.SQLData.B_BDRFROMACCOUNT_GetByCurrency(txtCustomerName.Value, cboChargeCcy.SelectedValue)); loadChargeAcc(cboPartyCharged.SelectedValue, cboChargeCcy.SelectedValue, ref cboChargeAcc); cboChargeAcc.SelectedValue = drCharge["ChargeAcct"].ToString(); if (drCharge["ChargeAmt"] != DBNull.Value) txtChargeAmt.Value = Convert.ToDouble(drCharge["ChargeAmt"]); cboAmortCharge.SelectedValue = drCharge["AmortCharge"].ToString(); txtTaxCode.Text = drCharge["TaxCode"].ToString(); if (drCharge["TaxAmt"] != DBNull.Value) txtTaxAmt.Value = Convert.ToDouble(drCharge["TaxAmt"]); }
private void LoadControls() { ds = BankProject.DataProvider.KhanhND.B_BDYNAMICCONTROLS_GetControls(Request.QueryString["tabid"].ToString(), this.ID.ToString(), Session["DataKey"].ToString()); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (i > 0) { Label lb = new Label(); lb.ID = "lbl" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); lb.Text = VVTLabel; RadNumericTextBox tb = new RadNumericTextBox(); tb.ID = "txtName" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); tb.AutoPostBack = true; tb.TextChanged += tb_TextChanged; tb.Text = ds.Tables[0].Rows[i]["Datavalue"].ToString(); tb.Width = Unit.Parse(Width); if (OnBlur != "") tb.Attributes.Add("onblur", OnBlur + "(this,'" + this.ID + "');"); ImageButton ibt = new ImageButton(); ibt.ID = "ibt" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); IbtId = ibt.ID; ibt.ImageUrl = "~/Icons/Sigma/Delete_16X16_Standard.png"; ibt.Click += ibt_Click; TableRow tr = new TableRow(); tr.ID = ds.Tables[0].Rows[i]["DataControlID"].ToString(); TableCell tc = new TableCell(); tc.CssClass = "MyLable"; tc.Controls.Add(lb); tc.Width = Unit.Parse(LBWidth); TableCell tc2 = new TableCell(); tc2.CssClass = "MyContent"; tc2.Width = Unit.Parse(Width); tc2.Controls.Add(tb); TableCell tc3 = new TableCell(); tc3.Controls.Add(ibt); tr.Cells.Add(tc); tr.Cells.Add(tc2); if (Icon) tr.Cells.Add(tc3); if (tblMain == null) tblMain = new Table(); tblMain.Rows.Add(tr); } else { Label lb = new Label(); lb.ID = "lbl" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); lb.Text = VVTLabel; RadNumericTextBox tb = new RadNumericTextBox(); tb.ID = "txtName" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); tb.AutoPostBack = true; tb.TextChanged += tb_TextChanged; if (VVText != "" && ds.Tables[0].Rows.Count == 1 && ds.Tables[0].Rows[i]["Datavalue"].ToString() == "") tb.Text = VVText; else tb.Text = ds.Tables[0].Rows[i]["Datavalue"].ToString(); tb.Width = Unit.Parse(Width); if (OnBlur != "") tb.Attributes.Add("onblur", OnBlur + "(this,'" + this.ID + "');"); tb.Enabled = Enabled; ImageButton ibt = new ImageButton(); ibt.ID = "ibt" + ds.Tables[0].Rows[i]["DataControlID"].ToString(); IbtId = ibt.ID; ibt.ImageUrl = "~/Icons/Sigma/Add_16X16_Standard.png"; ibt.Click += ibtVVT_Click; ibt.Enabled = Enabled; TableRow tr = new TableRow(); tr.ID = ds.Tables[0].Rows[i]["DataControlID"].ToString(); TableCell tc = new TableCell(); tc.CssClass = "MyLable"; tc.Controls.Add(lb); tc.Width = Unit.Parse(LBWidth); TableCell tc2 = new TableCell(); tc2.CssClass = "MyContent"; tc2.Width = Unit.Parse(Width); tc2.Controls.Add(tb); TableCell tc3 = new TableCell(); tc3.Controls.Add(ibt); tr.Cells.Add(tc); tr.Cells.Add(tc2); if (Icon) tr.Cells.Add(tc3); if (tblMain == null) tblMain = new Table(); tblMain.Rows.Add(tr); } } }
private void BindConfigForm() { ArrayList foldersToShow = new ArrayList(); ArrayList folders = new ArrayList(); folders = DotNetNuke.Common.Utilities.FileSystemUtils.GetFoldersByUser(PortalSettings.PortalId, true, true, "READ"); plhConfig.Controls.Clear(); Panel pnlContent = new Panel(); pnlContent.CssClass = "pcContent"; HtmlGenericControl fsContent = null; int i = 0; foreach (ConfigInfo objConfig in DefaultConfig) { string key = objConfig.Key; string value = objConfig.Value; if (objConfig.IsSeparator) { if (i > 0) { // it's currently a separator, so if its not the first item it needs to close the previous 'feildset' pnlContent.Controls.Add(fsContent); } i += 1; var localizedTitle = Localization.GetString(key + ".Title", LocalResourceFile); if (string.IsNullOrEmpty(localizedTitle)) { localizedTitle = key; } pnlContent.Controls.Add(new LiteralControl("<h2 id='Panel-ProviderConfig-" + i.ToString() + "' class='dnnFormSectionHead'><a class='dnnSectionExpanded' href=\"\">" + localizedTitle + "</a></h2>")); fsContent = new HtmlGenericControl("fieldset"); } else { Panel pnlRow = new Panel(); // a row starts here and ends at the right before next, where it is added to the fieldset) pnlRow.CssClass = "dnnFormItem"; pnlRow.Controls.Add(BuildLabel(key)); switch (key.ToLower()) { case "stripformattingoptions": { CheckBoxList ctl = new CheckBoxList(); ctl.ID = "ctl_rc_" + key; ctl.RepeatColumns = 2; ctl.CssClass = "dnnCBItem"; foreach (string objEnum in Enum.GetNames(typeof(Telerik.Web.UI.EditorStripFormattingOptions))) { if (objEnum != "All" && objEnum != "None") { ctl.Items.Add(new ListItem(objEnum, objEnum)); } } pnlRow.Controls.Add(ctl); break; } case "toolbarmode": { RadioButtonList ctl = new RadioButtonList(); ctl.ID = "ctl_rc_" + key; ctl.RepeatColumns = 2; ctl.CssClass = "dnnFormRadioButtons"; foreach (string objEnum in Enum.GetNames(typeof(Telerik.Web.UI.EditorToolbarMode))) { ctl.Items.Add(new ListItem(objEnum, objEnum)); } pnlRow.Controls.Add(ctl); break; } case "editmodes": { CheckBoxList ctl = new CheckBoxList(); ctl.ID = "ctl_rc_" + key; ctl.RepeatColumns = 1; ctl.CssClass = "dnnCBItem"; foreach (string objEnum in Enum.GetNames(typeof(Telerik.Web.UI.EditModes))) { if (objEnum != "All") { ctl.Items.Add(new ListItem(objEnum, objEnum)); } } pnlRow.Controls.Add(ctl); break; } case "contentfilters": { CheckBoxList ctl = new CheckBoxList(); ctl.ID = "ctl_rc_" + key; ctl.RepeatColumns = 2; ctl.CssClass = "dnnCBItem"; foreach (string objEnum in Enum.GetNames(typeof(Telerik.Web.UI.EditorFilters))) { if (objEnum != "None" && objEnum != "DefaultFilters") { ctl.Items.Add(new ListItem(objEnum, objEnum)); } } pnlRow.Controls.Add(ctl); break; } case "imagespath": case "mediapath": case "documentspath": case "flashpath": case "silverlightpath": case "templatepath": { DropDownList ctl = new DropDownList(); ctl.ID = "ctl_rc_" + key; //ctl.Width = Unit.Pixel(253) ctl.Items.Clear(); foreach (FolderInfo oFolder in folders) { if (!(oFolder.FolderPath.ToLower().StartsWith("cache"))) { if (oFolder.FolderPath == "") { ctl.Items.Add(new ListItem(Localization.GetString("PortalRoot", LocalResourceFile), "/")); } else { ctl.Items.Add(new ListItem(oFolder.FolderPath, oFolder.FolderPath)); } } } pnlRow.Controls.Add(ctl); break; } case "skin": { DropDownList ctl = new DropDownList(); ctl.ID = "ctl_rc_" + key; ctl.Items.Add(new ListItem("Default", "Default")); ctl.Items.Add(new ListItem("Black", "Black")); ctl.Items.Add(new ListItem("Sunset", "Sunset")); ctl.Items.Add(new ListItem("Hay", "Hay")); ctl.Items.Add(new ListItem("Forest", "Forest")); ctl.Items.Add(new ListItem("Vista", "Vista")); pnlRow.Controls.Add(ctl); break; } case "enableresize": case "linksusetabnames": case "allowscripts": case "showportallinks": case "autoresizeheight": case "linksuserelativeurls": case "newlinebr": { CheckBox ctl = new CheckBox(); ctl.ID = "ctl_rc_" + key; ctl.CssClass = "dnnCBItem"; pnlRow.Controls.Add(ctl); break; } case "borderwidth": case "height": case "width": case "toolswidth": { RadNumericTextBox ctl = new RadNumericTextBox(); ctl.MinValue = 0; ctl.Type = NumericType.Number; ctl.ShowSpinButtons = true; ctl.IncrementSettings.Step = 1; ctl.NumberFormat.DecimalDigits = 0; ctl.NumberFormat.GroupSeparator = ""; ctl.NumberFormat.GroupSizes = 9; ctl.ID = "ctl_rc_" + key; ctl.Width = Unit.Pixel(255); pnlRow.Controls.Add(ctl); break; } case "maxflashsize": case "maxsilverlightsize": case "maxtemplatesize": case "maximagesize": case "maxdocumentsize": case "maxmediasize": { RadNumericTextBox ctl = new RadNumericTextBox(); ctl.MinValue = 1024; ctl.MaxValue = 2147482624; //max value is set to 2G. ctl.Type = NumericType.Number; ctl.ShowSpinButtons = true; ctl.IncrementSettings.Step = 1024; ctl.NumberFormat.DecimalDigits = 0; ctl.NumberFormat.GroupSeparator = ""; ctl.NumberFormat.GroupSizes = 9; ctl.ID = "ctl_rc_" + key; ctl.Width = Unit.Pixel(255); pnlRow.Controls.Add(ctl); break; } case "contentareamode": { DropDownList ctl = new DropDownList(); ctl.ID = "ctl_rc_" + key; foreach (string name in Enum.GetNames(typeof(EditorContentAreaMode))) { if (name != "All") { ctl.Items.Add(new ListItem(name, name)); } } pnlRow.Controls.Add(ctl); break; } default: { TextBox ctl = new TextBox(); ctl.ID = "ctl_rc_" + key; ctl.Text = value; pnlRow.Controls.Add(ctl); break; } } fsContent.Controls.Add(pnlRow); } } pnlContent.Controls.Add(fsContent); plhConfig.Controls.Add(pnlContent); }
private void calculateTaxAmt(RadNumericTextBox txtChargeAmt, RadComboBox cboPartyCharged, ref RadNumericTextBox txtTaxAmt, ref RadTextBox txtTaxCode) { txtTaxAmt.Text = ""; txtTaxCode.Text = ""; if (txtChargeAmt.Value.HasValue) { //Khong tinh VAT theo y/c nghiep vu ! //[9/10/2014 10:01:06 PM] Nguyen - Viet Victory: Neu Party Charge la: A hoac B thi Xuat phieu VAT (Charge Phi + 10%VAT) //[9/10/2014 10:01:27 PM] Nguyen - Viet Victory: Neu Party Charge la: AC hoac BC thi KHONG Xuat phieu VAT (Charge Phi) /*switch (cboPartyCharged.SelectedValue) { case "A": case "B": txtTaxAmt.Text = String.Format("{0:C}", txtChargeAmt.Value.Value * VAT).Replace("$", ""); txtTaxCode.Text = "81 10% VAT on Charge"; break; default: //txtTaxAmt.Text = String.Format("{0:C}", txtChargeAmt.Value.Value).Replace("$", ""); break; }*/ } //Tính toán lại Amount Credited if (txtDrawingAmount.Value.HasValue) { double AmountCredited = txtDrawingAmount.Value.Value; calculateAmountCredited(tabCableCharge_txtChargeAmt.Value, tabCableCharge_cboPartyCharged.SelectedValue, tabCableCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabPaymentCharge_txtChargeAmt.Value, tabPaymentCharge_cboPartyCharged.SelectedValue, tabPaymentCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabHandlingCharge_txtChargeAmt.Value, tabHandlingCharge_cboPartyCharged.SelectedValue, tabHandlingCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabDiscrepenciesCharge_txtChargeAmt.Value, tabDiscrepenciesCharge_cboPartyCharged.SelectedValue, tabDiscrepenciesCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabOtherCharge_txtChargeAmt.Value, tabOtherCharge_cboPartyCharged.SelectedValue, tabOtherCharge_txtTaxAmt.Text, ref AmountCredited); txtAmountCredited.Value = AmountCredited; numAmount.Value = AmountCredited; numAmount_MT400.Value = AmountCredited; } }
private void loadCharge(BEXPORT_LC_DOCS_PROCESSING_CHARGES ExLCCharge, ref RadTextBox txtChargeCode, ref RadComboBox cbChargeCcy, ref RadComboBox cbChargeAcc, ref RadNumericTextBox txtChargeAmt, ref RadComboBox cbChargeParty, ref RadComboBox cbChargeAmort, ref RadComboBox cbChargeStatus, ref Label lblTaxCode, ref Label lblTaxAmt) { txtChargeCode.Text = ExLCCharge.ChargeCode; cbChargeCcy.SelectedValue = ExLCCharge.ChargeCcy; cbChargeAcc.SelectedValue = ExLCCharge.ChargeAcc; txtChargeAmt.Value = ExLCCharge.ChargeAmt; cbChargeParty.SelectedValue = ExLCCharge.PartyCharged; cbChargeAmort.SelectedValue = ExLCCharge.AmortCharge; cbChargeStatus.SelectedValue = ExLCCharge.ChargeStatus; lblTaxCode.Text = ExLCCharge.TaxCode; if (ExLCCharge.TaxAmt.HasValue) lblTaxAmt.Text = ExLCCharge.TaxAmt.ToString(); }
//protected void rcbChargeAcct_ItemDataBound(object sender, RadComboBoxItemEventArgs e) //{ // DataRowView row = e.Item.DataItem as DataRowView; // e.Item.Attributes["Id"] = row["Id"].ToString(); // e.Item.Attributes["Name"] = row["Name"].ToString(); //} private void parseDocsCode(int Order, BEXPORT_DOCUMENTPROCESSING dsDetail, ref System.Web.UI.HtmlControls.HtmlGenericControl divDocsCode, ref RadComboBox cbDocsCode, ref RadNumericTextBox tbNoOfOriginals, ref RadNumericTextBox tbNoOfCopies) { if (Order == 1) { string DocsCode = dsDetail.DocsCode1; if (dsDetail.NoOfOriginals1 != null) { tbNoOfOriginals.Value = Convert.ToInt32(dsDetail.NoOfOriginals1); } if (dsDetail.NoOfCopies1 != null) { tbNoOfCopies.Value = Convert.ToInt32(dsDetail.NoOfCopies1); } } else if (Order == 2) { string DocsCode = dsDetail.DocsCode2; if (dsDetail.NoOfOriginals2 != null) { tbNoOfOriginals.Value = Convert.ToInt32(dsDetail.NoOfOriginals2); } if (dsDetail.NoOfCopies2 != null) { tbNoOfCopies.Value = Convert.ToInt32(dsDetail.NoOfCopies2); } } else if (Order == 3) { string DocsCode = dsDetail.DocsCode3; if (dsDetail.NoOfOriginals3 != null) { tbNoOfOriginals.Value = Convert.ToInt32(dsDetail.NoOfOriginals3); } if (dsDetail.NoOfCopies2 != null) { tbNoOfCopies.Value = Convert.ToInt32(dsDetail.NoOfCopies3); } } }
private void parseTabCharge(BEXPORT_DOCUMENTPROCESSINGCHARGE drDetail, ref RadComboBox cbChargeCode, ref RadComboBox cbChargeCcy, ref RadComboBox cbChargeAcct , ref RadNumericTextBox tbChargeAmt, ref RadComboBox cbPartyCharged, ref RadComboBox cbOmortCharges , ref System.Web.UI.WebControls.Label lblTaxCode, ref System.Web.UI.WebControls.Label lblTaxAmt) { cbChargeCode.SelectedValue = drDetail.Chargecode; cbChargeCcy.SelectedValue = drDetail.ChargeCcy; cbChargeAcct.SelectedValue = drDetail.ChargeAcct; if (drDetail.ChargeAmt != null) tbChargeAmt.Value = Convert.ToInt32(drDetail.ChargeAmt); cbPartyCharged.SelectedValue = drDetail.PartyCharged; cbOmortCharges.SelectedValue = drDetail.OmortCharges; lblTaxCode.Text = drDetail.TaxCode; if (drDetail.TaxAmt!=null) lblTaxAmt.Text = drDetail.TaxAmt.ToString(); }
private void saveCharge(RadTextBox txtChargeCode, RadComboBox cbChargeCcy, RadComboBox cbChargeAcc, RadNumericTextBox txtChargeAmt, RadComboBox cbChargeParty, RadComboBox cbChargeAmort, RadComboBox cbChargeStatus, Label lblTaxCode, Label lblTaxAmt, ref BEXPORT_LC_DOCS_SETTLEMENT_CHARGES ExLCCharge) { ExLCCharge.PaymentCode = tbLCCode.Text; ExLCCharge.ChargeCode = txtChargeCode.Text; ExLCCharge.ChargeCcy = cbChargeCcy.SelectedValue; ExLCCharge.ChargeAcc = cbChargeAcc.SelectedValue; ExLCCharge.ChargeAmt = txtChargeAmt.Value; ExLCCharge.PartyCharged = cbChargeParty.SelectedValue; ExLCCharge.AmortCharge = cbChargeAmort.SelectedValue; ExLCCharge.ChargeStatus = cbChargeStatus.SelectedValue; ExLCCharge.TaxCode = lblTaxCode.Text; if (!string.IsNullOrEmpty(lblTaxAmt.Text)) ExLCCharge.TaxAmt = Convert.ToDouble(lblTaxAmt.Text); }
protected void LoadCurrentStock() { try { phCurrentStock.Controls.AddAt(0, new LiteralControl("<div style=\"width:100%; text-align:center\"><p style=\"width:100%; text-align:center;\">Current Vendor Stock</p><p style=\"width:100%; text-align:center; font-size:8px; font-style: italic;\">(Numbers and Decimals only)</p>")); using (FormContext ctx = new FormContext()) { if (ctx.InventoryApprovalItems.Any(x => x.Status.StatusDescription == "Pending Approval")) { lblPendingTotalGrid.Text = "Pending Total: " + ctx.InventoryApprovalItems.Where(x => x.Status.StatusDescription == "Pending Approval").Sum(x => x.Cost).ToString("c2"); } else { lblPendingTotalGrid.Text = "Pending Total: $0"; } if (ctx.InventoryApprovalItems.Any(x => x.Status.StatusDescription == "Approved")) { lblApprovedTotalGrid.Text = "Approved Total: " + ctx.InventoryApprovalItems.Where(x => x.Status.StatusDescription == "Approved").Sum(x => x.Cost).ToString("c2"); } else { lblPendingTotalGrid.Text = "Approved Total: $0"; } if (ctx.InventoryApprovalItems.Any(x => x.Status.StatusDescription == "Ordered")) { lblOrderedTotalGrid.Text = "Ordered Total: " + ctx.InventoryApprovalItems.Where(x => x.Status.StatusDescription == "Ordered").Sum(x => x.Cost).ToString("c2"); } else { lblPendingTotalGrid.Text = "Ordered Total: $0"; } if (ctx.InventoryApprovalItems.Any(x => x.Status.StatusDescription == "Arrived")) { lblArrivedTotalGrid.Text = "Arrived Total: " + ctx.InventoryApprovalItems.Where(x => x.Status.StatusDescription == "Arrived").Sum(x => x.Cost).ToString("c2"); } else { lblPendingTotalGrid.Text = "Arrived Total: $0"; } if (ctx.InventoryApprovalItems.Any(x => x.Status.StatusDescription == "Invoiced")) { lblInvoicedTotalGrid.Text = "Invoiced Total: " + ctx.InventoryApprovalItems.Where(x => x.Status.StatusDescription == "Invoiced").Sum(x => x.Cost).ToString("c2"); } else { lblPendingTotalGrid.Text = "Invoiced Total: $0"; } if (ctx.Vendors.Any()) { foreach (Vendor vendor in ctx.Vendors) { RadNumericTextBox txtBox = new RadNumericTextBox(); txtBox.ID = "txt" + vendor.VendorName.Replace(" ", ""); txtBox.Text = vendor.CurrentStock == null ? "0" : vendor.CurrentStock.ToString(); txtBox.MaxValue = 1000000000; txtBox.Width = Unit.Pixel(100); txtBox.SelectionOnFocus = SelectionOnFocus.None; txtBox.Type = NumericType.Currency; txtBox.NumberFormat.DecimalDigits = 0; txtBox.NumberFormat.GroupSeparator = ","; phCurrentStock.Controls.Add(new LiteralControl("<div style=\"width:40%; float:left\">")); phCurrentStock.Controls.Add(new LiteralControl(vendor.VendorName)); phCurrentStock.Controls.Add(new LiteralControl("</div>")); phCurrentStock.Controls.Add(new LiteralControl("<div style=\"width:40%; float:left;\">")); phCurrentStock.Controls.Add(txtBox); phCurrentStock.Controls.Add(new LiteralControl("</div>")); } } } phCurrentStock.Controls.Add(new LiteralControl("</div")); } catch(Exception ex) { } }