// ==============================================================================================================
        #region ddlSupplier_SelectedIndexChanged
        private void ddlSupplier_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (ddlSupplier.SelectedIndex != 0)
            {
                Invoice_NL_CN objInvoice = new Invoice_NL_CN();
                try
                {
                    ddlInvoiceNo.ClearSelection();
                }
                catch { }
                ddlInvoiceNo.DataSource = objInvoice.GetInvoiceNo(Convert.ToInt32(ddlSupplier.SelectedValue), 2);
                ddlInvoiceNo.DataBind();
                ddlInvoiceNo.Items.Insert(0, new ListItem("Select Doc No", "0"));

                try
                {
                    ddldept.ClearSelection();
                }
                catch
                {
                    ddldept.DataSource = objInvoice.GetDepartmentListDropDown();
                    ddldept.DataBind();
                    ddldept.Items.Insert(0, new ListItem("Select", "0"));
                }
            }
        }
示例#2
0
        // ==============================================================================================================
        #region GetCompanyListForPurchaseInvoiceLog
        private void GetCompanyListForPurchaseInvoiceLog(int iCompanyID, int iAction)
        {
            if (iAction == 1)
            {
                Company objCompany = new Company();
                ddlCompany.DataSource = objCompany.GetCompanyListForPurchaseInvoiceLog_CN(Convert.ToInt32(Session["CompanyID"]));
                ddlCompany.DataBind();
                ddlCompany.Items.Insert(0, new ListItem("Select Company", "0"));
                ddlActionStatus.Items.Insert(0, new ListItem("Select Action Status", "0"));
                ddlActionStatus.Items.Insert(1, new ListItem("Pending", "P"));
                ddlActionStatus.Items.Insert(2, new ListItem("Completed", "C"));
                ddlActionStatus.Items.Insert(3, new ListItem("OverDue", "O"));
            }

            Invoice_NL_CN objInvoice = new Invoice_NL_CN();

            ddlSupplier.DataSource = objInvoice.GetSuppliersList(Convert.ToInt32(Session["CompanyID"]));
            ddlSupplier.DataBind();

            ddlDocStatus.DataSource = objInvoice.GetStatusList();
            ddlDocStatus.DataBind();

            ddlUsers.DataSource = objInvoice.GetUsersList(iCompanyID);
            ddlUsers.DataBind();

            ddlInvoiceNo.DataSource = objInvoice.GetInvoiceNo(iCompanyID, 1);
            ddlInvoiceNo.DataBind();

            ddlSupplier.Items.Insert(0, new ListItem("Select Supplier", "0"));

            ddlDocStatus.Items.Insert(0, new ListItem("Select Doc Status", "0"));

            ddlUsers.Items.Insert(0, new ListItem("Select User", "0"));
            ddlInvoiceNo.Items.Insert(0, new ListItem("Select Doc No", "0"));

            ddldept.DataSource = objInvoice.GetDepartmentListDropDown();
            ddldept.DataBind();
            ddldept.Items.Insert(0, new ListItem("Select", "0"));

            try
            {
                ddlDocStatus.Items.Remove(new ListItem("Overdue", "12"));
            }
            catch { }
        }