public void BindData(BindType bindType) { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = Code.ToString(), filter1 = LType, filter2 = Constants.LedgerSub, filter3 = LMode, filter4 = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm, FilterKey = Constants.TableAccounts }; var accounts = _controlPanel.GetAccounts(queryArgument); if (accounts != null) { if (bindType == BindType.Form) { var firstOrDefault = accounts.FirstOrDefault(); if (firstOrDefault == null) { return; } Code = firstOrDefault.SName; Name = firstOrDefault.Name; CreatedDate = firstOrDefault.Created; ContactPerson = firstOrDefault.ContactPerson; BasicAddress.DataSource = firstOrDefault.Address; uplForm.Update(); } else { GridViewTable.DataSource = accounts; if (_newPageIndex >= 0) { GridViewTable.PageIndex = _newPageIndex; } GridViewTable.DataSource = accounts; GridViewTable.DataBind(); if (IsUpload) { GridViewTable.Columns[3].Visible = false; } uplView.Update(); } } }
public void loadGST() { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = Customer, filter4 = Constants.RetriveForm, FilterKey = Constants.TableAccounts }; var accounts = _controlPanel.GetAccounts(queryArgument); var firstOrDefault = accounts.FirstOrDefault(); if (firstOrDefault == null) { return; } if (string.IsNullOrEmpty(firstOrDefault.Address.GST)) { lblGSTValue.InnerText = firstOrDefault.Address.GSTNAReason; } else { lblGSTValue.InnerText = firstOrDefault.Address.GST; } }