private void UpdateList(int id) { DS = new DataSet(); itemRate = new ItemRate(); purchaseData = new PurchaseData(); itemRate.VendorId = id; itemRate.Flag = 1; //1 for get by VendorId DS = purchaseData.GetItemRateList(itemRate); rpItemRatesList.DataSource = DS; rpItemRatesList.DataBind(); SelDropDown(); }
protected void dpItems_SelectedIndexChanged(object sender, EventArgs e) { DS = new DataSet(); itemRate = new ItemRate(); purchaseData = new PurchaseData(); itemRate.ItemId = Convert.ToInt32(dpItems.SelectedItem.Value); itemRate.Flag = 3; // DS = purchaseData.GetItemRateList(itemRate); rpItemRatesList.DataSource = DS; rpItemRatesList.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "sel1", "$('#MainContent_dpItems').addClass('selectpicker');$('#MainContent_dpItems').selectpicker();", true); }
private void GetDetailsById(int itemRateId) { itemRate = new ItemRate(); purchaseData = new PurchaseData(); DataSet DS = new DataSet(); itemRate.ItemRatesId = itemRateId; itemRate.Flag = 2; DS = purchaseData.GetItemRateList(itemRate); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVendor1.ClearSelection(); if (dpVendor1.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["VendorId"]).ToString()) != null) { dpVendor1.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["VendorId"]).ToString()).Selected = true; } dpItem.ClearSelection(); if (dpItem.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["ItemId"]).ToString()) != null) { dpItem.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["ItemId"]).ToString()).Selected = true; } txtQuantity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Quantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Quantity"].ToString(); dpUnit.ClearSelection(); if (dpUnit.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["UnitId"]).ToString()) != null) { dpUnit.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["UnitId"]).ToString()).Selected = true; } txtPrice.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Price"].ToString()) ? string.Empty : Convert.ToDecimal(DS.Tables[0].Rows[0]["Price"]).ToString("#0.00"); txtExcise.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ExciseDuty"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ExciseDuty"].ToString(); txtShipping.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Shipping"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Shipping"].ToString(); txtCst.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CST"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CST"].ToString(); txtVat.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Vat"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Vat"].ToString(); txtInsurance.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Insurance"].ToString()) ? string.Empty : Convert.ToDecimal(DS.Tables[0].Rows[0]["Insurance"]).ToString("#0.00"); txtFreight.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FreightCharges"].ToString()) ? string.Empty : Convert.ToDecimal(DS.Tables[0].Rows[0]["FreightCharges"]).ToString("#0.00"); txtTotalPrice.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TotalPrice"].ToString()) ? string.Empty : Convert.ToDecimal(DS.Tables[0].Rows[0]["TotalPrice"]).ToString("#0.00"); } btnSubmit.Visible = false; btnUpdate.Visible = true; }