Ejemplo n.º 1
0
 private void ClearControls(int intflag)
 {
     txtQuantity_Rqd.Text             = "";
     chkDonation.Checked              = false;
     txtPrice.Text                    = "";
     txtPrice.Enabled                 = true;
     txtOrganization_Rqd.Text         = "";
     txtDonationPurchaseDate_RDT.Text = "";
     txtReceivedBy_Rqd.Text           = "";
     txtReceivedDate_RDT.Text         = "";
     txtFirstName.Text                = "";
     txtMiddleName.Text               = "";
     txtSurname.Text                  = "";
     txtDOB.Text                 = "";
     DDLGender.SelectedIndex     = 0;
     grdViewEmployees.DataSource = "";
     grdViewEmployees.DataBind();
     btnOK.Visible = false;
     if (intflag == 0)
     {
         DDLItemsCategory_Rqd.SelectedIndex = 0;
     }
     if (intflag == 1 || intflag == 0)
     {
         DDLItemsSubCategory_Rqd.DataSource = "";
         DDLItemsSubCategory_Rqd.DataBind();
         DDLItems_Rqd.DataSource = "";
         DDLItems_Rqd.DataBind();
     }
     if (intflag == 2)
     {
         DDLItems_Rqd.DataSource = "";
         DDLItems_Rqd.DataBind();
     }
 }
Ejemplo n.º 2
0
 protected void DDLCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         ClearControls(2);
         if (this.DDLItemCategory_Rqd.SelectedIndex > 0)
         {
             List <ATTInvItemsCategory> lstItemsCategory = (List <ATTInvItemsCategory>)Session["Item_ItemCategory"];
             DDLItemsSubCategory_Rqd.DataSource = lstItemsCategory[this.DDLItemCategory_Rqd.SelectedIndex].LstItemSubCategory;
             //List<ATTInvItemsSubCategory> lstitemsSubCategory = BLLInvItemsSubCategory.GetItemSubCategory(lstItemsCategory[DDLItemCategory_Rqd.SelectedIndex].ItemCategoryID, "Y", true);
             //Session["Items_SubCategory"] = lstitemsSubCategory;
             //DDLItemsSubCategory_Rqd.DataSource = lstitemsSubCategory;
             DDLItemsSubCategory_Rqd.DataTextField  = "ItemsSubCategoryName";
             DDLItemsSubCategory_Rqd.DataValueField = "ItemsSubCategoryID";
             DDLItemsSubCategory_Rqd.DataBind();
         }
         //ClearControls();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ex.Message;
     }
 }