public int UpdateMessageStatus(AlertsBO alertsBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(alertsBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "Update MessageSentDetails set downloadStatus = 'true' where SentUserId ='" + alertsBO.UserId + "'"; SqlCommand command2 = sqlHelper.CreateCommand(CommandType.Text); command2.CommandText = "Update VWSL_Message set downloadStatus = 'true' where SentUserId ='" + alertsBO.UserId + "'"; sqlHelper.ExecuteScalar(command); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command2))); }
internal int UpdateBeatPlanDeviation(BeatPlanDeviationBO beatPlanDeviationBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(beatPlanDeviationBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspUpdateBeatPlanDeviation"; sqlHelper.AddParameter(command, "@BeatPlanId", beatPlanDeviationBO.BeatPlanId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@UserId", beatPlanDeviationBO.UserId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@latitude", beatPlanDeviationBO.Latitude, ParameterDirection.Input); sqlHelper.AddParameter(command, "@longitude", beatPlanDeviationBO.Longitude, ParameterDirection.Input); sqlHelper.AddParameter(command, "@MobileRefNo", beatPlanDeviationBO.MobileReferenceNo, ParameterDirection.Input); sqlHelper.AddParameter(command, "@GpsSource", beatPlanDeviationBO.source, ParameterDirection.Input); sqlHelper.AddParameter(command, "@DeviationReasonId", beatPlanDeviationBO.DeviationReasonId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@MobileTransactionDate", beatPlanDeviationBO.MobileTransactionDate, ParameterDirection.Input); if (!string.IsNullOrEmpty(beatPlanDeviationBO.SyncDate)) { sqlHelper.AddParameter(command, "@SyncDate", beatPlanDeviationBO.SyncDate, ParameterDirection.Input); } if (!string.IsNullOrEmpty(beatPlanDeviationBO.signalStrength)) { sqlHelper.AddParameter(command, "@signalStrength", beatPlanDeviationBO.signalStrength, ParameterDirection.Input); } return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int isExpenseTransactionNeeded(MobileControlsBO mobileControlsBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(mobileControlsBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT status FROM MobilePrivilegeControls where ControlId = (select ControlId from MobileControl where ControlName like '%btnExpenseAdvance%')"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal string isValidDeleiveryDateForMilma(ParameterSettingsBO parameterSettingsBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(parameterSettingsBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "validateMilmaDeliveryDate"; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal string getOrganistionEmail(EmailBO emailBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(emailBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT email FROM organization WHERE organizationId = (SELECT TOP 1 organizationid FROM UserOrganization WHERE userId =" + emailBO.id + ")"; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal int RequireSMSForcollection(ParameterSettingsBO parameterSettingsBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(parameterSettingsBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "select IsRequiredSMSCollection from parametersettings"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int getRequireErb(ParameterSettingsBO parameterSettingsBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(parameterSettingsBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT RequireERP FROM ParameterSettings"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int getSqliteCount(ParameterSettingsBO dBCredentialBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(dBCredentialBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "select SqliteCount from ParameterSettings"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal string GetTodaysExpense(ExpenseBO expenseBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(expenseBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT ISNULL(SUM(AMOUNT),0) FROM expenseentry where CONVERT(varchar(100),ExpenseDate,103) = CONVERT(varchar(100),getdate(),103) and userId = " + expenseBO.UserId; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal string GetTodaysRemittance(RemittanceBO remittanceBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(remittanceBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT ISNULL(SUM(AMOUNT),0) FROM Remittance where CONVERT(varchar(100),RemittedDate,103) = CONVERT(varchar(100),getdate(),103) and RemittedBy = " + remittanceBO.UserId; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal string GetProcessName(SignatureBO signatureBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(signatureBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "select ProcessName from Process where ProcessId = " + signatureBO.ProcessId; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal int isCustomizedImageNeeded(QuatationDetailsBO boObject) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(boObject.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT status FROM MobilePrivilegeControls where ControlId = (select ControlId from MobileControl where ControlName like '%btnLogoForQuotationPDF%')"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int getUserValidity(DBCredentialBO dBCredentialBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(dBCredentialBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "select Active from [User] where UserId = '" + dBCredentialBO.UserID + "'"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
public int getNewCustomerId(NewCustomerBO newCustomerBO, string id) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(newCustomerBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "select NewCustomerId from NewCustomer where TempMShopId ='" + id + "'"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int getOrderCorrectionStatusId(ProcessStatusBO processStatusBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(processStatusBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT Status FROM ProcessStatus where StatusDescription = 'Withheld'"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal string GetTodaysCashCollection(CollectionBO collectionBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(collectionBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "SELECT ISNULL(SUM(Amount),0) Amount from paymentheader where CONVERT(varchar(100),paymentdate,103) = CONVERT(varchar(100),getdate(),103) and paymentModeId = 1 and CollectedBy = " + collectionBO.CollectedBy; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal string getHeaderNameForPDF(QuatationDetailsBO boObject, string productId) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(boObject.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); command.CommandText = "Select Classification from Classification where ClassificationId = (Select ClassificationId from ProductAttribute where ProductAttributeId = " + productId + ")"; return(Convert.ToString(sqlHelper.ExecuteScalar(command))); }
internal int GetShopCount(ShopBO shopBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(shopBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetShopCount"; sqlHelper.AddParameter(command, "@UserId", shopBO.UserId, ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal bool GetParameterConfigurations(TargetVsAchievementBO targetVsAchievementBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(targetVsAchievementBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspUploadTargetVsAchievement"; sqlHelper.AddParameter(command, "@Mode", "P", ParameterDirection.Input); return((bool)sqlHelper.ExecuteScalar(command)); }
internal int GetCollectionCount(CollectionBO collectionBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(collectionBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetCollectionCount"; sqlHelper.AddParameter(command, "@UserId", collectionBO.UserId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@OrderDate", collectionBO.InstrumentDate.ToString(), ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int GetVersionLog(VersionLogBO versionLogBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(versionLogBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetPreviousDayOrdersCount"; sqlHelper.AddParameter(command, "@UserId", versionLogBO.UserId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@OrderDate", versionLogBO.VersionNo, ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int GetFollowUp(FollowupBO followupBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(followupBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetFollowupsCount"; sqlHelper.AddParameter(command, "@UserId", followupBO.UserId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@FollowUpDate", followupBO.FollowUpDate.ToString(), ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int GetNewCustomer(NewCustomerBO newCustomerBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(newCustomerBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetPreviousDayOrdersCount"; sqlHelper.AddParameter(command, "@UserId", newCustomerBO.reportedBy, ParameterDirection.Input); sqlHelper.AddParameter(command, "@OrderDate", newCustomerBO.reportedDate, ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal int GetTargetAmount(SalesmanTargetBO targetBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(targetBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetTargetAmount"; sqlHelper.AddParameter(command, "@UserId", targetBO.SalesManId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@Date", targetBO.Month, ParameterDirection.Input); return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }
internal Int64 GetActualAmount(OrderBO orderBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(orderBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspWSGetActualAmount"; sqlHelper.AddParameter(command, "@UserId", orderBO.OrderTakenBy, ParameterDirection.Input); sqlHelper.AddParameter(command, "@OrderDate", orderBO.OrderDate, ParameterDirection.Input); return(Convert.ToInt64(sqlHelper.ExecuteScalar(command))); }
internal Boolean IsModifiedDb(GenarateDbBO genarateDbBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(genarateDbBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "UpdateGenerateDbLog"; sqlHelper.AddParameter(command, "@Mode", 2, ParameterDirection.Input); sqlHelper.AddParameter(command, "@UserId", genarateDbBO.UserId, ParameterDirection.Input); sqlHelper.AddParameter(command, "@DbName", genarateDbBO.DbName, ParameterDirection.Input); return(Convert.ToBoolean(sqlHelper.ExecuteScalar(command))); }
internal Boolean IsMasterDataModified(CheckDbBO checkDbBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(checkDbBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspCheckMasterDataModified"; sqlHelper.AddParameter(command, "@DbName", checkDbBO.DbName, ParameterDirection.Input); if (checkDbBO.DtLstModifiedDate != null) { sqlHelper.AddParameter(command, "@LastModifiedDate", checkDbBO.DtLstModifiedDate.ToString(), ParameterDirection.Input); } sqlHelper.AddParameter(command, "@UserId", checkDbBO.UserId, ParameterDirection.Input); return(Convert.ToBoolean(sqlHelper.ExecuteScalar(command))); }
public string getPrinterName(PrinterNameBO printerNameBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(printerNameBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); try { command.CommandText = "SELECT PrinterName FROM PrinterConfig where UserId = '" + printerNameBO.UserId + "'"; return((sqlHelper.ExecuteScalar(command)).ToString()); } catch (Exception ex) { return("No Printer"); } }
internal int GetUserStoreId(StockBO stockBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(stockBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.Text); try { command.CommandText = "SELECT st.storeid from store st INNER JOIN Organization org ON org.organizationId = st.organizationId INNER JOIN UserOrganization uo ON uo.organizationid = org.organizationid and uo.userid = '" + stockBO.UserId + "'"; return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); } catch (Exception ex) { return(0); } }
internal int UpdateCashSettlementUser(CashSettlementBO cashSettlementBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(cashSettlementBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "uspCashSettlement"; sqlHelper.AddParameter(command, "@Mode", cashSettlementBO.Mode, ParameterDirection.Input); sqlHelper.AddParameter(command, "@UserId", cashSettlementBO.UserId, ParameterDirection.Input); if (!String.IsNullOrEmpty(cashSettlementBO.PaymentHeaderId)) { sqlHelper.AddParameter(command, "@PaymentHeaderId", cashSettlementBO.PaymentHeaderId, ParameterDirection.Input); } if (!String.IsNullOrEmpty(cashSettlementBO.Cash)) { sqlHelper.AddParameter(command, "@CashAmount", cashSettlementBO.Cash, ParameterDirection.Input); } else { sqlHelper.AddParameter(command, "@CashAmount", "0", ParameterDirection.Input); } sqlHelper.AddParameter(command, "@MobileReferenceNo", cashSettlementBO.MobileReferenceNo, ParameterDirection.Input); sqlHelper.AddParameter(command, "@mobileTransactionDate", cashSettlementBO.MobileTransactionDate, ParameterDirection.Input); sqlHelper.AddParameter(command, "@latitude", cashSettlementBO.Latitude, ParameterDirection.Input); sqlHelper.AddParameter(command, "@longitude", cashSettlementBO.Longitude, ParameterDirection.Input); sqlHelper.AddParameter(command, "@GpsSource", cashSettlementBO.gpsSource, ParameterDirection.Input); if (!String.IsNullOrEmpty(cashSettlementBO.SignalStrength)) { sqlHelper.AddParameter(command, "@SignalStrength", cashSettlementBO.SignalStrength, ParameterDirection.Input); } if (!String.IsNullOrEmpty(cashSettlementBO.NetworkProvider)) { sqlHelper.AddParameter(command, "@NetworkProvider", cashSettlementBO.NetworkProvider, ParameterDirection.Input); } sqlHelper.AddParameter(command, "@InstrumentNo", cashSettlementBO.InstrumentNo, ParameterDirection.Input); sqlHelper.AddParameter(command, "@RemittedBy", cashSettlementBO.RemittedBy, ParameterDirection.Input); if (!String.IsNullOrEmpty(cashSettlementBO.ServerSyncDate)) { sqlHelper.AddParameter(command, "@ServerSyncDate", cashSettlementBO.ServerSyncDate, ParameterDirection.Input); } if (!String.IsNullOrEmpty(cashSettlementBO.MobileSyncDate)) { sqlHelper.AddParameter(command, "@MobileSyncDate", cashSettlementBO.MobileSyncDate, ParameterDirection.Input); } return(Convert.ToInt32(sqlHelper.ExecuteScalar(command))); }