protected void btnTransferRequest_Command(object sender, CommandEventArgs e) { DataTable dtTranReqHeader = ObjTransReq.GetRecordUsingTransIdByRequestLocation(strCompId.ToString(), StrBrandId.ToString(), StrLocId.ToString(), e.CommandArgument.ToString()); if (dtTranReqHeader.Rows.Count != 0) { ViewState["RequestId"] = e.CommandArgument.ToString(); pnlTrans.Visible = true; txtTransReqDate.Text = Convert.ToDateTime(dtTranReqHeader.Rows[0]["TDate"].ToString()).ToString(ObjSysParam.GetSysParameterByParamName("Date_Format").Rows[0]["Param_Value"].ToString()); txtTransNo.Text = dtTranReqHeader.Rows[0]["RequestNo"].ToString(); try { txtLocationName.ReadOnly = true; txtLocationName.Text = objLocation.GetLocationMasterById(strCompId, dtTranReqHeader.Rows[0]["Location_ID"].ToString()).Rows[0]["Location_Name"].ToString(); } catch { txtLocationName.Text = ""; } DataTable dtTrasDetail = ObjTransferReqDetail.GetTransferRequestDetailbyRequestId(strCompId.ToString(), StrBrandId.ToString(), dtTranReqHeader.Rows[0]["Location_ID"].ToString(), e.CommandArgument.ToString()); GvProduct.DataSource = dtTrasDetail; GvProduct.DataBind(); gvEditProduct.DataSource = null; gvEditProduct.DataBind(); btnNew_Click(null, null); } }
public void FillGridDetail(string InvoiceId) { DataTable dt = ObjPurchaseInvoiceDetail.GetPurchaseInvoiceDetailByInvoiceNo(StrCompId.ToString(), StrBrandId.ToString(), StrLocationId.ToString(), InvoiceId); if (dt.Rows.Count != 0) { GvProduct.DataSource = dt; GvProduct.DataBind(); } AllPageCode(); }
protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["DXC"].ConnectionString); cmd = new SqlCommand("select*from [Prod]", con); con.Open(); SqlDataReader rd = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(rd); // GvProduct.DataSource = dt; GvProduct.DataBind(); }
public void Reset() { txtVoucherNo.Text = ""; editid.Value = ""; txtTransferDate.Text = DateTime.Now.ToString(ObjSysParam.GetSysParameterByParamName("Date_Format").Rows[0]["Param_Value"].ToString()); txtTransNo.Text = ""; txtTransReqDate.Text = ""; txtLocationName.Text = ""; pnlTrans.Visible = false; txtDescription.Text = ""; GvProduct.DataSource = null; GvProduct.DataBind(); FillGrid(); editid.Value = ""; gvEditProduct.DataSource = null; gvEditProduct.DataBind(); btnNew.Text = Resources.Attendance.New; AllPageCode(); }