Beispiel #1
0
    protected void TxtItemNamewooden_OnTextChanged(object sender, EventArgs e)
    {
        try
        {
            TextBox     txt      = sender as TextBox;
            GridViewRow row      = txt.NamingContainer as GridViewRow;
            int         rowIndex = row.RowIndex;
            StrCondition = string.Empty;
            StrCondition = TxtItemNamewooden.Text.Trim();
            Ds           = new DataSet();
            Ds           = Obj_RequisitionCafeteria.GetItems(StrCondition, "", out StrError);
            if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
            {
                TxtItemNamewooden.Text    = Ds.Tables[0].Rows[0]["ItemName"].ToString();
                TxtItemNamewooden.ToolTip = Ds.Tables[0].Rows[0]["ItemId"].ToString();
                ViewState["ddlItem"]      = Ds.Tables[0].Rows[0]["ItemId"].ToString();
                ((AjaxControlToolkit.ComboBox)grdwoodenbox.Rows[rowIndex].FindControl("ddlItemwoden")).SelectedValue = Ds.Tables[0].Rows[0]["ItemId"].ToString();

                ddlItem_SelectedIndexChanged((((AjaxControlToolkit.ComboBox)grdwoodenbox.Rows[rowIndex].FindControl("ddlItemwoden"))) as AjaxControlToolkit.ComboBox, EventArgs.Empty);
                Ds = null;
            }
            else
            {
                TxtItemNamewooden.Text    = "";
                TxtItemNamewooden.ToolTip = "0";
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
 protected void TxtItemName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         DMRequisitionCafeteria Obj_RequisitionCafeteria = new DMRequisitionCafeteria();
         StrCondition = string.Empty;
         StrCondition = TxtItemName.Text.Trim();
         Ds           = new DataSet();
         Ds           = Obj_RequisitionCafeteria.GetItems(StrCondition, "", out StrError);
         if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
         {
             TxtItemName.Text          = Ds.Tables[0].Rows[0]["ItemName"].ToString();
             TxtItemName.ToolTip       = Ds.Tables[0].Rows[0]["ItemId"].ToString();
             ddlItemName.SelectedValue = Ds.Tables[0].Rows[0]["ItemId"].ToString();
             Ds = null;
         }
         else
         {
             TxtItemName.Text    = "";
             TxtItemName.ToolTip = "0";
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }