示例#1
0
        internal int UpdateCollection(CollectionBO collectionBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(collectionBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            if (collectionBO.BillNo.Equals(""))
            {
                command.CommandText = "uspPaymentHeader"; //"uspWSUpdateCollectionDetails";
                sqlHelper.AddParameter(command, "@Mode", collectionBO.Mode, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ShopID", collectionBO.ShopId, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@CollectedBy", collectionBO.CollectedBy, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@Amount", collectionBO.TotalAmount, ParameterDirection.Input);
                //sqlHelper.AddParameter(command, "@InvoiceNo", collectionBO.InvoiceNo, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ReceiptNo", collectionBO.ReceiptNo, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@PaymentModeId", collectionBO.PaymentModeId, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@InstrumentNo", collectionBO.InstrumentNo, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@Narration", collectionBO.Narration, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@InstrumentDate", collectionBO.InstrumentDate.ToString(), ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@lattitude", collectionBO.Latitude, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@longitude", collectionBO.Longitude, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@processName", collectionBO.ProcessName, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@mobilePaymentDate", collectionBO.MobilePaymentDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@MobileReferenceNo", collectionBO.MobileReferenceNo, ParameterDirection.Input);
                if (collectionBO.signalStrength != null && collectionBO.signalStrength != string.Empty && collectionBO.signalStrength != "")
                {
                    sqlHelper.AddParameter(command, "@signalStrength", collectionBO.signalStrength, ParameterDirection.Input);
                }
                if (collectionBO.networkProvider != null && collectionBO.networkProvider != string.Empty && collectionBO.networkProvider != "")
                {
                    sqlHelper.AddParameter(command, "@networkProvider", collectionBO.networkProvider, ParameterDirection.Input);
                }
                if (collectionBO.CollectionDiscount != "")
                {
                    sqlHelper.AddParameter(command, "@CollectionDiscount", collectionBO.CollectionDiscount, ParameterDirection.Input);
                }

                sqlHelper.AddParameter(command, "@GpsSource", collectionBO.GpsSource, ParameterDirection.Input);
                if (collectionBO.BankId != 0)
                {
                    sqlHelper.AddParameter(command, "@BankId", collectionBO.BankId, ParameterDirection.Input);
                }
                if (collectionBO.IsRemitted.Equals("1"))
                {
                    if (!collectionBO.RemittedAt.Equals(""))
                    {
                        sqlHelper.AddParameter(command, "@IsRemitted", collectionBO.IsRemitted, ParameterDirection.Input);
                        sqlHelper.AddParameter(command, "@RemittedAt", collectionBO.RemittedAt, ParameterDirection.Input);
                        sqlHelper.AddParameter(command, "@RemittedDate", DateTime.Now, ParameterDirection.Input);
                    }
                }
                if (collectionBO.MobileSyncDate != "" && collectionBO.MobileDate != "")
                {
                    sqlHelper.AddParameter(command, "@MobileSyncDate", collectionBO.MobileDate, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@ServerSyncDate", collectionBO.MobileSyncDate, ParameterDirection.Input);
                }
                if (!string.IsNullOrEmpty(collectionBO.TempShopId))
                {
                    sqlHelper.AddParameter(command, "@TempShopId", collectionBO.TempShopId, ParameterDirection.Input);
                }
            }
            else
            {
                if (collectionBO.IsMultipleDiscountCollection.Equals("true"))
                {
                    command.CommandText = "setBillWiseCollectionWithDiscount";
                    sqlHelper.AddParameter(command, "@Mode", 4, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@ShopId", collectionBO.ShopId, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@CollectedBy", collectionBO.CollectedBy, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@AmountSet", collectionBO.Amount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@ReceiptNo", collectionBO.ReceiptNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@PaymentModeId", collectionBO.PaymentModeId, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@InstrumentNo", collectionBO.InstrumentNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@Narration", collectionBO.Narration, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@InstrumentDate", collectionBO.InstrumentDate.ToString(), ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@lattitude", collectionBO.Latitude, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@longitude", collectionBO.Longitude, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@processName", collectionBO.ProcessName, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@BillNoSet", collectionBO.BillNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@discountSet", collectionBO.Discount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@OsBalanceSet", collectionBO.OsBalance, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@Amount", collectionBO.TotalAmount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@rdDiscountSet", collectionBO.Discount1, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@sdDiscountSet", collectionBO.Discount2, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@cdDiscountSet", collectionBO.Discount3, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@mobilePaymentDate", collectionBO.MobilePaymentDate, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@MobileReferenceNo", collectionBO.MobileReferenceNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@GpsSource", collectionBO.GpsSource, ParameterDirection.Input);
                    if (collectionBO.signalStrength != null && collectionBO.signalStrength != string.Empty && collectionBO.signalStrength != "")
                    {
                        sqlHelper.AddParameter(command, "@signalStrength", collectionBO.signalStrength, ParameterDirection.Input);
                    }
                    if (collectionBO.networkProvider != null && collectionBO.networkProvider != string.Empty && collectionBO.networkProvider != "")
                    {
                        sqlHelper.AddParameter(command, "@networkProvider", collectionBO.networkProvider, ParameterDirection.Input);
                    }
                    //sqlHelper.AddParameter(command, "@mobilePaymentDate", DateTime.Now.ToString(), ParameterDirection.Input);
                    if (collectionBO.BankId != 0)
                    {
                        sqlHelper.AddParameter(command, "@BankIdValue", collectionBO.BankId, ParameterDirection.Input);
                    }
                    if (collectionBO.MobileSyncDate != "" && collectionBO.MobileDate != "")
                    {
                        sqlHelper.AddParameter(command, "@MobileSyncDate", collectionBO.MobileDate, ParameterDirection.Input);
                        sqlHelper.AddParameter(command, "@ServerSyncDate", collectionBO.MobileSyncDate, ParameterDirection.Input);
                    }
                    if (!string.IsNullOrEmpty(collectionBO.TempShopId))
                    {
                        sqlHelper.AddParameter(command, "@TempShopId", collectionBO.TempShopId, ParameterDirection.Input);
                    }
                }
                else
                {
                    command.CommandText = "getBillNoForBillWiseCollection";
                    sqlHelper.AddParameter(command, "@Mode", 2, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@ShopID", collectionBO.ShopId, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@CollectedBy", collectionBO.CollectedBy, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@AmountSet", collectionBO.Amount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@ReceiptNo", collectionBO.ReceiptNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@PaymentModeId", collectionBO.PaymentModeId, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@InstrumentNo", collectionBO.InstrumentNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@Narration", collectionBO.Narration, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@InstrumentDate", collectionBO.InstrumentDate.ToString(), ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@lattitude", collectionBO.Latitude, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@longitude", collectionBO.Longitude, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@processName", collectionBO.ProcessName, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@BillNoSet", collectionBO.BillNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@discountSet", collectionBO.Discount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@OsBalanceSet", collectionBO.OsBalance, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@Amount", collectionBO.TotalAmount, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@mobilePaymentDate", collectionBO.MobilePaymentDate, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@MobileReferenceNo", collectionBO.MobileReferenceNo, ParameterDirection.Input);
                    sqlHelper.AddParameter(command, "@GpsSource", collectionBO.GpsSource, ParameterDirection.Input);

                    //sqlHelper.AddParameter(command, "@mobilePaymentDate", DateTime.Now.ToString(), ParameterDirection.Input);
                    if (collectionBO.BankId != 0)
                    {
                        sqlHelper.AddParameter(command, "@BankId", collectionBO.BankId, ParameterDirection.Input);
                    }
                    if (collectionBO.MobileSyncDate != "" && collectionBO.MobileDate != "")
                    {
                        sqlHelper.AddParameter(command, "@MobileSyncDate", collectionBO.MobileDate, ParameterDirection.Input);
                        sqlHelper.AddParameter(command, "@ServerSyncDate", collectionBO.MobileSyncDate, ParameterDirection.Input);
                    }
                    if (!string.IsNullOrEmpty(collectionBO.TempShopId))
                    {
                        sqlHelper.AddParameter(command, "@TempShopId", collectionBO.TempShopId, ParameterDirection.Input);
                    }
                }
            }


            //sqlHelper.AddParameter(command, "@Discount", collectionBO.Discount, ParameterDirection.Input); ;
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#2
0
        internal int updateLeave(LeaveBO leaveBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(leaveBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspLeaveRequest";
            sqlHelper.AddParameter(command, "@Mode", "1", ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", leaveBO.userId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ReasonId", leaveBO.resonId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileTransactionDate", leaveBO.mobileCaptureDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@LeaveFrom", leaveBO.leaveFrom, ParameterDirection.Input);
            if (leaveBO.LeaveSessionIdFrom != "" && leaveBO.LeaveSessionIdFrom != "0")
            {
                sqlHelper.AddParameter(command, "@LeaveSessionIdFrom", leaveBO.LeaveSessionIdFrom, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@LeaveTo", leaveBO.leaveTo, ParameterDirection.Input);
            if (leaveBO.LeaveSessionIdTo != "" && leaveBO.LeaveSessionIdTo != "0")
            {
                sqlHelper.AddParameter(command, "@LeaveSessionIdTo", leaveBO.LeaveSessionIdTo, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@latitude", leaveBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", leaveBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", leaveBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobRefNo", leaveBO.MobRefNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", leaveBO.GpsSource, ParameterDirection.Input);
            if (leaveBO.ServerSyncDate != "" && leaveBO.MobileSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", leaveBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", leaveBO.ServerSyncDate, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(leaveBO.Remarks))
            {
                sqlHelper.AddParameter(command, "@Remarks", leaveBO.Remarks, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#3
0
        internal string UpdateOrder(OrderBO orderBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(orderBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText    = "OrderTransaction";
            command.CommandTimeout = orderBO.CommandTimeout;
            sqlHelper.AddParameter(command, "@Mode", orderBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", orderBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopID", orderBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProductData", orderBO.ProductData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@quantitydata", orderBO.QuantityData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UnitData", orderBO.UnitData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Rate", orderBO.Rate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", orderBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", orderBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", orderBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@OrderDate", orderBO.OrderDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@AmountFromMobile", orderBO.TotalAmount, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileTransactionDate", orderBO.mobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileReferenceNo", orderBO.mobileReferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Priority", orderBO.Priority, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Length", orderBO.length, ParameterDirection.Input);
            if (orderBO.SpecialInstnSet != null && orderBO.SpecialInstnSet != string.Empty && orderBO.SpecialInstnSet != "")
            {
                sqlHelper.AddParameter(command, "@SpecialInstnSet", orderBO.SpecialInstnSet, ParameterDirection.Input);
            }
            if (orderBO.SchemeId != null && orderBO.SchemeId > 0)
            {
                sqlHelper.AddParameter(command, "@SchemeId", orderBO.SchemeId, ParameterDirection.Input);
            }
            if (orderBO.OtherInstn != null && orderBO.OtherInstn != string.Empty && orderBO.OtherInstn != "")
            {
                sqlHelper.AddParameter(command, "@OtherInstn", orderBO.OtherInstn, ParameterDirection.Input);
            }

            if (orderBO.SiteAddress != null && orderBO.SiteAddress != string.Empty && orderBO.SiteAddress != "")
            {
                sqlHelper.AddParameter(command, "@SiteAddress", orderBO.SiteAddress, ParameterDirection.Input);
            }
            if (orderBO.ContactPerson != null && orderBO.ContactPerson != string.Empty && orderBO.ContactPerson != "")
            {
                sqlHelper.AddParameter(command, "@ContactPerson", orderBO.ContactPerson, ParameterDirection.Input);
            }
            if (orderBO.Phone != null && orderBO.Phone != string.Empty && orderBO.Phone != "")
            {
                sqlHelper.AddParameter(command, "@Phone", orderBO.Phone, ParameterDirection.Input);
            }
            if (orderBO.FirstDiscount != null && orderBO.FirstDiscount != string.Empty && orderBO.FirstDiscount != "")
            {
                sqlHelper.AddParameter(command, "@FirstDiscount", orderBO.FirstDiscount, ParameterDirection.Input);
            }
            if (orderBO.SecondDiscount != null && orderBO.SecondDiscount != string.Empty && orderBO.SecondDiscount != "")
            {
                sqlHelper.AddParameter(command, "@SecondDiscount", orderBO.SecondDiscount, ParameterDirection.Input);
            }

            if (orderBO.BankName != null && orderBO.BankName != string.Empty && orderBO.BankName != "")
            {
                sqlHelper.AddParameter(command, "@BankName", orderBO.BankName, ParameterDirection.Input);
            }
            if (orderBO.unitDiscount != null && orderBO.unitDiscount != string.Empty && orderBO.unitDiscount != "")
            {
                sqlHelper.AddParameter(command, "@UnitDisc", orderBO.unitDiscount, ParameterDirection.Input);
            }
            if (orderBO.freeQuantity != null && orderBO.freeQuantity != string.Empty && orderBO.freeQuantity != "")
            {
                sqlHelper.AddParameter(command, "@FreeQty", orderBO.freeQuantity, ParameterDirection.Input);
            }
            if (orderBO.mobileDiscFlag != null && orderBO.mobileDiscFlag != string.Empty && orderBO.mobileDiscFlag != "")
            {
                sqlHelper.AddParameter(command, "@MobileDiscFlag", orderBO.mobileDiscFlag, ParameterDirection.Input);
            }
            if (orderBO.orderDisc != null && orderBO.orderDisc != string.Empty && orderBO.orderDisc != "")
            {
                sqlHelper.AddParameter(command, "@OrderDisc", orderBO.orderDisc, ParameterDirection.Input);
            }

            if (orderBO.source != null && orderBO.source != string.Empty && orderBO.source != "")
            {
                sqlHelper.AddParameter(command, "@GpsSource", Convert.ToInt32(orderBO.source), ParameterDirection.Input);
            }
            if (orderBO.userRef != null && orderBO.userRef != string.Empty && orderBO.userRef != "")
            {
                sqlHelper.AddParameter(command, "@UserRef", orderBO.userRef, ParameterDirection.Input);
            }

            if (orderBO.paymentReferenceNo > 0)
            {
                sqlHelper.AddParameter(command, "@PaymentNo", orderBO.paymentReferenceNo, ParameterDirection.Input);
            }
            if (Convert.ToInt32(orderBO.distributorId) != 0)
            {
                sqlHelper.AddParameter(command, "@DistributorIdFromMobile", Convert.ToInt32(orderBO.distributorId), ParameterDirection.Input);
            }

            if (!orderBO.syncDate.Equals(String.Empty))
            {
                sqlHelper.AddParameter(command, "@SyncDate", orderBO.syncDate, ParameterDirection.Input);
            }

            if (orderBO.orderDiscountIds != null && orderBO.orderDiscountIds != string.Empty && orderBO.orderDiscountIds != "")
            {
                sqlHelper.AddParameter(command, "@orderDiscountIds", orderBO.orderDiscountIds, ParameterDirection.Input);
            }
            if (orderBO.orderDiscountVals != null && orderBO.orderDiscountVals != string.Empty && orderBO.orderDiscountVals != "")
            {
                sqlHelper.AddParameter(command, "@OrderDiscountValues", orderBO.orderDiscountVals, ParameterDirection.Input);
            }
            if (orderBO.deliveryDate != null && orderBO.deliveryDate != string.Empty && orderBO.deliveryDate != "")
            {
                sqlHelper.AddParameter(command, "@DeliveryDate", orderBO.deliveryDate, ParameterDirection.Input);
            }
            if (orderBO.schemeFromMobile != null && orderBO.schemeFromMobile != string.Empty && orderBO.schemeFromMobile != "")
            {
                sqlHelper.AddParameter(command, "@schemeids", orderBO.schemeFromMobile, ParameterDirection.Input);
            }
            if (orderBO.paymentMode > 0)
            {
                sqlHelper.AddParameter(command, "@PaymentMode", orderBO.paymentMode, ParameterDirection.Input);
            }
            if (orderBO.mobileDate != null && orderBO.mobileDate != string.Empty && orderBO.mobileDate != "")
            {
                sqlHelper.AddParameter(command, "@mobileSyncDate", orderBO.mobileDate, ParameterDirection.Input);
            }
            if (orderBO.signalStrength != null && orderBO.signalStrength != string.Empty && orderBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", orderBO.signalStrength, ParameterDirection.Input);
            }
            if (orderBO.RequestedQuantityData != null && orderBO.RequestedQuantityData != string.Empty && orderBO.RequestedQuantityData != "")
            {
                sqlHelper.AddParameter(command, "@RequestedQuantityData", orderBO.RequestedQuantityData, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(orderBO.TempShopId))
            {
                sqlHelper.AddParameter(command, "@TempShopId", orderBO.TempShopId, ParameterDirection.Input);
            }
            if (orderBO.TotalDiscount != null && orderBO.TotalDiscount != string.Empty && orderBO.TotalDiscount != "")
            {
                sqlHelper.AddParameter(command, "@TotalDiscountData", orderBO.TotalDiscount, ParameterDirection.Input);
            }
            if (orderBO.TaxAmount != null && orderBO.TaxAmount != string.Empty && orderBO.TaxAmount != "")
            {
                sqlHelper.AddParameter(command, "@TaxAmountData", orderBO.TaxAmount, ParameterDirection.Input);
            }
            //New
            if (orderBO.networkProvider != null && orderBO.networkProvider != string.Empty && orderBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", orderBO.networkProvider, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(orderBO.InvoiceNo))
            {
                sqlHelper.AddParameter(command, "@InvoiceNo", orderBO.InvoiceNo, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(orderBO.IsDefaultDistributor))
            {
                sqlHelper.AddParameter(command, "@IsDefaultDistributor", orderBO.IsDefaultDistributor, ParameterDirection.Input);
            }
            SqlParameter outparam = command.Parameters.Add("@OutputMessage", SqlDbType.VarChar);

            outparam.Size      = 50;
            outparam.Direction = ParameterDirection.Output;
            sqlHelper.ExecuteNonQuery(command);
            string result     = command.Parameters["@OutputMessage"].Value.ToString();
            string id         = result.Split(':')[0];
            int    returnData = 0;

            try
            {
                returnData = Convert.ToInt32(id);
            }
            catch
            {
                returnData = 0;
            }
            return(result);
        }
示例#4
0
        internal int updatePjp(PjpBO pjpBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(pjpBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspUpdatePjp";
            sqlHelper.AddParameter(command, "@Mode", pjpBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@DateList", pjpBO.Date, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RouteList", pjpBO.Routes, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileTransactionDate", pjpBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RemarkList", pjpBO.Remarks, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@CommonRemarks", pjpBO.CommonRemarks, ParameterDirection.Input);
            if (pjpBO.Mode == "1")
            {
                sqlHelper.AddParameter(command, "@UserId", pjpBO.UserId, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@Status", pjpBO.Status, ParameterDirection.Input);
            }
            else
            {
                sqlHelper.AddParameter(command, "@UserIdList", pjpBO.UserIdList, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@StatusList", pjpBO.StatusList, ParameterDirection.Input);
                if (pjpBO.MobileSyncDate != "")
                {
                    sqlHelper.AddParameter(command, "@MobileSyncDate", pjpBO.MobileSyncDate, ParameterDirection.Input);
                }
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#5
0
        internal int UpdateExpense(ExpenseBO expenseBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(expenseBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspExpense";
            sqlHelper.AddParameter(command, "@Mode", expenseBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@QuantityList", expenseBO.Quantity, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", expenseBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Parameters", expenseBO.Parameters, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", expenseBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", expenseBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", expenseBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileTransactionDate", expenseBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileReferenceNo", expenseBO.mobilereferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Remarks", expenseBO.Remarks, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", expenseBO.GpsSource, ParameterDirection.Input);

            if (!string.IsNullOrEmpty(expenseBO.Field1))
            {
                sqlHelper.AddParameter(command, "@Field1List", expenseBO.Field1, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.Field2))
            {
                sqlHelper.AddParameter(command, "@Field2List", expenseBO.Field2, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.Field3))
            {
                sqlHelper.AddParameter(command, "@Field3List", expenseBO.Field3, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.Field4))
            {
                sqlHelper.AddParameter(command, "@Field4List", expenseBO.Field4, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.Field5))
            {
                sqlHelper.AddParameter(command, "@Field5List", expenseBO.Field5, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.ExpenseDate))
            {
                sqlHelper.AddParameter(command, "@ExpenseDateList", expenseBO.ExpenseDate, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(expenseBO.UniqueKey))
            {
                sqlHelper.AddParameter(command, "@UniqueKeyList", expenseBO.UniqueKey, ParameterDirection.Input);
            }
            if (expenseBO.ServerSyncDate != "" && expenseBO.MobileSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", expenseBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", expenseBO.ServerSyncDate, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#6
0
        internal void SaveShopLocation(ShopLocationBO shopLocationBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(shopLocationBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspUpdateShopLocation";
            sqlHelper.AddParameter(command, "@UserId", shopLocationBO.UserId, ParameterDirection.Input);

            sqlHelper.AddParameter(command, "@lat", shopLocationBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@long", shopLocationBO.longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@currrentLat", shopLocationBO.currentLatitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@currrentLong", shopLocationBO.currentlongitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", shopLocationBO.GPSSource, ParameterDirection.Input);
            if (shopLocationBO.ShopId != null && shopLocationBO.ShopId != 0)
            {
                sqlHelper.AddParameter(command, "@ShopId", shopLocationBO.ShopId, ParameterDirection.Input);
            }
            if (shopLocationBO.mobileDate != null && shopLocationBO.mobileDate != string.Empty && shopLocationBO.mobileDate != "")
            {
                sqlHelper.AddParameter(command, "@mobileSyncDate", shopLocationBO.mobileDate, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@MobileRefNo", shopLocationBO.MobileReferenceNo, ParameterDirection.Input);

            if (shopLocationBO.signalStrength != null && shopLocationBO.signalStrength != string.Empty && shopLocationBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", shopLocationBO.signalStrength, ParameterDirection.Input);
            }
            if (shopLocationBO.networkProvider != null && shopLocationBO.networkProvider != string.Empty && shopLocationBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", shopLocationBO.networkProvider, ParameterDirection.Input);
            }
            if (shopLocationBO.TempShopId != null && shopLocationBO.TempShopId != string.Empty && shopLocationBO.TempShopId != "")
            {
                sqlHelper.AddParameter(command, "@TempShopId", shopLocationBO.TempShopId, ParameterDirection.Input);
            }
            sqlHelper.ExecuteDataSet(command);
        }
示例#7
0
        internal int UpdateBTLDetails(BTLActivityBO btlActivityBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(btlActivityBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspBTLActivity";
            sqlHelper.AddParameter(command, "@Mode", btlActivityBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", btlActivityBO.UserId, ParameterDirection.Input);
            if (!string.IsNullOrEmpty(btlActivityBO.OrganizationId))
            {
                sqlHelper.AddParameter(command, "@OrganizationId", btlActivityBO.OrganizationId, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@BTLActivityId", btlActivityBO.BTLActivityId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ConfigFieldIds", btlActivityBO.ConfigFieldIds, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ConfigFieldValues", btlActivityBO.ConfigFieldValues, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Latitude", btlActivityBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Longitude", btlActivityBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileTransactionDate", btlActivityBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileReferenceNo", btlActivityBO.MobileReferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", btlActivityBO.GpsSource, ParameterDirection.Input);
            if (!string.IsNullOrEmpty(btlActivityBO.Attendees))
            {
                sqlHelper.AddParameter(command, "@Attendees", btlActivityBO.Attendees, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(btlActivityBO.MobileSyncDate))
            {
                sqlHelper.AddParameter(command, "@Syncdate", btlActivityBO.MobileSyncDate, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#8
0
        internal int UpdateParameters(CompetitorBO competitorBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(competitorBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "updateParameters";
            sqlHelper.AddParameter(command, "@ShopId", competitorBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", competitorBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProductID", competitorBO.ProductId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ParameterList", competitorBO.ParameterList, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@QuantityData", competitorBO.QuantityData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", competitorBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", competitorBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", competitorBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileTransactionDate", competitorBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobRefNo", competitorBO.MobRefNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", competitorBO.GpsSource, ParameterDirection.Input);
            if (competitorBO.MobileSyncDate != "" && competitorBO.ServerSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", competitorBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", competitorBO.ServerSyncDate, ParameterDirection.Input);
            }
            if (competitorBO.signalStrength != null && competitorBO.signalStrength != string.Empty && competitorBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", competitorBO.signalStrength, ParameterDirection.Input);
            }
            if (competitorBO.networkProvider != null && competitorBO.networkProvider != string.Empty && competitorBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", competitorBO.networkProvider, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#9
0
        internal int UpdateAssetRequest(AssetRequestBO assetRequestBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(assetRequestBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "UpdateAssetRequest";
            sqlHelper.AddParameter(command, "@UserId", assetRequestBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopId", assetRequestBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@AssetNameId", assetRequestBO.AssetNameId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Field1", assetRequestBO.Field1, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Field2", assetRequestBO.Field2, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Field3", assetRequestBO.Field3, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Field4", assetRequestBO.Field4, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Field5", assetRequestBO.Field5, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", assetRequestBO.GpsSource, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Latitude", assetRequestBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Longitude", assetRequestBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProcessName", assetRequestBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileReferenceNo", assetRequestBO.MobileReferenceNo, ParameterDirection.Input);

            if (assetRequestBO.AssetNo != null)
            {
                sqlHelper.AddParameter(command, "@AssetNo", assetRequestBO.AssetNo, ParameterDirection.Input);
            }
            if (assetRequestBO.Requesttype != null)
            {
                sqlHelper.AddParameter(command, "@Requesttype", assetRequestBO.Requesttype, ParameterDirection.Input);
            }
            if (assetRequestBO.MobileTransactionDate != null)
            {
                sqlHelper.AddParameter(command, "@MobileTransactionDate", assetRequestBO.MobileTransactionDate, ParameterDirection.Input);
            }
            if (assetRequestBO.MobileDate != null)
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", assetRequestBO.MobileDate, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#10
0
        public int UpdateActivity(MyActivityBO myActivityBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(myActivityBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspMyActivity";
            sqlHelper.AddParameter(command, "@Mode", myActivityBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", myActivityBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ActivityId", myActivityBO.ActivityId, ParameterDirection.Input);
            if (myActivityBO.ActivityDeviationId != 0)
            {
                sqlHelper.AddParameter(command, "@ActivityDeviationId", myActivityBO.ActivityDeviationId, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@MobileReferenceNo", myActivityBO.MobileReferenceNo, ParameterDirection.Input);
            if (!string.IsNullOrEmpty(myActivityBO.MobileSyncDate))
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", Convert.ToDateTime(myActivityBO.MobileSyncDate), ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@MobileTransactionDate", Convert.ToDateTime(myActivityBO.MobileTransactionDate), ParameterDirection.Input);
            if (!string.IsNullOrEmpty(myActivityBO.CheckIn))
            {
                sqlHelper.AddParameter(command, "@CheckIn", Convert.ToDateTime(myActivityBO.CheckIn), ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.CheckOut))
            {
                sqlHelper.AddParameter(command, "@CheckOut", Convert.ToDateTime(myActivityBO.CheckOut), ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.Latitude))
            {
                sqlHelper.AddParameter(command, "@Latitude", myActivityBO.Latitude, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.Longitude))
            {
                sqlHelper.AddParameter(command, "@Longitude", myActivityBO.Longitude, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.signalStrength))
            {
                sqlHelper.AddParameter(command, "@signalStrength", myActivityBO.signalStrength, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.NetworkProvider))
            {
                sqlHelper.AddParameter(command, "@NetworkProvider", myActivityBO.NetworkProvider, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.ConfigFieldIds))
            {
                sqlHelper.AddParameter(command, "@ConfigFieldIds", myActivityBO.ConfigFieldIds, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.ConfigFieldValues))
            {
                sqlHelper.AddParameter(command, "@ConfigFieldValues", myActivityBO.ConfigFieldValues, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(myActivityBO.ActivityPlannedDate))
            {
                sqlHelper.AddParameter(command, "@ActivityPlannedDate", Convert.ToDateTime(myActivityBO.ActivityPlannedDate), ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#11
0
        internal int updatePop(PopBO popBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(popBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspPopEntry";
            sqlHelper.AddParameter(command, "@UserId", popBO.userId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Mode", popBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Parameters", popBO.popIdSet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@QuantityList", popBO.quantitySet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProcessName", popBO.processName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Latitude", popBO.lattitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Longitude", popBO.longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopId", popBO.shopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileTransactionDate", popBO.mobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobRefNo", popBO.mobRefNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@remarkSet", popBO.remarkSet, ParameterDirection.Input);
            if (popBO.ServerSyncDate != "" && popBO.MobileSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", popBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", popBO.ServerSyncDate, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#12
0
        internal void UpdateDailyTourPlan(TourPlanBO tourPlanBO)
        {
            if (String.IsNullOrEmpty(tourPlanBO.RoutePlanData))
            {
                tourPlanBO.RoutePlanData = "";
            }
            if (String.IsNullOrEmpty(tourPlanBO.JointWorkData))
            {
                tourPlanBO.JointWorkData = "";
            }
            if (String.IsNullOrEmpty(tourPlanBO.ActivityPlanData))
            {
                tourPlanBO.ActivityPlanData = "";
            }
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(tourPlanBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspTourPlan";
            sqlHelper.AddParameter(command, "@Mode", "2", ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MonthlyTourPlanIdSave", tourPlanBO.monthlyTourPlanId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@dailyUserId", tourPlanBO.dailyUserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Date", tourPlanBO.Date, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Status", tourPlanBO.Status, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ActionById", tourPlanBO.ActionById, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ActionDate", tourPlanBO.ActionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@dailyMobileReferenceNo", tourPlanBO.dailyMobileReferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@dailyMobileTransactionDate", tourPlanBO.dailyMobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RoutePlanData", tourPlanBO.RoutePlanData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@JointWorkData", tourPlanBO.JointWorkData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ActivityPlanData", tourPlanBO.ActivityPlanData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@LeaveUserId", tourPlanBO.dailyUserId, ParameterDirection.Input);
            if (tourPlanBO.resonId != -1 && tourPlanBO.resonId != 0)
            {
                sqlHelper.AddParameter(command, "@ReasonId", tourPlanBO.resonId, ParameterDirection.Input);
            }
            if (tourPlanBO.mobileCaptureDate != DateTime.MinValue)
            {
                sqlHelper.AddParameter(command, "@LeaveMobileTransactionDate", tourPlanBO.mobileCaptureDate, ParameterDirection.Input);
            }
            if (tourPlanBO.leaveFrom != DateTime.MinValue)
            {
                sqlHelper.AddParameter(command, "@LeaveFrom", tourPlanBO.leaveFrom, ParameterDirection.Input);
            }
            if (tourPlanBO.LeaveSessionIdFrom != "" && tourPlanBO.LeaveSessionIdFrom != "0" && tourPlanBO.LeaveSessionIdFrom != null && tourPlanBO.LeaveSessionIdFrom != "-1")
            {
                sqlHelper.AddParameter(command, "@LeaveSessionIdFrom", tourPlanBO.LeaveSessionIdFrom, ParameterDirection.Input);
            }
            if (tourPlanBO.leaveTo != DateTime.MinValue)
            {
                sqlHelper.AddParameter(command, "@LeaveTo", tourPlanBO.leaveTo, ParameterDirection.Input);
            }
            if (tourPlanBO.LeaveSessionIdTo != "" && tourPlanBO.LeaveSessionIdTo != "0" && tourPlanBO.LeaveSessionIdTo != null && tourPlanBO.LeaveSessionIdTo != "-1")
            {
                sqlHelper.AddParameter(command, "@LeaveSessionIdTo", tourPlanBO.LeaveSessionIdTo, ParameterDirection.Input);
            }
            if (tourPlanBO.LeaveLatitude != null)
            {
                sqlHelper.AddParameter(command, "@Leavelatitude", tourPlanBO.LeaveLatitude, ParameterDirection.Input);
            }
            if (tourPlanBO.LeaveLongitude != null)
            {
                sqlHelper.AddParameter(command, "@Leavelongitude", tourPlanBO.LeaveLongitude, ParameterDirection.Input);
            }
            if (tourPlanBO.LeaveProcessName != null)
            {
                sqlHelper.AddParameter(command, "@LeaveprocessName", tourPlanBO.LeaveProcessName, ParameterDirection.Input);
            }
            if (tourPlanBO.MobRefNo != null)
            {
                sqlHelper.AddParameter(command, "@mobRefNo", tourPlanBO.MobRefNo, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@LeaveGpsSource", tourPlanBO.LeaveGpsSource, ParameterDirection.Input);
            if (tourPlanBO.ServerSyncDate != DateTime.MinValue)
            {
                sqlHelper.AddParameter(command, "@LeaveMobileSyncDate", tourPlanBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@LeaveServerSyncDate", tourPlanBO.MobileSyncDate, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(tourPlanBO.Remarks))
            {
                sqlHelper.AddParameter(command, "@Remarks", tourPlanBO.Remarks, ParameterDirection.Input);
            }
            sqlHelper.ExecuteNonQuery(command);
        }
示例#13
0
        internal int UpdateMonthlyTourPlan(TourPlanBO tourPlanBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(tourPlanBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspTourPlan";
            sqlHelper.AddParameter(command, "@Mode", "1", ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@TourPlanDate", tourPlanBO.TourPlanDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", tourPlanBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@SubmissionRemark", tourPlanBO.SubmissionRemark, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@SubmissionDate", tourPlanBO.SubmissionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@SubmittedBy", Convert.ToInt32(tourPlanBO.SubmittedBy), ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@lattitude", tourPlanBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", tourPlanBO.Longitude, ParameterDirection.Input);
            if (!String.IsNullOrEmpty(tourPlanBO.ProcessName))
            {
                sqlHelper.AddParameter(command, "@processName", tourPlanBO.ProcessName, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@mobileOrderDate", tourPlanBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileReferenceNo", tourPlanBO.MobileReferenceNo, ParameterDirection.Input);
            if (tourPlanBO.MobileSyncDate != DateTime.MinValue)
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", tourPlanBO.MobileSyncDate, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@GpsSource", tourPlanBO.GpsSource, ParameterDirection.Input);
            SqlParameter outparam = command.Parameters.Add("@MonthlyTourPlanId", SqlDbType.Int);

            outparam.Direction = ParameterDirection.Output;
            sqlHelper.ExecuteNonQuery(command);
            return(Convert.ToInt32(outparam.Value));
        }
示例#14
0
        internal int UpdateFollowUp(FollowupBO followUpBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(followUpBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspWSFollowup";
            sqlHelper.AddParameter(command, "@Mode", "1", ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", followUpBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopId", followUpBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@FollowUpId", followUpBO.FollowUpId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Remarks", followUpBO.Remarks, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@FollowUpDate", followUpBO.FollowUpDate.ToString(), ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", followUpBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", followUpBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", followUpBO.ProcessName, ParameterDirection.Input);

            if (followUpBO.signalStrength != null && followUpBO.signalStrength != string.Empty && followUpBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", followUpBO.signalStrength, ParameterDirection.Input);
            }
            if (followUpBO.networkProvider != null && followUpBO.networkProvider != string.Empty && followUpBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", followUpBO.networkProvider, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#15
0
        internal int updateJointWorkingShopInDetails(JointWorkShopInAndOutBO jointWorkShopInAndOutBO)
        {
            try
            {
                DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(jointWorkShopInAndOutBO.ConString);
                SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);
                command.CommandText = "uspUpdateJointWorkingShopInAndOut";
                sqlHelper.AddParameter(command, "@Mode", "1", ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@UserId", jointWorkShopInAndOutBO.UserId, ParameterDirection.Input);

                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.ShopInId) && String.Compare(jointWorkShopInAndOutBO.ShopInId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@ShopInId", jointWorkShopInAndOutBO.ShopInId, ParameterDirection.Input);
                }
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.ShopInTime) && String.Compare(jointWorkShopInAndOutBO.ShopInTime, "1/1/1900 12:00:00 AM") != 0)
                {
                    sqlHelper.AddParameter(command, "@ShopInTime", jointWorkShopInAndOutBO.ShopInTime, ParameterDirection.Input);
                }
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.ShopOutId) && String.Compare(jointWorkShopInAndOutBO.ShopOutId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@ShopOutId", jointWorkShopInAndOutBO.ShopOutId, ParameterDirection.Input);
                }
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.ShopOutTime) && String.Compare(jointWorkShopInAndOutBO.ShopOutTime, "1/1/1900 12:00:00 AM") != 0)
                {
                    sqlHelper.AddParameter(command, "@ShopOutTime", jointWorkShopInAndOutBO.ShopOutTime, ParameterDirection.Input);
                }
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.JointWorkUserId))
                {
                    sqlHelper.AddParameter(command, "@JointWorkingUserId", jointWorkShopInAndOutBO.JointWorkUserId, ParameterDirection.Input);
                }

                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.BeatPlanDeviationReasionId) && String.Compare(jointWorkShopInAndOutBO.BeatPlanDeviationReasionId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@BeatPlanDeviationReasonId", jointWorkShopInAndOutBO.BeatPlanDeviationReasionId, ParameterDirection.Input);
                }

                sqlHelper.AddParameter(command, "@MobileTransactionDate", jointWorkShopInAndOutBO.MobileTransactionDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@MobileRefNo", jointWorkShopInAndOutBO.MobileReferenceNo, ParameterDirection.Input);
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.BeatPlanId))
                {
                    sqlHelper.AddParameter(command, "@BeatPlanId", jointWorkShopInAndOutBO.BeatPlanId, ParameterDirection.Input);
                }

                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.MobileSyncDate))
                {
                    sqlHelper.AddParameter(command, "@MobileSyncDate", jointWorkShopInAndOutBO.MobileSyncDate, ParameterDirection.Input);
                }
                sqlHelper.AddParameter(command, "@ShopName", jointWorkShopInAndOutBO.ShopName, ParameterDirection.Input);

                return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#16
0
        internal int UpdateShopInAndOut(ShopInAndOutBO shopInAndOutBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(shopInAndOutBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "updateShopInAndOut";
            sqlHelper.AddParameter(command, "@ShopId", shopInAndOutBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", shopInAndOutBO.UserId, ParameterDirection.Input);
            if (shopInAndOutBO.ShopOut.Equals(""))
            {
                sqlHelper.AddParameter(command, "@ShopIn", shopInAndOutBO.ShopIn, ParameterDirection.Input);
            }
            else
            {
                sqlHelper.AddParameter(command, "@ShopOut", shopInAndOutBO.ShopOut, ParameterDirection.Input);
            }

            sqlHelper.AddParameter(command, "@Latitude", shopInAndOutBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Longitude", shopInAndOutBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProcessName", shopInAndOutBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", shopInAndOutBO.gpsSource, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileRefNo", shopInAndOutBO.MobileReferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileTransactionDate", shopInAndOutBO.MobileTransactionDate, ParameterDirection.Input);

            if (shopInAndOutBO.ServerSyncDate != "" && shopInAndOutBO.MobileSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", shopInAndOutBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", shopInAndOutBO.ServerSyncDate, ParameterDirection.Input);
            }

            if (shopInAndOutBO.signalStrength != null && shopInAndOutBO.signalStrength != string.Empty && shopInAndOutBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", shopInAndOutBO.signalStrength, ParameterDirection.Input);
            }
            if (shopInAndOutBO.networkProvider != null && shopInAndOutBO.networkProvider != string.Empty && shopInAndOutBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", shopInAndOutBO.networkProvider, ParameterDirection.Input);
            }
            if (!string.IsNullOrEmpty(shopInAndOutBO.IsGpsForciblyEnabled))
            {
                sqlHelper.AddParameter(command, "@IsGpsForciblyEnabled", shopInAndOutBO.IsGpsForciblyEnabled, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#17
0
        /// <summary>
        /// Online Mode
        /// </summary>
        /// <param name="jointWorkShopInAndOutBO"></param>
        /// <returns></returns>
        internal int InsertJointWorkData(JointWorkShopInAndOutBO jointWorkShopInAndOutBO)
        {
            try{
                DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(jointWorkShopInAndOutBO.ConString);
                SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);
                command.CommandText = "uspUpdateJointWorkingShopInAndOut";
                sqlHelper.AddParameter(command, "@Mode", "2", ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@UserId", jointWorkShopInAndOutBO.UserId, ParameterDirection.Input);
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.BeatPlanActivityConfigsId) && String.Compare(jointWorkShopInAndOutBO.BeatPlanActivityConfigsId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@BeatPlanActivityConfigsId", jointWorkShopInAndOutBO.BeatPlanActivityConfigsId, ParameterDirection.Input);
                }
                sqlHelper.AddParameter(command, "@SurveyGroupId", jointWorkShopInAndOutBO.SurveyGroupId, ParameterDirection.Input);
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.BeatPlanId) && String.Compare(jointWorkShopInAndOutBO.BeatPlanId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@BeatPlanId", jointWorkShopInAndOutBO.BeatPlanId, ParameterDirection.Input);
                }
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.ShopId) && String.Compare(jointWorkShopInAndOutBO.ShopId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@ShopId", jointWorkShopInAndOutBO.ShopId, ParameterDirection.Input);
                }
                sqlHelper.AddParameter(command, "@MobileRefNo", jointWorkShopInAndOutBO.MobileReferenceNo, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ShopName", jointWorkShopInAndOutBO.ShopName, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@SurveyQuestionAnswer", jointWorkShopInAndOutBO.SurveyQuestionAnswers, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@MobileTransactionDate", jointWorkShopInAndOutBO.MobileTransactionDate, ParameterDirection.Input);

                sqlHelper.AddParameter(command, "@latitude", jointWorkShopInAndOutBO.Latitude, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@longitude", jointWorkShopInAndOutBO.Longitude, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@gpsSource", jointWorkShopInAndOutBO.GpsSource, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@networkProvider", jointWorkShopInAndOutBO.NetworkProvider, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@signalStrength", jointWorkShopInAndOutBO.SignalStrength, ParameterDirection.Input);
                if (!String.IsNullOrEmpty(jointWorkShopInAndOutBO.JointWorkUserId) && String.Compare(jointWorkShopInAndOutBO.JointWorkUserId, "0") != 0)
                {
                    sqlHelper.AddParameter(command, "@JointWorkingUserId", jointWorkShopInAndOutBO.JointWorkUserId, ParameterDirection.Input);
                }
                return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#18
0
        internal int UpdatePromotionalActivities(PromotionalActivitiesBO prmBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(prmBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspPromo";
            sqlHelper.AddParameter(command, "@Mode", prmBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UserId", prmBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopID", prmBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Question", prmBO.QuestionId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Answer", prmBO.AnswerId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@FreeText", prmBO.ResultDescription, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", prmBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", prmBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", prmBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RemarksDateSet", prmBO.DateSet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RemarksTextSet", prmBO.TextSet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RemarksNumberSet", prmBO.NumberSet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ImageDataSet", prmBO.ImageDataSet, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileTransactionDate", prmBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@MobileReferenceNo", prmBO.MobileReferenceNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", prmBO.GpsSource, ParameterDirection.Input);

            if (prmBO.ServerSyncDate != "" && prmBO.MobileSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", prmBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", prmBO.ServerSyncDate, ParameterDirection.Input);
            }
            if (prmBO.signalStrength != null && prmBO.signalStrength != string.Empty && prmBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", prmBO.signalStrength, ParameterDirection.Input);
            }
            if (prmBO.networkProvider != null && prmBO.networkProvider != string.Empty && prmBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", prmBO.networkProvider, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#19
0
        internal int UpdateStockReconcilation(StockReconcilationBO stockReconcilationBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(stockReconcilationBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "UpdateStockReconcile";
            sqlHelper.AddParameter(command, "@UserId", stockReconcilationBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@StoreId", stockReconcilationBO.StoreId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ReconcileDate", stockReconcilationBO.ReconcileDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProductIdData", stockReconcilationBO.ProductIdData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@QuantityData", stockReconcilationBO.QuantityData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ReturnReasonId", stockReconcilationBO.ReasonIdData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@RateData", stockReconcilationBO.RateData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@latitude", stockReconcilationBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", stockReconcilationBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", stockReconcilationBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UnloadStatus", stockReconcilationBO.UnloadStatus, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", stockReconcilationBO.GpsSource, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UpdatedDate", stockReconcilationBO.ReconcileDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@UnitData", stockReconcilationBO.UnitData, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Remarks", stockReconcilationBO.Remarks, ParameterDirection.Input);
            if (stockReconcilationBO.SyncDate != null)
            {
                sqlHelper.AddParameter(command, "@SyncDate", stockReconcilationBO.SyncDate, ParameterDirection.Input);
            }
            if (stockReconcilationBO.mobileDate != null && stockReconcilationBO.mobileDate != string.Empty && stockReconcilationBO.mobileDate != "")
            {
                sqlHelper.AddParameter(command, "@mobileSyncDate", stockReconcilationBO.mobileDate, ParameterDirection.Input);
            }
            if (stockReconcilationBO.MobileRefNo != null && stockReconcilationBO.MobileRefNo != string.Empty && stockReconcilationBO.MobileRefNo != "")
            {
                sqlHelper.AddParameter(command, "@mobileRefNumber", stockReconcilationBO.MobileRefNo, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }
示例#20
0
        internal int UpdateSalesReturn(SalesReturnBO salesReturnBO)
        {
            DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(salesReturnBO.ConString);
            SqlCommand          command   = sqlHelper.CreateCommand(CommandType.StoredProcedure);

            command.CommandText = "uspSalesReturn";
            sqlHelper.AddParameter(command, "@Mode", salesReturnBO.Mode, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ReturnedBy", salesReturnBO.UserId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ShopID", salesReturnBO.ShopId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ProductAttributeId", salesReturnBO.ProductAttributeId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Quantity", salesReturnBO.Quantity, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Amount", salesReturnBO.Amount, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@BatchNo", salesReturnBO.BatchNo, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@unitId", salesReturnBO.UnitId, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@ReceiptNo", salesReturnBO.ReceiptNo, ParameterDirection.Input);
            if (salesReturnBO.PkdDate != "")
            {
                sqlHelper.AddParameter(command, "@PkdDate", salesReturnBO.PkdDate, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@latitude", salesReturnBO.Latitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@longitude", salesReturnBO.Longitude, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@processName", salesReturnBO.ProcessName, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@mobileTransactionDate", salesReturnBO.MobileTransactionDate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@Rate", salesReturnBO.Rate, ParameterDirection.Input);
            sqlHelper.AddParameter(command, "@GpsSource", salesReturnBO.GpsSouce, ParameterDirection.Input);
            if (salesReturnBO.returnReason != string.Empty)
            {
                sqlHelper.AddParameter(command, "@ReturnReason", salesReturnBO.returnReason, ParameterDirection.Input);
            }
            sqlHelper.AddParameter(command, "@mobileReferenceNo", salesReturnBO.mobileReferenceNo, ParameterDirection.Input);
            if (salesReturnBO.MobileSyncDate != "" && salesReturnBO.ServerSyncDate != "")
            {
                sqlHelper.AddParameter(command, "@MobileSyncDate", salesReturnBO.MobileSyncDate, ParameterDirection.Input);
                sqlHelper.AddParameter(command, "@ServerSyncDate", salesReturnBO.ServerSyncDate, ParameterDirection.Input);
            }
            if (salesReturnBO.SchemeId != 0)
            {
                sqlHelper.AddParameter(command, "@SchemeId", salesReturnBO.SchemeId, ParameterDirection.Input);
            }
            if (salesReturnBO.signalStrength != null && salesReturnBO.signalStrength != string.Empty && salesReturnBO.signalStrength != "")
            {
                sqlHelper.AddParameter(command, "@signalStrength", salesReturnBO.signalStrength, ParameterDirection.Input);
            }
            if (salesReturnBO.networkProvider != null && salesReturnBO.networkProvider != string.Empty && salesReturnBO.networkProvider != "")
            {
                sqlHelper.AddParameter(command, "@networkProvider", salesReturnBO.networkProvider, ParameterDirection.Input);
            }
            if (salesReturnBO.Remark != null && salesReturnBO.Remark != string.Empty && salesReturnBO.Remark != "")
            {
                sqlHelper.AddParameter(command, "@ReasonData", salesReturnBO.Remark, ParameterDirection.Input);
            }
            return(Convert.ToInt32(sqlHelper.ExecuteNonQuery(command)));
        }