public void GetFixedAssetInfo(Guid faID) { FixedAssetBLL f = new FixedAssetBLL(); DataRow r = f.GetFixedAsset(faID); txtItem.Text = r["Item"].ToString(); txtTagNo.Text = r["TagNo"].ToString(); txtCustadian.Text = r["Custodian"].ToString(); ViewState.Add("CustodianID", new Guid(r["CurrentCustodianID"].ToString())); txtTAG.Text = r["TagNo"].ToString(); GetFixedAssetList(); }
protected void grvFixedasset_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); Messages1.ClearMessage(); ViewState.Add("FAID", new Guid(grvFixedasset.SelectedDataKey[0].ToString())); try { if (isEdit != null) { ViewState.Add("isEdit", true); btnSave.Enabled = true; btnSave.Text = "Update"; DataRow r = fAsset.GetFixedAsset(FAID); ddlItemType.SelectedValue = r["ItemTypeID"].ToString(); BindItem(false); ddlItem.SelectedValue = r["ItemID"].ToString(); txtLocation.Text = r["Location"].ToString(); txtSNo.Text = r["SNo"].ToString(); txtTagNo.Text = r["TagNo"].ToString(); txtRecievedFrom.Text = r["RecievedFrom"].ToString(); txtRecievedDate.Text = r["ReceivedDate"].ToString(); txtCost.Text = r["Cost"].ToString(); txtRemark.Text = r["Remark"].ToString(); ddlFARN.SelectedValue = r["FARNNo"].ToString(); txtModel.Text = r["Model"].ToString(); } else { fAsset.CancelFixedAsset(FAID, new Guid(UserPrincipal.Current.Guid.ToString()), DateTime.Now); Messages1.SetMessage("Record canceled successfully.", Messages.MessageType.Success); GetFixedAssetList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }