private void LoadData() { ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("FromDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("ToDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input); DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_PettyCashExpAmt"); if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (ds.Tables.Count > 1) { DataTable dtPettyCashBal = ds.Tables[1]; if (ObjUtil.ValidateTable(dtPettyCashBal)) { txtTotalPettyCash.Text = dtPettyCashBal.Rows[0]["TotalPettyCashAmt"].ToString(); txtTotalExpenses.Text = dtPettyCashBal.Rows[0]["TotalPettyCashExpAmt"].ToString(); txtPettyCashBAL.Text = dtPettyCashBal.Rows[0]["PettyCashBalance"].ToString(); } } if (ObjUtil.ValidateTable(dt)) { dgvPettyCashExp.DataSource = dt; } else { dgvPettyCashExp.DataSource = null; } } }
private void btnPost_Click(object sender, EventArgs e) { if (clsFormRights.HasFormRight(clsFormRights.Forms.Posting_Delivery, clsFormRights.Operation.Save) || clsUtility.IsAdmin) { if (validateform()) { bool b = clsUtility.ShowQuestionMessage("Are you sure want to post for " + txtSupplierBillNo.Text + " ?", clsUtility.strProjectTitle); if (b) { string para = txtPurchaseInvoiceID.Text + "," + cmbStore.SelectedValue + "," + txtTotalQTY.Text + "," + cmbEntryType.SelectedIndex + "," + txtSupplierBillNo.Text + "," + clsUtility.LoginID; DataTable dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Insert_PurchaseInvoice_BulkPrint_Color_Size " + para); if (ObjUtil.ValidateTable(dt)) { int flag = Convert.ToInt32(dt.Rows[0]["Flag"]); string Msg = dt.Rows[0]["Msg"].ToString(); clsUtility.ShowInfoMessage(Msg, clsUtility.strProjectTitle); ClearAll(); } else { clsUtility.ShowInfoMessage("Posting Delivery Entry for '" + txtSupplierBillNo.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle); } } } } else { clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle); } }
private void lkbBrowseForProductData_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { strFilePath = ""; Obj.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm"; if (Obj.ShowDialog() == System.Windows.Forms.DialogResult.OK) { strFilePath = Obj.FileName; txtImportProductData.Text = strFilePath; try { SetProgressPercent(1, dtExcelData.Rows.Count); stream = new FileStream(Obj.FileName, FileMode.Open); excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); DataSet result = excelReader.AsDataSet(); if (result.Tables.Count > 0) { dtExcelData = result.Tables[0]; if (ObjUtil.ValidateTable(dtExcelData)) { dataGridView1.DataSource = dtExcelData; } } } catch (Exception ex) { clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle); } } }
private void LoadData() { try { ObjDAL.SetStoreProcedureData("FromDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("ToDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("BillStatus", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input); DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_List"); if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (ObjUtil.ValidateTable(dt)) { dgvTransferWatch.DataSource = dt; } else { dgvTransferWatch.DataSource = null; } } } catch (Exception ex) { clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle); } }
private void LoadData() { ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, StoreBillDetailsID, clsConnection_DAL.ParamType.Input); DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ItemDetails"); if (ds != null && ds.Tables.Count > 0) { dtStoreTransfer = ds.Tables[0]; if (ObjUtil.ValidateTable(dtStoreTransfer)) { dgvProductDetails.DataSource = dtStoreTransfer; txtDate.Text = Convert.ToDateTime(dtStoreTransfer.Rows[0]["BillDate"]).ToShortDateString(); txtTotalQTY.Text = dtStoreTransfer.Rows[0]["TotalQTY"].ToString(); txtBillNo.Text = dtStoreTransfer.Rows[0]["BillNo"].ToString(); object rate = dtStoreTransfer.Compute("SUM(Total)", string.Empty); txtValue.Text = rate.ToString(); } else { dgvProductDetails.DataSource = null; } } else { dgvProductDetails.DataSource = null; } }
void LoadConnection() { try { for (int i = 0; i < 100; i++) { ObjThread.SetLoadingProgressPercent(i, 100); } DataTable dt = ObjDAL.ExecuteSelectStatement("SELECT * FROM sys.databases WHERE name NOT IN('master','model','msdb','tempdb','ReportServer','ReportServerTempDB')"); string str = string.Empty; if (ObjUtil.ValidateTable(dt)) { for (int i = 0; i < dt.Rows.Count; i++) { str = dt.Rows[i][0].ToString(); AddItem(str.Trim()); } } ObjThread.CloseLoadingDialog(); } catch (Exception ex) { ObjThread.CloseLoadingDialog(); clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle); } }
private void LoadCashStatus() { int pStoreID = Home_StoreID; DataTable dtCashMaster = ObjDAL.ExecuteSelectStatement("SELECT TOP 1 * FROM " + clsUtility.DBName + ".[dbo].[tblMasterCashClosing] WITH(NOLOCK) WHERE StoreID=" + pStoreID + " ORDER BY CashBoxDate DESC"); if (ObjUtil.ValidateTable(dtCashMaster)) { Home_MasterCashClosingID = Convert.ToInt32(dtCashMaster.Rows[0]["MasterCashClosingID"]); if (Convert.ToBoolean(dtCashMaster.Rows[0]["CashStatus"])) { if (DateTime.Now.ToString("yyyy-MM-dd") == Convert.ToDateTime(dtCashMaster.Rows[0]["CashBoxDate"]).ToString("yyyy-MM-dd")) { btnOpenCash.Text = "View Details"; } IsForceCloseCash = false; label7.Text = "CLOSED"; } else { label7.Text = "OPEN"; btnOpenCash.Text = "View Details"; if (DateTime.Now.ToString("yyyy-MM-dd") != Convert.ToDateTime(dtCashMaster.Rows[0]["CashBoxDate"]).ToString("yyyy-MM-dd")) { IsForceCloseCash = true; clsUtility.ShowInfoMessage("Please close your previous day cash box and Open a new cash box for today.", clsUtility.strProjectTitle); return; } IsForceCloseCash = false; } } else { label7.Text = "NA"; } }
private void SaveEmployee() { ObjDAL.SetStoreProcedureData("EmployeeCode", SqlDbType.NVarChar, txtEmployeeCode.Text.Trim(), clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("Name", SqlDbType.NVarChar, txtName.Text.Trim(), clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("MobileNo", SqlDbType.VarChar, txtMobileNo.Text, clsConnection_DAL.ParamType.Input); if (radMale.Checked) { ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, true, clsConnection_DAL.ParamType.Input); } else if (radFemale.Checked) { ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, false, clsConnection_DAL.ParamType.Input); } if (dtpDOB.Checked) { ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, dtpDOB.Value.ToString("yyyy-MM-dd"), clsConnection_DAL.ParamType.Input); } else { ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, null, clsConnection_DAL.ParamType.Input); } ObjDAL.SetStoreProcedureData("Address", SqlDbType.NVarChar, txtAdd.Text.Trim(), clsConnection_DAL.ParamType.Input); if (PicEmployee.Image != null) { ObjDAL.SetStoreProcedureData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicEmployee.Image), clsConnection_DAL.ParamType.Input); } ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input); ObjDAL.SetStoreProcedureData("EMPID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Output); bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_Employee"); if (b) { DataTable dt = ObjDAL.GetOutputParmData(); if (ObjUtil.ValidateTable(dt)) { EmployeeID = Convert.ToInt32(dt.Rows[0][1]); } ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave); clsUtility.ShowInfoMessage("Employee has been added Successfully.", clsUtility.strProjectTitle); if (txtUsername.Text.Trim().Length != 0 && txtPass.Text.Trim().Length != 0) { CreateNewUser(EmployeeID); } ClearAll(); LoadData(); grpEmployee.Enabled = false; } else { clsUtility.ShowInfoMessage("Failed to add the Employee.", clsUtility.strProjectTitle); ObjDAL.ResetData(); } }
private string GetShopeName(string shopID) { string strShope = "NA"; DataTable dt = ObjDAL.ExecuteSelectStatement("select StoreName from " + clsUtility.DBName + ".[dbo].[StoreMaster] WITH(NOLOCK) where StoreID=" + shopID); if (ObjUtil.ValidateTable(dt)) { strShope = dt.Rows[0][0].ToString(); } return(strShope); }
private void LoadBranch() { DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".[dbo].[StoreMaster]", "StoreID,StoreName", "ISNULL(ActiveStatus,1)=1", "StoreName ASC"); if (ObjUtil.ValidateTable(dt)) { cmbBranch.DataSource = dt; cmbBranch.DisplayMember = "StoreName"; cmbBranch.ValueMember = "StoreID"; cmbBranch.SelectedIndex = -1; } }
private void LoadStore() { DataTable dt = ObjDAL.ExecuteSelectStatement("SELECT StoreID, StoreName FROM " + clsUtility.DBName + ".[dbo].[StoreMaster] WITH(NOLOCK) WHERE ISNULL(ActiveStatus,1)=1"); if (ObjUtil.ValidateTable(dt)) { cmbStoreName.DataSource = dt; cmbStoreName.DisplayMember = "StoreName"; cmbStoreName.ValueMember = "StoreID"; cmbStoreName.SelectedIndex = -1; } }
private void LoadData() { DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.PurchaseInvoice", "PurchaseInvoiceID,SupplierBillNo,SupplierID,ShipmentNo,BillDate,BillValue,TotalQTY,Discount,ForeignExp,GrandTotal,LocalValue,LocalExp,LocalBillValue", "BillDate"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { DataTable dt = null; dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName,Tel,Place,Fax,(CASE ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END) ActiveStatus,(CASE StoreCategory WHEN 0 THEN 'Normal Store' WHEN 1 THEN 'Warehouse' END) StoreCategory,StoreCategory [StoreCategoryID] ", "StoreName"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { DataTable dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_DiffPurchase_Received " + txtPurchaseInvoiceID.Text); if (ObjUtil.ValidateTable(dt)) { btnViewDetails.Enabled = true; dataGridView1.DataSource = dt; } else { btnViewDetails.Enabled = false; dataGridView1.DataSource = null; } }
private void LoadData() { DataTable dt = null; dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.CustomerMaster", "CustomerID,Name,Address,PhoneNo,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus", "Name"); if (ObjUtil.ValidateTable(dt)) { dgvCustomerMaster.DataSource = dt; } else { dgvCustomerMaster.DataSource = null; } }
private void LoadData() { DataTable dt = null; dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName,Tel,Place,Fax,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus,StoreCategory ", "StoreName"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { ObjUtil.SetDataGridProperty(dataGridView1, DataGridViewAutoSizeColumnsMode.Fill); DataTable dt = null; dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_Brand_Master"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { DataTable dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_DiffPurchase_Received_Details " + PurchaseInvoiceID); int TotalBillQTY = 0, TotalReceivedQTY = 0, TotalDiffQTY = 0; double TotalDiffValue = 0; if (ObjUtil.ValidateTable(dt)) { for (int i = 0; i < dt.Rows.Count; i++) { TotalReceivedQTY += dt.Rows[i]["Receive QTY"] != DBNull.Value ? Convert.ToInt32(dt.Rows[i]["Receive QTY"]) : 0; TotalDiffQTY += dt.Rows[i]["Diff QTY"] != DBNull.Value ? Convert.ToInt32(dt.Rows[i]["Diff QTY"]) : 0; TotalDiffValue += dt.Rows[i]["Diff QTY"] != DBNull.Value ? Convert.ToDouble(dt.Rows[i]["Diff Value"]) : 0; if (i == 0) { TotalBillQTY = dt.Rows[i]["TotalQTY"] != DBNull.Value ? Convert.ToInt32(dt.Rows[i]["TotalQTY"]) : 0; continue; } } cmbSupplier.SelectedValue = Convert.ToInt32(dt.Rows[0]["SupplierID"]); txtTotalBillQTY.Text = TotalBillQTY.ToString(); txtTotalQTYReceived.Text = TotalReceivedQTY.ToString(); //txtTotalDiffQTY.Text = TotalDiffQTY.ToString(); txtTotalDiffQTY.Text = (TotalReceivedQTY - TotalBillQTY).ToString(); txtTotalDiffValue.Text = TotalDiffValue.ToString(); txtSupplierBillNo.Text = dt.Rows[0]["SupplierBillNo"].ToString(); txtNewRate.Text = dt.Rows[0]["New Rate"].ToString(); dtpBillDate.Value = Convert.ToDateTime(dt.Rows[0]["BillDate"]); object ob = ObjDAL.ExecuteScalar("SELECT CurrencyName FROM " + clsUtility.DBName + ".[dbo].[CurrencyRateSetting] WITH(NOLOCK) WHERE CountryID=" + dt.Rows[0]["CountryID"]); txtCurrencyName.Text = ob.ToString(); dataGridView1.DataSource = dt; } else { txtTotalBillQTY.Text = TotalBillQTY.ToString(); txtTotalQTYReceived.Text = TotalReceivedQTY.ToString(); txtTotalDiffQTY.Text = TotalDiffQTY.ToString(); txtTotalDiffValue.Text = TotalDiffValue.ToString(); dataGridView1.DataSource = null; } }
private void LoadData() { ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, pStoreBillDetailsID, clsConnection_DAL.ParamType.Input); DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ListItems"); //DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ItemDetails"); if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (ObjUtil.ValidateTable(dt)) { dgvTransferWatch.DataSource = dt; txtBillNo.Text = dt.Rows[0]["BillNo"].ToString(); txtStoreName.Text = dt.Rows[0]["StoreName"].ToString(); txtBillDate.Text = Convert.ToDateTime(dt.Rows[0]["BillDate"]).ToString("yyyy-MM-dd"); txtReceiveBillDate.Text = dt.Rows[0]["ReceiveBillDate"] != DBNull.Value ? Convert.ToDateTime(dt.Rows[0]["ReceiveBillDate"]).ToString("yyyy-MM-dd") : ""; txtTotalBillQTY.Text = dt.Rows[0]["TotalQTY"].ToString(); txtTotalEnterQTY.Text = dt.Rows[0]["ReceivedTotalQTY"].ToString(); } else { dgvTransferWatch.DataSource = null; } } }
private void LoadData() { ObjUtil.SetDataGridProperty(dataGridView1, DataGridViewAutoSizeColumnsMode.Fill); DataTable dt = null; dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.CategoryMaster", "CategoryID,CategoryName,CategoryDescription,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus", "CategoryName"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void btnSaveData_Click(object sender, EventArgs e) { DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "UserID,UserName,Password,IsAdmin", "Password='******' AND ISNULL(Isblock,0)=0", "UserID DESC"); //int a = ObjDAL.ExecuteScalarInt("select Count(*) From CyberCafeManagement.dbo.login where UserName='******' and Password='******'"); if (ObjUtil.ValidateTable(dt)) { if (Convert.ToBoolean(dt.Rows[0]["IsAdmin"])) { IsValidAdmin = true; this.Close(); } else { IsValidAdmin = false; clsUtility.ShowInfoMessage("User is not an Admin. Please enter admin password.", clsUtility.strProjectTitle); txtDiscountPass.Focus(); } } else { IsValidAdmin = false; clsUtility.ShowInfoMessage("Invalid password..", clsUtility.strProjectTitle); txtDiscountPass.Focus(); } }
private void LoadData() { DataTable dt = null; dt = ObjDAL.ExecuteSelectStatement("SELECT sm.SizeID, sm.Size, sm.SizeTypeID, stm.SizeTypeName" + ", (CASE WHEN sm.ActiveStatus = 1 THEN 'Active' WHEN sm.ActiveStatus = 0 THEN 'InActive' END) ActiveStatus FROM " + clsUtility.DBName + ".[dbo].[SizeMaster] sm " + "INNER JOIN " + clsUtility.DBName + ".[dbo].[SizeTypeMaster] stm ON sm.SizeTypeID = stm.SizeTypeID ORDER BY sm.SizeTypeID,sm.Size"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { string q = "SELECT e1.EmpID,EmployeeCode,Name,ShopID,(CASE e1.Gender WHEN 1 THEN 'Male' WHEN 0 THEN 'Female' END) Gender,DOB,[Address],Photo, s1.StoreName FROM " + clsUtility.DBName + ".dbo.EmployeeDetails e1 JOIN " + clsUtility.DBName + ".dbo.StoreMaster s1" + " ON e1.ShopID=s1.StoreID ORDER BY EmpID DESC"; DataTable dataTable = ObjDAL.ExecuteSelectStatement(q); if (ObjUtil.ValidateTable(dataTable)) { dgvEmployee.DataSource = dataTable; lblTotalRecords.Text = "Total Employee Count : " + dgvEmployee.Rows.Count.ToString(); } else { dgvEmployee.DataSource = null; lblTotalRecords.Text = "Total Employee Count : 0"; } }
private bool IsBarCodeSettings() { DataTable dataTable = ObjCon.ExecuteSelectStatement("SELECT BarCodeSetting FROM " + clsUtility.DBName + ".dbo.tblBarCodeSettings WITH(NOLOCK)"); if (ObjUtil.ValidateTable(dataTable)) { if (dataTable.Rows[0]["BarCodeSetting"] != DBNull.Value && dataTable.Rows[0]["BarCodeSetting"].ToString().Trim().Length > 0) { return(true); } else { return(false); } } return(false); }
private void LoadData() { DataTable dt = null; dt = ObjDAL.ExecuteSelectStatement("SELECT S.SupplierID,S.SupplierName,S.CountryID,C.CountryName,(CASE S.ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END) ActiveStatus,S.Phone,S.EmailID,S.BankName,S.BankAccountNo,S.BankAddress " + "FROM " + clsUtility.DBName + ".[dbo].[SupplierMaster] S " + "LEFT OUTER JOIN " + clsUtility.DBName + ".[dbo].[CountryMaster] C ON S.CountryID = C.CountryID"); if (ObjUtil.ValidateTable(dt)) { dataGridView1.DataSource = dt; } else { dataGridView1.DataSource = null; } }
private void LoadData() { DataTable dt = null; dt = ObjDAL.ExecuteSelectStatement("SELECT sm.SizeTypeID,sm.SizeTypeName,cm.CategoryID,cm.CategoryName" + ", (CASE sm.ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END) " + "ActiveStatus FROM SizeTypeMaster sm " + " LEFT JOIN CategoryMaster cm ON sm.CategoryID = cm.CategoryID"); if (ObjUtil.ValidateTable(dt)) { dgvSizeTypeMaster.DataSource = dt; } else { dgvSizeTypeMaster.DataSource = null; } }
private void LoadData() { ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input); DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_ReceiveBranch_Transfer_List"); if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (ObjUtil.ValidateTable(dt)) { dgvProductDetails.DataSource = dt; } else { dgvProductDetails.DataSource = null; } } }
private void LoadData() { ObjUtil.SetDataGridProperty(dgvSizeTypeMaster, DataGridViewAutoSizeColumnsMode.Fill); DataTable dt = null; dt = ObjDAL.ExecuteSelectStatement("SELECT sm.SizeTypeID,sm.SizeTypeName,cm.CategoryID,cm.CategoryName" + ", (CASE WHEN sm.ActiveStatus = 1 THEN 'Active' WHEN sm.ActiveStatus = 0 THEN 'InActive' END) " + "ActiveStatus FROM SizeTypeMaster sm " + " LEFT JOIN CategoryMaster cm ON sm.CategoryID = cm.CategoryID"); if (ObjUtil.ValidateTable(dt)) { dgvSizeTypeMaster.DataSource = dt; } else { dgvSizeTypeMaster.DataSource = null; } }
private void txtCategoryName_TextChanged(object sender, EventArgs e) { try { if (isEdit) { return; } if (ObjUtil.IsControlTextEmpty(txtName)) { txtUserID.Clear(); ObjUtil.CloseAutoExtender(); return; } DataTable dt = ObjCon.ExecuteSelectStatement("SELECT USERNAME,USERID FROM " + clsUtility.DBName + ".dbo.UserManagement WITH(NOLOCK) WHERE IsAdmin=0 AND UserName LIKE '" + txtName.Text + "%'"); if (ObjUtil.ValidateTable(dt)) { ObjUtil.SetControlData(txtName, "USERNAME"); ObjUtil.SetControlData(txtUserID, "USERID"); ObjUtil.ShowDataPopup(dt, txtName, this, grpUserName); if (ObjUtil.GetDataPopup() != null && ObjUtil.GetDataPopup().DataSource != null) { // if there is only one column ObjUtil.GetDataPopup().AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; if (ObjUtil.GetDataPopup().ColumnCount > 0) { ObjUtil.GetDataPopup().Columns["UserID"].Visible = false; ObjUtil.SetDataPopupSize(200, 0); } } //ObjUtil.GetDataPopup().CellClick += Sales_Bill_Details_CellClick; //ObjUtil.GetDataPopup().KeyDown += Sales_Bill_Details_KeyDown; } else { txtUserID.Clear(); ObjUtil.CloseAutoExtender(); } } catch (Exception) { } }
private void LoadData() { DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_Customer"); if (ObjUtil.ValidateDataSet(ds)) { DataTable dt = ds.Tables[0]; if (ObjUtil.ValidateTable(dt)) { dgvCustomerMaster.DataSource = dt; } else { dgvCustomerMaster.DataSource = null; } } else { dgvCustomerMaster.DataSource = null; } }