Esempio n. 1
0
        private void GetDetailsById(int brandID)
        {
            vendor       = new Vendor();
            purchaseData = new PurchaseData();
            DataSet DS = new DataSet();

            vendor.Flag     = 2; //Get by ID
            vendor.VendorId = brandID;

            vendor.VendorCode = string.Empty;
            vendor.VendorName = string.Empty;
            vendor.Address    = string.Empty;
            vendor.City       = string.Empty;
            vendor.State      = string.Empty;
            vendor.Mobile     = string.Empty;
            vendor.Phone      = string.Empty;
            vendor.Email      = string.Empty;

            DS = purchaseData.GetVendorsList(vendor);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                txtVendorCode.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VendorCode"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VendorCode"].ToString();
                txtVendorName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VendorName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VendorName"].ToString();
                txtAddress.Text    = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Address"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Address"].ToString();
                txtMobile.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Mobile"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Mobile"].ToString();
                txtPhone.Text      = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Phone"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Phone"].ToString();
                txtEmail.Text      = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Email"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Email"].ToString();

                dpIsActive.ClearSelection();
                if (DS.Tables[0].Rows[0]["Isactive"].ToString() == "True")
                {
                    dpIsActive.Items.FindByValue("1").Selected = true;
                }
                if (DS.Tables[0].Rows[0]["Isactive"].ToString() == "False")
                {
                    dpIsActive.Items.FindByValue("2").Selected = true;
                }
                dpCity.ClearSelection();
                if (dpCity.Items.FindByText(DS.Tables[0].Rows[0]["City"].ToString()) != null)
                {
                    dpCity.Items.FindByText(DS.Tables[0].Rows[0]["City"].ToString()).Selected = true;
                }
                dpState.ClearSelection();
                if (dpState.Items.FindByText(DS.Tables[0].Rows[0]["State"].ToString()) != null)
                {
                    dpState.Items.FindByText(DS.Tables[0].Rows[0]["State"].ToString()).Selected = true;
                }
            }
            btnSubmit.Visible = false;
            btnUpdate.Visible = true;
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
        }
Esempio n. 2
0
        private void GetList()
        {
            vendor       = new Vendor();
            purchaseData = new PurchaseData();
            DataSet DS = new DataSet();

            vendor.Flag       = 0; //Select *
            vendor.VendorCode = string.Empty;
            vendor.VendorName = string.Empty;
            vendor.Address    = string.Empty;
            vendor.City       = string.Empty;
            vendor.State      = string.Empty;
            vendor.Mobile     = string.Empty;
            vendor.Phone      = string.Empty;
            vendor.Email      = string.Empty;
            DS = purchaseData.GetVendorsList(vendor);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpBrandInfo.DataSource = DS;
                rpBrandInfo.DataBind();
            }
        }