Beispiel #1
0
 string prepareDelete(DbOperator dbOperator, Bunk value)
 {
     dbOperator.AddParameter("DELETEBUNKID", value.Id);
     return("DELETE FROM [T_ExtendedBunk] WHERE [BUNKID]=@DELETEBUNKID;DELETE FROM [T_Bunk] WHERE [ID]=@DELETEBUNKID;");
 }
        public int Save(CompanyUpgrade companyUpgrade)
        {
            string sql = @"IF EXISTS(SELECT NULL FROM [dbo].[T_CompanyUpgradeApplication ] WHERE Company =@Company)
                         UPDATE [dbo].[T_CompanyUpgradeApplication] SET [UserNo] = @UserNo,[Name] = @Name,[AbbreviateName] = @AbbreviateName,[OrginationCode] = @OrginationCode,
                         [OfficePhones] = @OfficePhones,[ManagerName] = @ManagerName,[ManagerPhone] = @ManagerPhone,[EmergencyName] = @EmergencyName,[EmergencyPhone] = @EmergencyPhone,
                         [Type] = @Type,[AccountType] = @AccountType,[Audited] =@Audited,[AuditTime]=@AuditTime,[ApplyTime] = @ApplyTime WHERE [Company] = @Company
                         ELSE INSERT INTO [B3B].[dbo].[T_CompanyUpgradeApplication ]([Company],[UserNo],[Name],[AbbreviateName],[OrginationCode],
                         [OfficePhones],[ManagerName],[ManagerPhone],[EmergencyName] ,[EmergencyPhone],[Type],[AccountType],[Audited],[AuditTime],[ApplyTime])
                         VALUES(@Company,@UserNo,@Name,@AbbreviateName,@OrginationCode,@OfficePhones,@ManagerName,@ManagerPhone,@EmergencyName,@EmergencyPhone,
                         @Type,@AccountType,@Audited,@AuditTime,@ApplyTime)";

            using (var dbOperator = new DbOperator(Provider, ConnectionString))
            {
                dbOperator.AddParameter("Company", companyUpgrade.Company);
                dbOperator.AddParameter("UserNo", companyUpgrade.UserNo);
                if (string.IsNullOrWhiteSpace(companyUpgrade.Name))
                {
                    dbOperator.AddParameter("Name", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("Name", companyUpgrade.Name);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.AbbreviateName))
                {
                    dbOperator.AddParameter("AbbreviateName", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("AbbreviateName", companyUpgrade.AbbreviateName);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.OrginationCode))
                {
                    dbOperator.AddParameter("OrginationCode", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("OrginationCode", companyUpgrade.OrginationCode);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.OfficePhones))
                {
                    dbOperator.AddParameter("OfficePhones", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("OfficePhones", companyUpgrade.OfficePhones);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.ManagerName))
                {
                    dbOperator.AddParameter("ManagerName", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("ManagerName", companyUpgrade.ManagerName);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.ManagerPhone))
                {
                    dbOperator.AddParameter("ManagerPhone", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("ManagerPhone", companyUpgrade.ManagerPhone);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.EmergencyName))
                {
                    dbOperator.AddParameter("EmergencyName", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("EmergencyName", companyUpgrade.EmergencyName);
                }
                if (string.IsNullOrWhiteSpace(companyUpgrade.EmergencyPhone))
                {
                    dbOperator.AddParameter("EmergencyPhone", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("EmergencyPhone", companyUpgrade.EmergencyPhone);
                }
                dbOperator.AddParameter("Type", (int)companyUpgrade.Type);
                dbOperator.AddParameter("AccountType", (int)companyUpgrade.AccountType);
                dbOperator.AddParameter("Audited", companyUpgrade.Audited);
                if (companyUpgrade.AuditTime.HasValue)
                {
                    dbOperator.AddParameter("AuditTime", companyUpgrade.AuditTime);
                }
                else
                {
                    dbOperator.AddParameter("AuditTime", DBNull.Value);
                }
                dbOperator.AddParameter("ApplyTime", companyUpgrade.ApplyTime);
                return(dbOperator.ExecuteNonQuery(sql));
            }
        }
        public IEnumerable <DataTransferObject.Organization.CompanyAuditInfo> QueryNeedAuditCompanies(CompanyAuditQueryCondition condition, Pagination pagination)
        {
            var result = new List <DataTransferObject.Organization.CompanyAuditInfo>();

            using (var dbOperator = new DbOperator(Provider, ConnectionString))
            {
                if (!string.IsNullOrWhiteSpace(condition.UserNo))
                {
                    dbOperator.AddParameter("@i_UserNo", condition.UserNo);
                }
                if (condition.CompanyType.HasValue)
                {
                    dbOperator.AddParameter("@i_CompanyType", (byte)condition.CompanyType);
                }
                if (condition.AccountType.HasValue)
                {
                    dbOperator.AddParameter("@i_AccountType", (byte)condition.AccountType);
                }
                if (condition.ApplyTimeStart.HasValue)
                {
                    dbOperator.AddParameter("@i_ApplyTimeStart", condition.ApplyTimeStart);
                }
                if (condition.ApplyTimeEnd.HasValue)
                {
                    dbOperator.AddParameter("@i_ApplyTimeEnd", condition.ApplyTimeEnd);
                }

                if (!string.IsNullOrWhiteSpace(condition.CompanyName))
                {
                    dbOperator.AddParameter("@i_CompanyName", condition.CompanyName);
                }
                if (!string.IsNullOrWhiteSpace(condition.AuditType))
                {
                    dbOperator.AddParameter("@i_AuditType", condition.AuditType);
                }
                if (!string.IsNullOrWhiteSpace(condition.SourceType))
                {
                    dbOperator.AddParameter("@i_SourceType", condition.SourceType);
                }
                dbOperator.AddParameter("@i_Pagesize", pagination.PageSize);
                dbOperator.AddParameter("@i_PageIndex", pagination.PageIndex);
                var totalCount = dbOperator.AddParameter("@o_RowCount");
                totalCount.DbType    = System.Data.DbType.Int32;
                totalCount.Direction = System.Data.ParameterDirection.Output;
                using (var reader = dbOperator.ExecuteReader("dbo.P_CompanyAuditPagination", System.Data.CommandType.StoredProcedure))
                {
                    while (reader.Read())
                    {
                        result.Add(new CompanyAuditInfo()
                        {
                            CompanyId      = reader.GetGuid(0),
                            UserNo         = reader.GetString(1),
                            AbbreviateName = reader.GetString(2),
                            CompanyType    = (CompanyType)reader.GetByte(3),
                            AccountType    = (AccountBaseType)reader.GetByte(4),
                            ApplyTime      = reader.GetDateTime(5),
                            AuditType      = reader.GetString(6),
                            SourceType     = reader.GetString(7),
                            SpreadId       = reader.GetGuid(8)
                        });
                    }
                }
                if (pagination.GetRowCount)
                {
                    pagination.RowCount = (int)totalCount.Value;
                }
            }
            return(result);
        }
Beispiel #4
0
        public bool AddWXInfo(WX_Info model, DbOperator dbOperator)
        {
            string strsql = "insert into WX_Info(OpenID,AccountID,UserType,FollowState,NickName,Language,Province,City,Country,Sex,Headimgurl,SubscribeTimes,LastSubscribeDate,LastUnsubscribeDate,LastVisitDate,CompanyID)";

            strsql += "values(@OpenID,@AccountID,@UserType,@FollowState,@NickName,@Language,@Province,@City,@Country,@Sex,@Headimgurl,@SubscribeTimes,@LastSubscribeDate,@LastUnsubscribeDate,@LastVisitDate,@CompanyID)";
            dbOperator.ClearParameters();
            dbOperator.AddParameter("OpenID", model.OpenID);
            dbOperator.AddParameter("AccountID", model.AccountID);
            dbOperator.AddParameter("UserType", model.UserType);
            dbOperator.AddParameter("FollowState", 1);
            dbOperator.AddParameter("NickName", model.NickName);
            dbOperator.AddParameter("Language", model.Language);
            dbOperator.AddParameter("Province", model.Province);
            dbOperator.AddParameter("City", model.City);
            dbOperator.AddParameter("Country", model.Country);
            dbOperator.AddParameter("Sex", model.Sex);
            dbOperator.AddParameter("Headimgurl", model.Headimgurl);
            dbOperator.AddParameter("SubscribeTimes", 1);
            dbOperator.AddParameter("LastSubscribeDate", DateTime.Now);
            dbOperator.AddParameter("LastUnsubscribeDate", DateTime.Now);
            dbOperator.AddParameter("LastVisitDate", DateTime.Now);
            dbOperator.AddParameter("CompanyID", model.CompanyID);
            return(dbOperator.ExecuteNonQuery(strsql) > 0);
        }
Beispiel #5
0
        public bool Update(BaseCard model, DbOperator dbOperator)
        {
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();
            strSql.Append(@"update BaseCard set Balance=@Balance,CardNo=@CardNo,
                                    CardNumb=@CardNumb,CardSystem=@CardSystem,CardType=@CardType,
                                    Deposit=@Deposit,EmployeeID=@EmployeeID,HaveUpdate=@HaveUpdate,LastUpdateTime=@LastUpdateTime,
                                    OperatorID=@OperatorID,RegisterTime=@RegisterTime,State=@State,VID=@VID");
            strSql.Append(" where CardID=@CardID");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("CardID", model.CardID);
            dbOperator.AddParameter("Balance", model.Balance);
            dbOperator.AddParameter("CardNo", model.CardNo);
            dbOperator.AddParameter("CardNumb", model.CardNumb);
            dbOperator.AddParameter("CardSystem", (int)model.CardSystem);
            dbOperator.AddParameter("CardType", (int)model.CardType);
            dbOperator.AddParameter("Deposit", model.Deposit);
            dbOperator.AddParameter("EmployeeID", model.EmployeeID);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("OperatorID", model.OperatorID);
            dbOperator.AddParameter("RegisterTime", model.RegisterTime);
            dbOperator.AddParameter("State", (int)model.State);
            dbOperator.AddParameter("VID", model.VID);
            return dbOperator.ExecuteNonQuery(strSql.ToString()) > 0;
        }
Beispiel #6
0
        public IEnumerable <DataTransferObject.Foundation.BasicPriceView> QueryBasicPrice(string airline, string departure, string arrival, Core.Pagination pagination)
        {
            IList <DataTransferObject.Foundation.BasicPriceView> result = new List <DataTransferObject.Foundation.BasicPriceView>();
            string fields       = "[Id],[Airline],[Departure],[Arrival],[FlightDate],[ETDZDate],[Price],[Mileage],ModifyTime";
            string catelog      = "[dbo].[T_BasicPrice]";
            string orderbyFiled = "[Airline] DESC,[FlightDate] DESC,[Departure],[Arrival],ModifyTime desc";

            string where = "";
            if (!string.IsNullOrWhiteSpace(airline))
            {
                where += "([Airline] IS NULL OR [Airline] = '" + airline + "') AND ";
            }
            if (!string.IsNullOrWhiteSpace(departure) || !string.IsNullOrWhiteSpace(arrival))
            {
                if (!string.IsNullOrWhiteSpace(departure) && string.IsNullOrWhiteSpace(arrival))
                {
                    where += "([Departure] = '" + departure + "' OR [Arrival] = '" + departure + "')  AND ";
                }
                if (!string.IsNullOrWhiteSpace(arrival) && string.IsNullOrWhiteSpace(departure))
                {
                    where += "([Departure] = '" + arrival + "' OR [Arrival] = '" + arrival + "')  AND ";
                }
                if (!string.IsNullOrWhiteSpace(arrival) && !string.IsNullOrWhiteSpace(departure))
                {
                    where += "(([Departure] = '" + arrival + "' AND [Arrival] = '" + departure + "') OR ([Departure] = '" + departure + "' AND [Arrival] = '" + arrival + "'))  AND ";
                }
            }
            if (where.Length > 0)
            {
                where = where.Remove(where.Length - 5, 5);
            }
            using (DbOperator dbOperator = new DbOperator(Provider, ConnectionString))
            {
                dbOperator.AddParameter("@iField", fields);
                dbOperator.AddParameter("@iCatelog", catelog);
                dbOperator.AddParameter("@iCondition", where);
                dbOperator.AddParameter("@iOrderBy", orderbyFiled);
                dbOperator.AddParameter("@iPagesize", pagination.PageSize);
                dbOperator.AddParameter("@iPageIndex", pagination.PageIndex);
                dbOperator.AddParameter("@iGetCount", pagination.GetRowCount);
                System.Data.Common.DbParameter totalCount = dbOperator.AddParameter("@oTotalCount");
                totalCount.DbType    = System.Data.DbType.Int32;
                totalCount.Direction = System.Data.ParameterDirection.Output;
                using (System.Data.Common.DbDataReader reader = dbOperator.ExecuteReader("dbo.P_Pagination", System.Data.CommandType.StoredProcedure))
                {
                    while (reader.Read())
                    {
                        DataTransferObject.Foundation.BasicPriceView basicPriceView = new DataTransferObject.Foundation.BasicPriceView();
                        basicPriceView.Id         = reader.GetGuid(0);
                        basicPriceView.Airline    = reader.IsDBNull(1) ? string.Empty : reader.GetString(1);
                        basicPriceView.Departure  = reader.GetString(2);
                        basicPriceView.Arrival    = reader.GetString(3);
                        basicPriceView.FlightDate = reader.GetDateTime(4);
                        basicPriceView.ETDZDate   = reader.GetDateTime(5);
                        basicPriceView.Price      = reader.GetDecimal(6);
                        basicPriceView.Mileage    = reader.GetDecimal(7);
                        basicPriceView.ModifyTime = reader.IsDBNull(8) ? new DateTime(2013, 10, 26, 0, 0, 0) : reader.GetDateTime(8);
                        result.Add(basicPriceView);
                    }
                }
                if (pagination.GetRowCount)
                {
                    pagination.RowCount = (int)totalCount.Value;
                }
            }
            return(result);
        }
Beispiel #7
0
        public bool Add(List <ParkCarModel> models, DbOperator dbOperator)
        {
            dbOperator.ClearParameters();
            if (models == null || models.Count == 0)
            {
                return(false);
            }

            StringBuilder strSql = new StringBuilder();

            strSql.Append("INSERT INTO ParkCarModel(CarModelID,CarModelName,PKID,IsDefault,LastUpdateTime,HaveUpdate,DataStatus,MaxUseMoney,IsNaturalDay,PlateColor,DayMaxMoney,NightMaxMoney,DayStartTime,DayEndTime,NightStartTime,NightEndTime)");
            bool hasData = false;
            int  index   = 1;

            foreach (var p in models)
            {
                p.DataStatus     = DataStatus.Normal;
                p.LastUpdateTime = DateTime.Now;
                p.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                strSql.AppendFormat(" SELECT @CarModelID{0},@CarModelName{0},@PKID{0},@IsDefault{0},@LastUpdateTime{0},@HaveUpdate{0},@DataStatus{0},@MaxUseMoney{0},@IsNaturalDay{0},@PlateColor{0},@DayMaxMoney{0},@NightMaxMoney{0},@DayStartTime{0},@DayEndTime{0},@NightStartTime{0},@NightEndTime{0} UNION ALL", index);
                dbOperator.AddParameter("CarModelID" + index, p.CarModelID);
                dbOperator.AddParameter("CarModelName" + index, p.CarModelName);
                dbOperator.AddParameter("PKID" + index, p.PKID);
                dbOperator.AddParameter("IsDefault" + index, (int)p.IsDefault);
                dbOperator.AddParameter("LastUpdateTime" + index, p.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate" + index, p.HaveUpdate);
                dbOperator.AddParameter("DataStatus" + index, (int)p.DataStatus);
                dbOperator.AddParameter("MaxUseMoney" + index, p.MaxUseMoney);
                dbOperator.AddParameter("IsNaturalDay" + index, p.IsNaturalDay);
                dbOperator.AddParameter("PlateColor" + index, p.PlateColor);
                dbOperator.AddParameter("DayMaxMoney" + index, p.DayMaxMoney);
                dbOperator.AddParameter("NightMaxMoney" + index, p.NightMaxMoney);
                dbOperator.AddParameter("DayStartTime" + index, p.DayStartTime);
                dbOperator.AddParameter("DayEndTime" + index, p.DayEndTime);
                dbOperator.AddParameter("NightStartTime" + index, p.NightStartTime);
                dbOperator.AddParameter("NightEndTime" + index, p.NightEndTime);

                hasData = true;
                index++;
            }
            if (hasData)
            {
                return(dbOperator.ExecuteNonQuery(strSql.Remove(strSql.Length - 10, 10).ToString()) > 0);
            }
            return(false);
        }
Beispiel #8
0
        public bool Update(BaseParkinfo model)
        {
            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                model.LastUpdateTime = DateTime.Now;
                model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                StringBuilder strSql = new StringBuilder();
                strSql.Append("update BaseParkinfo set PKNo=@PKNo,PKName=@PKName");
                strSql.Append(",CenterTime=@CenterTime,AllowLoseDisplay=@AllowLoseDisplay,LinkMan=@LinkMan,Mobile=@Mobile,Address=@Address,Coordinate=@Coordinate,MobilePay=@MobilePay");
                strSql.Append(",MobileLock=@MobileLock,IsParkingSpace=@IsParkingSpace,IsReverseSeekingVehicle=@IsReverseSeekingVehicle,FeeRemark=@FeeRemark,OnLine=@OnLine,Remark=@Remark");
                strSql.Append(",LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate,CityID=@CityID,VID=@VID,DataSaveDays=@DataSaveDays,PictureSaveDays=@PictureSaveDays,PoliceFree=@PoliceFree");
                strSql.Append(",IsOnLineGathe=@IsOnLineGathe,IsLine=@IsLine,NeedFee=@NeedFee,ExpiredAdvanceRemindDay=@ExpiredAdvanceRemindDay,DefaultPlate=@DefaultPlate,SpaceBitNum=@SpaceBitNum");
                strSql.Append(",CarBitNumFixed=@CarBitNumFixed,CarBitNumLeft=@CarBitNumLeft,OnlineDiscount=@OnlineDiscount,IsOnlineDiscount=@IsOnlineDiscount,UnconfirmedCalculation=@UnconfirmedCalculation,IsNoPlateConfirm=@IsNoPlateConfirm,SupportAutoRefund=@SupportAutoRefund,OuterringCharge=@OuterringCharge,SupportNoSense=@SupportNoSense where  PKID=@PKID");
                dbOperator.ClearParameters();
                dbOperator.AddParameter("PKID", model.PKID);
                dbOperator.AddParameter("PKNo", model.PKNo);
                dbOperator.AddParameter("PKName", model.PKName);
                dbOperator.AddParameter("CenterTime", model.CenterTime);
                dbOperator.AddParameter("AllowLoseDisplay", (int)model.AllowLoseDisplay);
                dbOperator.AddParameter("LinkMan", model.LinkMan);
                dbOperator.AddParameter("Mobile", model.Mobile);
                dbOperator.AddParameter("Address", model.Address);
                dbOperator.AddParameter("Coordinate", model.Coordinate);
                dbOperator.AddParameter("MobilePay", (int)model.MobilePay);
                dbOperator.AddParameter("MobileLock", (int)model.MobileLock);
                dbOperator.AddParameter("IsParkingSpace", (int)model.IsParkingSpace);
                dbOperator.AddParameter("IsReverseSeekingVehicle", (int)model.IsReverseSeekingVehicle);
                dbOperator.AddParameter("FeeRemark", model.FeeRemark);
                dbOperator.AddParameter("OnLine", (int)model.OnLine);
                dbOperator.AddParameter("Remark", model.Remark);
                dbOperator.AddParameter("CityID", model.CityID);
                dbOperator.AddParameter("VID", model.VID);
                dbOperator.AddParameter("DataSaveDays", model.DataSaveDays);
                dbOperator.AddParameter("PictureSaveDays", model.PictureSaveDays);
                dbOperator.AddParameter("IsOnLineGathe", (int)model.IsOnLineGathe);
                dbOperator.AddParameter("IsLine", (int)model.IsLine);
                dbOperator.AddParameter("NeedFee", (int)model.NeedFee);
                dbOperator.AddParameter("ExpiredAdvanceRemindDay", model.ExpiredAdvanceRemindDay);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("DefaultPlate", model.DefaultPlate);
                dbOperator.AddParameter("SpaceBitNum", model.SpaceBitNum);
                dbOperator.AddParameter("CarBitNumFixed", model.CarBitNumFixed);
                dbOperator.AddParameter("CarBitNumLeft", model.CarBitNumLeft);
                dbOperator.AddParameter("PoliceFree", model.PoliceFree);
                dbOperator.AddParameter("OnlineDiscount", model.OnlineDiscount);
                dbOperator.AddParameter("IsOnlineDiscount", model.IsOnlineDiscount);
                dbOperator.AddParameter("UnconfirmedCalculation", model.UnconfirmedCalculation);
                dbOperator.AddParameter("IsNoPlateConfirm", model.IsNoPlateConfirm);
                dbOperator.AddParameter("SupportAutoRefund", model.SupportAutoRefund);
                dbOperator.AddParameter("OuterringCharge", model.OuterringCharge);
                dbOperator.AddParameter("SupportNoSense", model.SupportNoSense);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #9
0
 public bool ModifyOrderStatusAndAmount(string recordID, decimal amount, decimal payAmount, decimal unPayamount, int status, decimal Discountamount, string Carderateid, int payWay, out string ErrorMessage)
 {
     ErrorMessage = "";
     try
     {
         using (DbOperator dbOperator = ConnectionManager.CreateConnection())
         {
             string strSql = "";
             strSql = @"update ParkOrder set  Carderateid=@Carderateid,Discountamount=@Discountamount,Amount=@Amount,Status=@Status,HaveUpdate=@HaveUpdate,PayAmount=@PayAmount,UnPayamount=@UnPayamount,LastUpdateTime=@LastUpdateTime,PayWay=@PayWay where RecordID=@RecordID";
             dbOperator.ClearParameters();
             dbOperator.AddParameter("RecordID", recordID);
             dbOperator.AddParameter("Discountamount", Discountamount);
             dbOperator.AddParameter("Carderateid", Carderateid);
             dbOperator.AddParameter("Amount", amount);
             dbOperator.AddParameter("Status", status);
             dbOperator.AddParameter("PayAmount", payAmount);
             dbOperator.AddParameter("UnPayamount", unPayamount);
             dbOperator.AddParameter("PayWay", payWay);
             dbOperator.AddParameter("HaveUpdate", 1);
             dbOperator.AddParameter("LastUpdateTime", DateTime.Now);
             dbOperator.AddParameter("DataStatus", (int)DataStatus.Delete);
             return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
         }
     }
     catch (Exception e)
     {
         ErrorMessage = e.Message;
     }
     return(false);
 }
Beispiel #10
0
        public bool Add(List <ParkCarType> models, DbOperator dbOperator)
        {
            dbOperator.ClearParameters();
            if (models == null || models.Count == 0)
            {
                return(false);
            }

            StringBuilder strSql = new StringBuilder();

            strSql.Append("INSERT INTO ParkCarType(CarTypeID,CarTypeName,PKID,BaseTypeID,RepeatIn,RepeatOut");
            strSql.Append(",AffirmIn,AffirmOut,InBeginTime,InEdnTime,MaxUseMoney,AllowLose,LpDistinguish,InOutEditCar");
            strSql.Append(",InOutTime,CarNoLike,LastUpdateTime,HaveUpdate,IsAllowOnlIne,Amount,MaxMonth,MaxValue,DataStatus");
            strSql.Append(",OverdueToTemp,LotOccupy,Deposit,MonthCardExpiredEnterDay,AffirmBegin,AffirmEnd,IsNeedCapturePaper,IsNeedAuthentication,IsDispatch,OnlineUnit,IsIgnoreHZ)");
            bool hasData = false;
            int  index   = 1;

            foreach (var p in models)
            {
                p.DataStatus     = DataStatus.Normal;
                p.LastUpdateTime = DateTime.Now;
                p.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                strSql.AppendFormat(" SELECT @CarTypeID{0},@CarTypeName{0},@PKID{0},@BaseTypeID{0},@RepeatIn{0},@RepeatOut{0}", index);
                strSql.AppendFormat(",@AffirmIn{0},@AffirmOut{0},@InBeginTime{0},@InEdnTime{0},@MaxUseMoney{0},@AllowLose{0},@LpDistinguish{0},@InOutEditCar{0}", index);
                strSql.AppendFormat(",@InOutTime{0},@CarNoLike{0},@LastUpdateTime{0},@HaveUpdate{0},@IsAllowOnlIne{0},@Amount{0},@MaxMonth{0},@MaxValue{0},@DataStatus{0}", index);
                strSql.AppendFormat(",@OverdueToTemp{0},@LotOccupy{0},@Deposit{0},@MonthCardExpiredEnterDay{0},@AffirmBegin{0},@AffirmEnd{0},@IsNeedCapturePaper{0},@IsNeedAuthentication{0},@IsDispatch{0},@OnlineUnit{0},@IsIgnoreHZ{0}  UNION ALL", index);

                dbOperator.AddParameter("CarTypeID" + index, p.CarTypeID);
                dbOperator.AddParameter("CarTypeName" + index, p.CarTypeName);
                dbOperator.AddParameter("PKID" + index, p.PKID);
                dbOperator.AddParameter("BaseTypeID" + index, (int)p.BaseTypeID);
                dbOperator.AddParameter("RepeatIn" + index, (int)p.RepeatIn);
                dbOperator.AddParameter("RepeatOut" + index, (int)p.RepeatOut);
                dbOperator.AddParameter("AffirmIn" + index, (int)p.AffirmIn);
                dbOperator.AddParameter("AffirmOut" + index, (int)p.AffirmOut);
                dbOperator.AddParameter("InBeginTime" + index, p.InBeginTime);
                dbOperator.AddParameter("InEdnTime" + index, p.InEdnTime);
                dbOperator.AddParameter("MaxUseMoney" + index, p.MaxUseMoney);
                dbOperator.AddParameter("AllowLose" + index, (int)p.AllowLose);
                dbOperator.AddParameter("LpDistinguish" + index, (int)p.LpDistinguish);
                dbOperator.AddParameter("InOutEditCar" + index, (int)p.InOutEditCar);
                dbOperator.AddParameter("InOutTime" + index, p.InOutTime);
                dbOperator.AddParameter("CarNoLike" + index, (int)p.CarNoLike);
                dbOperator.AddParameter("LastUpdateTime" + index, p.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate" + index, p.HaveUpdate);
                dbOperator.AddParameter("IsAllowOnlIne" + index, (int)p.IsAllowOnlIne);
                dbOperator.AddParameter("Amount" + index, p.Amount);
                dbOperator.AddParameter("MaxMonth" + index, p.MaxMonth);
                dbOperator.AddParameter("MaxValue" + index, p.MaxValue);
                dbOperator.AddParameter("DataStatus" + index, (int)p.DataStatus);
                dbOperator.AddParameter("OverdueToTemp" + index, (int)p.OverdueToTemp);
                dbOperator.AddParameter("LotOccupy" + index, (int)p.LotOccupy);
                dbOperator.AddParameter("Deposit" + index, p.Deposit);
                dbOperator.AddParameter("MonthCardExpiredEnterDay" + index, p.MonthCardExpiredEnterDay);
                dbOperator.AddParameter("AffirmBegin" + index, p.AffirmBegin);
                dbOperator.AddParameter("AffirmEnd" + index, p.AffirmEnd);
                dbOperator.AddParameter("IsNeedCapturePaper" + index, p.IsNeedCapturePaper);
                dbOperator.AddParameter("IsNeedAuthentication" + index, p.IsNeedAuthentication);
                dbOperator.AddParameter("IsDispatch" + index, p.IsDispatch);
                dbOperator.AddParameter("OnlineUnit" + index, p.OnlineUnit);
                dbOperator.AddParameter("IsIgnoreHZ" + index, p.IsIgnoreHZ);

                hasData = true;
                index++;
            }
            if (hasData)
            {
                return(dbOperator.ExecuteNonQuery(strSql.Remove(strSql.Length - 10, 10).ToString()) > 0);
            }
            return(false);
        }
Beispiel #11
0
        public bool Add(BaseParkinfo model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BaseParkinfo(PKID,PKNo,PKName,CarBitNum,CarBitNumLeft,CarBitNumFixed,SpaceBitNum");
            strSql.Append(",CenterTime,AllowLoseDisplay,LinkMan,Mobile,Address,Coordinate,MobilePay");
            strSql.Append(",MobileLock,IsParkingSpace,IsReverseSeekingVehicle,FeeRemark,OnLine,Remark");
            strSql.Append(",LastUpdateTime,HaveUpdate,CityID,VID,DataStatus,DataSaveDays,PictureSaveDays,IsOnLineGathe,IsLine,NeedFee,ExpiredAdvanceRemindDay,DefaultPlate,PoliceFree,UnconfirmedCalculation,IsNoPlateConfirm,SupportAutoRefund,OuterringCharge,SupportNoSense)");
            strSql.Append(" values(@PKID,@PKNo,@PKName,@CarBitNum,@CarBitNumLeft,@CarBitNumFixed,@SpaceBitNum");
            strSql.Append(",@CenterTime,@AllowLoseDisplay,@LinkMan,@Mobile,@Address,@Coordinate,@MobilePay");
            strSql.Append(",@MobileLock,@IsParkingSpace,@IsReverseSeekingVehicle,@FeeRemark,@OnLine,@Remark");
            strSql.Append(",@LastUpdateTime,@HaveUpdate,@CityID,@VID,@DataStatus,@DataSaveDays,@PictureSaveDays");
            strSql.Append(",@IsOnLineGathe,@IsLine,@NeedFee,@ExpiredAdvanceRemindDay,@DefaultPlate,@PoliceFree,@UnconfirmedCalculation,@IsNoPlateConfirm,@SupportAutoRefund,@OuterringCharge,@SupportNoSense)");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("PKID", model.PKID);
            dbOperator.AddParameter("PKNo", model.PKNo);
            dbOperator.AddParameter("PKName", model.PKName);
            dbOperator.AddParameter("CarBitNum", model.CarBitNum);
            dbOperator.AddParameter("CarBitNumLeft", model.CarBitNumLeft);
            dbOperator.AddParameter("CarBitNumFixed", model.CarBitNumFixed);
            dbOperator.AddParameter("SpaceBitNum", model.SpaceBitNum);
            dbOperator.AddParameter("CenterTime", model.CenterTime);
            dbOperator.AddParameter("AllowLoseDisplay", (int)model.AllowLoseDisplay);
            dbOperator.AddParameter("LinkMan", model.LinkMan);
            dbOperator.AddParameter("Mobile", model.Mobile);
            dbOperator.AddParameter("Address", model.Address);
            dbOperator.AddParameter("Coordinate", model.Coordinate);
            dbOperator.AddParameter("MobilePay", (int)model.MobilePay);
            dbOperator.AddParameter("MobileLock", (int)model.MobileLock);
            dbOperator.AddParameter("IsParkingSpace", (int)model.IsParkingSpace);
            dbOperator.AddParameter("IsReverseSeekingVehicle", (int)model.IsReverseSeekingVehicle);
            dbOperator.AddParameter("FeeRemark", model.FeeRemark);
            dbOperator.AddParameter("OnLine", (int)model.OnLine);
            dbOperator.AddParameter("Remark", model.Remark);
            dbOperator.AddParameter("CityID", model.CityID);
            dbOperator.AddParameter("VID", model.VID);
            dbOperator.AddParameter("DataSaveDays", model.DataSaveDays);
            dbOperator.AddParameter("PictureSaveDays", model.PictureSaveDays);
            dbOperator.AddParameter("IsOnLineGathe", (int)model.IsOnLineGathe);
            dbOperator.AddParameter("IsLine", (int)model.IsLine);
            dbOperator.AddParameter("NeedFee", (int)model.NeedFee);
            dbOperator.AddParameter("ExpiredAdvanceRemindDay", model.ExpiredAdvanceRemindDay);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            dbOperator.AddParameter("DefaultPlate", model.DefaultPlate);
            dbOperator.AddParameter("PoliceFree", model.PoliceFree);
            dbOperator.AddParameter("UnconfirmedCalculation", model.UnconfirmedCalculation);
            dbOperator.AddParameter("IsNoPlateConfirm", model.IsNoPlateConfirm);
            dbOperator.AddParameter("SupportAutoRefund", model.SupportAutoRefund);
            dbOperator.AddParameter("OuterringCharge", model.OuterringCharge);
            dbOperator.AddParameter("SupportNoSense", model.SupportNoSense);

            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #12
0
        public bool Update(ParkCarType model)
        {
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ParkCarType set CarTypeName=@CarTypeName,PKID=@PKID,BaseTypeID=@BaseTypeID,RepeatIn=@RepeatIn,RepeatOut");
            strSql.Append("=@RepeatOut,AffirmIn=@AffirmIn,AffirmOut=@AffirmOut,InBeginTime=@InBeginTime,InEdnTime=@InEdnTime,MaxUseMoney=@MaxUseMoney,AllowLose=@AllowLose,LpDistinguish=@LpDistinguish,InOutEditCar");
            strSql.Append("=@InOutEditCar,InOutTime=@InOutTime,CarNoLike=@CarNoLike,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate,IsAllowOnlIne=@IsAllowOnlIne,Amount=@Amount,MaxMonth=@MaxMonth,MaxValue=@MaxValue");
            strSql.Append(",OverdueToTemp=@OverdueToTemp,LotOccupy=@LotOccupy,Deposit=@Deposit,MonthCardExpiredEnterDay=@MonthCardExpiredEnterDay,AffirmBegin=@AffirmBegin,AffirmEnd=@AffirmEnd,IsNeedCapturePaper=@IsNeedCapturePaper,IsNeedAuthentication=@IsNeedAuthentication,IsDispatch=@IsDispatch,OnlineUnit=@OnlineUnit");
            strSql.Append(",IsIgnoreHZ=@IsIgnoreHZ where CarTypeID=@CarTypeID");
            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                dbOperator.ClearParameters();
                dbOperator.AddParameter("CarTypeID", model.CarTypeID);
                dbOperator.AddParameter("CarTypeName", model.CarTypeName);
                dbOperator.AddParameter("PKID", model.PKID);
                dbOperator.AddParameter("BaseTypeID", (int)model.BaseTypeID);
                dbOperator.AddParameter("RepeatIn", (int)model.RepeatIn);
                dbOperator.AddParameter("RepeatOut", (int)model.RepeatOut);
                dbOperator.AddParameter("AffirmIn", (int)model.AffirmIn);
                dbOperator.AddParameter("AffirmOut", (int)model.AffirmOut);
                dbOperator.AddParameter("InBeginTime", model.InBeginTime);
                dbOperator.AddParameter("InEdnTime", model.InEdnTime);
                dbOperator.AddParameter("MaxUseMoney", model.MaxUseMoney);
                dbOperator.AddParameter("AllowLose", (int)model.AllowLose);
                dbOperator.AddParameter("LpDistinguish", (int)model.LpDistinguish);
                dbOperator.AddParameter("InOutEditCar", (int)model.InOutEditCar);
                dbOperator.AddParameter("InOutTime", model.InOutTime);
                dbOperator.AddParameter("CarNoLike", (int)model.CarNoLike);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("IsAllowOnlIne", (int)model.IsAllowOnlIne);
                dbOperator.AddParameter("Amount", model.Amount);
                dbOperator.AddParameter("MaxMonth", model.MaxMonth);
                dbOperator.AddParameter("MaxValue", model.MaxValue);
                dbOperator.AddParameter("OverdueToTemp", (int)model.OverdueToTemp);
                dbOperator.AddParameter("LotOccupy", (int)model.LotOccupy);
                dbOperator.AddParameter("Deposit", model.Deposit);
                dbOperator.AddParameter("MonthCardExpiredEnterDay", model.MonthCardExpiredEnterDay);
                dbOperator.AddParameter("AffirmBegin", model.AffirmBegin);
                dbOperator.AddParameter("AffirmEnd", model.AffirmEnd);
                dbOperator.AddParameter("IsNeedCapturePaper", model.IsNeedCapturePaper);
                dbOperator.AddParameter("IsNeedAuthentication", model.IsNeedAuthentication);
                dbOperator.AddParameter("IsDispatch", model.IsDispatch);
                dbOperator.AddParameter("OnlineUnit", model.OnlineUnit);
                dbOperator.AddParameter("IsIgnoreHZ", model.IsIgnoreHZ);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #13
0
        public IEnumerable <Bunk> QueryBunkListView(DataTransferObject.Foundation.BunkQueryCondition condition, Core.Pagination pagination)
        {
            var result = new List <Bunk>();

            using (var dbOperator = new DbOperator(Provider, ConnectionString))
            {
                if (!string.IsNullOrWhiteSpace(condition.Airline))
                {
                    dbOperator.AddParameter("@iAirline", condition.Airline.Trim());
                }
                if (!string.IsNullOrWhiteSpace(condition.Departure))
                {
                    dbOperator.AddParameter("@iDeparture", condition.Departure.Trim());
                }
                if (!string.IsNullOrWhiteSpace(condition.Arrival))
                {
                    dbOperator.AddParameter("@iArrival", condition.Arrival.Trim());
                }
                if (!string.IsNullOrWhiteSpace(condition.BunkCode))
                {
                    dbOperator.AddParameter("@iBunkCode", condition.BunkCode.Trim());
                }
                if (condition.BunkType.HasValue)
                {
                    dbOperator.AddParameter("@iBunkType", (int)condition.BunkType);
                }
                if (condition.VoyageType.HasValue)
                {
                    dbOperator.AddParameter("@iVoyageType", (byte)condition.VoyageType);
                }
                if (condition.FlightBeginDate.HasValue)
                {
                    dbOperator.AddParameter("@iFlightBeginDate", condition.FlightBeginDate.Value.Date);
                }
                if (condition.FlightEndDate.HasValue)
                {
                    dbOperator.AddParameter("@iFlightEndDate", condition.FlightEndDate.Value.Date);
                }
                if (condition.Status.HasValue)
                {
                    dbOperator.AddParameter("@iStatus", condition.Status);
                }
                if (pagination != null)
                {
                    dbOperator.AddParameter("@iPageSize", pagination.PageSize);
                    dbOperator.AddParameter("@iPageIndex", pagination.PageIndex);
                }
                System.Data.Common.DbParameter totalCount = dbOperator.AddParameter("@oTotalCount");
                totalCount.DbType    = System.Data.DbType.Int32;
                totalCount.Direction = System.Data.ParameterDirection.Output;
                using (System.Data.Common.DbDataReader reader = dbOperator.ExecuteReader("dbo.P_QueryBunks", System.Data.CommandType.StoredProcedure))
                {
                    Guid?previousId = null;
                    Bunk bunk       = null;
                    while (reader.Read())
                    {
                        var currentId = reader.GetGuid(1);
                        if (bunk == null || previousId.Value != currentId)
                        {
                            bunk = null;
                        }
                        var bunkType = (BunkType)reader.GetInt32(0);
                        switch (bunkType)
                        {
                        case BunkType.Economic:
                            bunk = loadEconomicBunk(bunk, reader);
                            break;

                        case BunkType.FirstOrBusiness:
                            bunk = loadFirstBusinessBunk(bunk, reader);
                            break;

                        case BunkType.Promotion:
                            bunk = loadPromotionBunk(bunk, reader);
                            break;

                        case BunkType.Production:
                            bunk = loadProductionBunk(bunk, reader);
                            break;

                        case BunkType.Transfer:
                            bunk = loadTransferBunk(bunk, reader);
                            break;

                        case BunkType.Free:
                            bunk = loadFreeBunk(bunk, reader);
                            break;

                        case BunkType.Team:
                            bunk = loadTeamBunk(bunk, reader);
                            break;
                        }
                        bunk.VoyageType        = (VoyageTypeValue)reader.GetByte(19);
                        bunk.TravelType        = (TravelTypeValue)reader.GetByte(20);
                        bunk.PassengerType     = (PassengerTypeValue)reader.GetByte(21);
                        bunk.RefundRegulation  = reader.IsDBNull(8) ? string.Empty : reader.GetString(8);
                        bunk.ChangeRegulation  = reader.IsDBNull(16) ? string.Empty : reader.GetString(16);
                        bunk.EndorseRegulation = reader.IsDBNull(17) ? string.Empty : reader.GetString(17);
                        bunk.Remarks           = reader.IsDBNull(18) ? string.Empty : reader.GetString(18);
                        if (!previousId.HasValue || previousId.Value != currentId)
                        {
                            result.Add(bunk);
                            previousId = currentId;
                        }
                    }
                }
                if (pagination.GetRowCount)
                {
                    pagination.RowCount = (int)totalCount.Value;
                }
            }
            return(result);
        }
Beispiel #14
0
        string prepareInsert(DbOperator dbOperator, Bunk value)
        {
            string bunkSql = "INSERT INTO [T_Bunk]([Id],[Airline],[FlightBeginDate],[FlightEndDate],[ETDZDate],[Code],[Discount],[Valid],[Departure]," +
                             "[Arrival],[Type],[Description],ModifyTime,[VoyageType],[TravelType],[PassengerType],[RefundRegulation],[ChangeRegulation],[EndorseRegulation],[Remarks]) " +
                             "VALUES(@ID,@AIRLINE,@FLIGHTBEGINDATE,@FLIGHTENDDATE,@ETDZDATE,@CODE,@DISCOUNT,@VALID,@DEPARTURE,@ARRIVAL,@TYPE,@DESCRIPTION," +
                             "@ModifyTime,@VoyageType,@TravelType,@PassengerType,@RefundRegulation,@ChangeRegulation,@EndorseRegulation,@Remarks)";
            string extendedBunkInsertSql   = "INSERT INTO [T_ExtendedBunk] ([BunkId],[Code],[Discount])";
            string extendedBunkValueFormat = " SELECT @ID,@CODE{0},@DISCOUNT{0} UNION ALL";

            var sbSql = new StringBuilder(bunkSql);

            dbOperator.AddParameter("ID", value.Id);
            dbOperator.AddParameter("VoyageType", value.VoyageType);
            dbOperator.AddParameter("TravelType", value.TravelType);
            dbOperator.AddParameter("PassengerType", value.PassengerType);
            dbOperator.AddParameter("RefundRegulation", value.RefundRegulation);
            dbOperator.AddParameter("ChangeRegulation", value.ChangeRegulation);
            dbOperator.AddParameter("EndorseRegulation", value.EndorseRegulation);
            if (string.IsNullOrEmpty(value.Remarks))
            {
                dbOperator.AddParameter("Remarks", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("Remarks", value.Remarks);
            }
            if (value.AirlineCode.IsNullOrEmpty())
            {
                dbOperator.AddParameter("AIRLINE", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("AIRLINE", value.AirlineCode.Value);
            }
            dbOperator.AddParameter("FLIGHTBEGINDATE", value.FlightBeginDate);
            if (value.FlightEndDate.HasValue)
            {
                dbOperator.AddParameter("FLIGHTENDDATE", value.FlightEndDate.Value);
            }
            else
            {
                dbOperator.AddParameter("FLIGHTENDDATE", DBNull.Value);
            }
            dbOperator.AddParameter("ETDZDATE", value.ETDZDate);
            dbOperator.AddParameter("CODE", value.Code.Value);
            dbOperator.AddParameter("VALID", value.Valid);

            if (value is GeneralBunk)
            {
                var generalBunk = value as GeneralBunk;
                if (generalBunk.DepartureCode.IsNullOrEmpty())
                {
                    dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("DEPARTURE", generalBunk.DepartureCode.Value);
                }
                if (generalBunk.ArrivalCode.IsNullOrEmpty())
                {
                    dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                }
                else
                {
                    dbOperator.AddParameter("ARRIVAL", generalBunk.ArrivalCode.Value);
                }
                dbOperator.AddParameter("DISCOUNT", generalBunk.Discount);
                if (value is EconomicBunk)
                {
                    dbOperator.AddParameter("DESCRIPTION", DBNull.Value);
                }
                else if (value is FirstBusinessBunk)
                {
                    dbOperator.AddParameter("DESCRIPTION", (value as FirstBusinessBunk).Description ?? string.Empty);
                }
                if (generalBunk.Extended.Any())
                {
                    sbSql.Append(extendedBunkInsertSql);
                    int index = 0;
                    foreach (var item in generalBunk.Extended)
                    {
                        sbSql.AppendFormat(extendedBunkValueFormat, index);
                        dbOperator.AddParameter("CODE" + index.ToString(), item.Code.Value);
                        dbOperator.AddParameter("DISCOUNT" + index.ToString(), item.Discount);
                        index++;
                    }
                    sbSql.Remove(sbSql.Length - 10, 10);
                }
            }
            else if (value is PromotionBunk)
            {
                var promotionBunk = value as PromotionBunk;
                dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                dbOperator.AddParameter("DISCOUNT", DBNull.Value);
                dbOperator.AddParameter("DESCRIPTION", promotionBunk.Description ?? string.Empty);
                if (promotionBunk.Extended.Any())
                {
                    sbSql.Append(extendedBunkInsertSql);
                    int index = 0;
                    foreach (var item in promotionBunk.Extended)
                    {
                        sbSql.AppendFormat(extendedBunkValueFormat, index);
                        dbOperator.AddParameter("CODE" + index.ToString(), item);
                        dbOperator.AddParameter("DISCOUNT" + index.ToString(), 0);
                        index++;
                    }
                    sbSql.Remove(sbSql.Length - 10, 10);
                }
            }
            else if (value is ProductionBunk)
            {
                dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                dbOperator.AddParameter("DISCOUNT", DBNull.Value);
                dbOperator.AddParameter("DESCRIPTION", DBNull.Value);
            }
            else if (value is TransferBunk)
            {
                dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                dbOperator.AddParameter("DISCOUNT", DBNull.Value);
                dbOperator.AddParameter("DESCRIPTION", DBNull.Value);
            }
            else if (value is FreeBunk)
            {
                dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                dbOperator.AddParameter("DISCOUNT", DBNull.Value);
                dbOperator.AddParameter("DESCRIPTION", (value as FreeBunk).Description ?? string.Empty);
            }
            else if (value is TeamBunk)
            {
                dbOperator.AddParameter("DEPARTURE", DBNull.Value);
                dbOperator.AddParameter("ARRIVAL", DBNull.Value);
                dbOperator.AddParameter("DISCOUNT", DBNull.Value);
                dbOperator.AddParameter("DESCRIPTION", DBNull.Value);
            }
            else
            {
                return(null);
            }
            dbOperator.AddParameter("TYPE", (int)value.Type);
            dbOperator.AddParameter("ModifyTime", value.ModifyTime);
            return(sbSql.ToString());
        }
Beispiel #15
0
        /// <summary>
        /// 修改设备参数
        /// </summary>
        /// <param name="model"></param>
        /// <param name="dbOperator"></param>
        /// <returns></returns>
        public bool UpdateParam(ParkDeviceParam model, DbOperator dbOperator)
        {
            model.DataStatus     = (int)DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ParkDeviceParam set DeviceID=@DeviceID,VipMode=@VipMode,TempMode=@TempMode,NetOffMode=@NetOffMode,VipDevMultIn=@VipDevMultIn,PloicFree=@PloicFree,VipDutyDay=@VipDutyDay,OverDutyYorN=@OverDutyYorN,OverDutyDay=@OverDutyDay,SysID=@SysID,");
            strSql.Append(" DevID=@DevID,SysInDev=@SysInDev,SysOutDev=@SysOutDev,SysParkNumber=@SysParkNumber,DevInorOut=@DevInorOut,SwipeInterval=@SwipeInterval,UnKonwCardType=@UnKonwCardType,LEDNumber=@LEDNumber,DataStatus=@DataStatus,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate ");
            strSql.Append(" where RecordID=@RecordID");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("RecordID", model.RecordID);
            dbOperator.AddParameter("DeviceID", model.DeviceID);
            dbOperator.AddParameter("VipMode", model.VipMode);
            dbOperator.AddParameter("TempMode", model.TempMode);
            dbOperator.AddParameter("NetOffMode", model.NetOffMode);
            dbOperator.AddParameter("VipDevMultIn", model.VipDevMultIn);
            dbOperator.AddParameter("PloicFree", model.PloicFree);
            dbOperator.AddParameter("VipDutyDay", model.VipDutyDay);
            dbOperator.AddParameter("OverDutyYorN", model.OverDutyYorN);
            dbOperator.AddParameter("OverDutyDay", model.OverDutyDay);
            dbOperator.AddParameter("SysID", model.SysID);
            dbOperator.AddParameter("DevID", model.DevID);
            dbOperator.AddParameter("SysInDev", model.SysInDev);
            dbOperator.AddParameter("SysOutDev", model.SysOutDev);
            dbOperator.AddParameter("SysParkNumber", model.SysParkNumber);
            dbOperator.AddParameter("DevInorOut", model.DevInorOut);
            dbOperator.AddParameter("SwipeInterval", (int)model.SwipeInterval);
            dbOperator.AddParameter("UnKonwCardType", model.UnKonwCardType);
            dbOperator.AddParameter("LEDNumber", model.LEDNumber);
            dbOperator.AddParameter("DataStatus", model.DataStatus);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #16
0
        public ParkOrder Add(ParkOrder model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;
            model.RecordID       = GuidGenerator.GetGuidString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append(@"insert into ParkOrder(RecordID,Amount,CarderateID,CashMoney,CashTime,DataStatus,DiscountAmount,HaveUpdate,LastUpdateTime,NewMoney,NewUsefulDate,
                                    NewUserBegin,OldMoney,OldUserBegin,OldUserulDate,OnlineOrderNo,OnlineUserID,OrderNo,OrderSource,OrderTime,OrderType,PayAmount,
                                    PayTime,PayWay,PKID,Remark,Status,TagID,UnPayAmount,UserID,FeeRuleID) ");
            strSql.Append(@" values(@RecordID,@Amount,@CarderateID,@CashMoney,@CashTime,@DataStatus,@DiscountAmount,@HaveUpdate,@LastUpdateTime,@NewMoney,@NewUsefulDate,
                                    @NewUserBegin,@OldMoney,@OldUserBegin,@OldUserulDate,@OnlineOrderNo,@OnlineUserID,@OrderNo,@OrderSource,@OrderTime,@OrderType,@PayAmount,
                                    @PayTime,@PayWay,@PKID,@Remark,@Status,@TagID,@UnPayAmount,@UserID,@FeeRuleID);");
            strSql.Append(" select * from ParkOrder where RecordID=@RecordID ");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("RecordID", model.RecordID);
            dbOperator.AddParameter("Amount", model.Amount);
            dbOperator.AddParameter("CarderateID", model.CarderateID);
            dbOperator.AddParameter("CashMoney", model.CashMoney);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            dbOperator.AddParameter("DiscountAmount", model.DiscountAmount);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("NewMoney", model.NewMoney);
            if (model.CashTime == null)
            {
                dbOperator.AddParameter("CashTime", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("CashTime", model.CashTime);
            }
            if (model.NewUsefulDate == null)
            {
                dbOperator.AddParameter("NewUsefulDate", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("NewUsefulDate", model.NewUsefulDate);
            }
            if (model.OldUserulDate == null)
            {
                dbOperator.AddParameter("OldUserulDate", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("OldUserulDate", model.OldUserulDate);
            }
            if (model.OldUserBegin == null)
            {
                dbOperator.AddParameter("OldUserBegin", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("OldUserBegin", model.OldUserBegin);
            }
            if (model.NewUserBegin == null)
            {
                dbOperator.AddParameter("NewUserBegin", DBNull.Value);
            }
            else
            {
                dbOperator.AddParameter("NewUserBegin", model.NewUserBegin);
            }
            dbOperator.AddParameter("OldMoney", model.OldMoney);
            dbOperator.AddParameter("OnlineOrderNo", model.OnlineOrderNo);
            dbOperator.AddParameter("OnlineUserID", model.OnlineUserID);
            dbOperator.AddParameter("OrderNo", model.OrderNo);
            dbOperator.AddParameter("OrderSource", model.OrderSource);
            dbOperator.AddParameter("OrderTime", model.OrderTime);
            dbOperator.AddParameter("OrderType", model.OrderType);
            dbOperator.AddParameter("PayAmount", model.PayAmount);
            dbOperator.AddParameter("PayTime", model.PayTime);
            dbOperator.AddParameter("PayWay", model.PayWay);
            dbOperator.AddParameter("PKID", model.PKID);
            dbOperator.AddParameter("FeeRuleID", model.FeeRuleID);
            dbOperator.AddParameter("Remark", model.Remark);
            dbOperator.AddParameter("Status", model.Status);
            dbOperator.AddParameter("TagID", model.TagID);
            dbOperator.AddParameter("UnPayAmount", model.UnPayAmount);
            dbOperator.AddParameter("UserID", model.UserID);
            using (DbDataReader reader = dbOperator.ExecuteReader(strSql.ToString()))
            {
                if (reader.Read())
                {
                    return(DataReaderToModel <ParkOrder> .ToModel(reader));
                }
                return(null);
            }
        }
Beispiel #17
0
        public bool Update(ParkDevice model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ParkDevice set DeviceID=@DeviceID,GateID=@GateID,DeviceType=@DeviceType,PortType=@PortType,Baudrate=@Baudrate,SerialPort=@SerialPort,IpAddr=@IpAddr,IpPort=@IpPort,UserName=@UserName,UserPwd=@UserPwd,NetID=@NetID,LedNum=@LedNum,IsMonitor=@IsMonitor");
            strSql.Append(",DeviceNo=@DeviceNo,OfflinePort=@OfflinePort,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate,IsCapture=@IsCapture,IsSVoice=@IsSVoice,IsCarBit=@IsCarBit,IsContestDev=@IsContestDev,ControllerType=@ControllerType,DisplayMode=@DisplayMode where DeviceID=@DeviceID");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("DeviceID", model.DeviceID);
            dbOperator.AddParameter("GateID", model.GateID);
            dbOperator.AddParameter("DeviceType", model.DeviceType);
            dbOperator.AddParameter("PortType", model.PortType);
            dbOperator.AddParameter("Baudrate", model.Baudrate);
            dbOperator.AddParameter("SerialPort", model.SerialPort);
            dbOperator.AddParameter("IpAddr", model.IpAddr);
            dbOperator.AddParameter("IpPort", model.IpPort);
            dbOperator.AddParameter("UserName", model.UserName);
            dbOperator.AddParameter("UserPwd", model.UserPwd);
            dbOperator.AddParameter("NetID", model.NetID);
            dbOperator.AddParameter("LedNum", model.LedNum);
            dbOperator.AddParameter("DeviceNo", model.DeviceNo);
            dbOperator.AddParameter("OfflinePort", model.OfflinePort);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("IsCapture", model.IsCapture);
            dbOperator.AddParameter("IsSVoice", model.IsSVoice);
            dbOperator.AddParameter("IsCarBit", model.IsCarBit);
            dbOperator.AddParameter("IsContestDev", model.IsContestDev);
            dbOperator.AddParameter("ControllerType", model.ControllerType);
            dbOperator.AddParameter("DisplayMode", model.DisplayMode);
            dbOperator.AddParameter("IsMonitor", model.IsMonitor);

            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #18
0
 public bool Create(OnlineOrder model)
 {
     using (DbOperator dbOperator = ConnectionManager.CreateConnection())
     {
         dbOperator.ClearParameters();
         StringBuilder strSql = new StringBuilder();
         strSql.Append("INSERT INTO OnlineOrder(OrderID,PKID,PKName,InOutID,PlateNo,EntranceTime,ExitTime,Amount,PaymentChannel,PayBank");
         strSql.Append(",PayAccount,Payer,PayeeChannel,PayeeBank,PayeeAccount,PayeeUser,PayDetailID,SerialNumber,PrepayId,MonthNum,AccountID");
         strSql.Append(",CardId,SyncResultTimes,LastSyncResultTime,ParkCardNo,Balance,RefundOrderId,Remark,OrderType,Status,OrderTime,RealPayTime");
         strSql.Append(",BookingStartTime,BookingEndTime,BookingAreaID,BookingBitNo,CompanyID,OrderSource,ExternalPKID,TagID)");
         strSql.Append(" values(@OrderID,@PKID,@PKName,@InOutID,@PlateNo,@EntranceTime,@ExitTime,@Amount,@PaymentChannel,@PayBank");
         strSql.Append(",@PayAccount,@Payer,@PayeeChannel,@PayeeBank,@PayeeAccount,@PayeeUser,@PayDetailID,@SerialNumber,@PrepayId,@MonthNum,@AccountID");
         strSql.Append(",@CardId,@SyncResultTimes,@LastSyncResultTime,@ParkCardNo,@Balance,@RefundOrderId,@Remark,@OrderType,@Status,@OrderTime,@RealPayTime");
         strSql.Append(",@BookingStartTime,@BookingEndTime,@BookingAreaID,@BookingBitNo,@CompanyID,@OrderSource,@ExternalPKID,@TagID)");
         dbOperator.AddParameter("OrderID", model.OrderID);
         dbOperator.AddParameter("PKID", model.PKID);
         dbOperator.AddParameter("PKName", model.PKName);
         dbOperator.AddParameter("InOutID", model.InOutID);
         dbOperator.AddParameter("PlateNo", model.PlateNo);
         dbOperator.AddParameter("EntranceTime", model.EntranceTime);
         dbOperator.AddParameter("ExitTime", model.ExitTime);
         dbOperator.AddParameter("Amount", model.Amount);
         dbOperator.AddParameter("PaymentChannel", (int)model.PaymentChannel);
         dbOperator.AddParameter("PayBank", model.PayBank);
         dbOperator.AddParameter("PayAccount", model.PayAccount);
         dbOperator.AddParameter("Payer", model.Payer);
         dbOperator.AddParameter("PayeeChannel", (int)model.PayeeChannel);
         dbOperator.AddParameter("PayeeBank", model.PayeeBank);
         dbOperator.AddParameter("PayeeAccount", model.PayeeAccount);
         dbOperator.AddParameter("PayeeUser", model.PayeeUser);
         dbOperator.AddParameter("PayDetailID", model.PayDetailID);
         dbOperator.AddParameter("SerialNumber", model.SerialNumber);
         dbOperator.AddParameter("PrepayId", model.PrepayId);
         dbOperator.AddParameter("MonthNum", model.MonthNum);
         dbOperator.AddParameter("AccountID", model.AccountID);
         dbOperator.AddParameter("CardId", model.CardId);
         dbOperator.AddParameter("SyncResultTimes", model.SyncResultTimes);
         dbOperator.AddParameter("LastSyncResultTime", model.LastSyncResultTime);
         dbOperator.AddParameter("ParkCardNo", model.ParkCardNo);
         dbOperator.AddParameter("Balance", model.Balance);
         dbOperator.AddParameter("RefundOrderId", model.RefundOrderId);
         dbOperator.AddParameter("Remark", model.Remark);
         dbOperator.AddParameter("OrderType", model.OrderType);
         dbOperator.AddParameter("Status", model.Status);
         dbOperator.AddParameter("OrderTime", model.OrderTime);
         dbOperator.AddParameter("RealPayTime", model.RealPayTime);
         dbOperator.AddParameter("BookingStartTime", model.BookingStartTime);
         dbOperator.AddParameter("BookingEndTime", model.BookingEndTime);
         dbOperator.AddParameter("BookingAreaID", model.BookingAreaID);
         dbOperator.AddParameter("BookingBitNo", model.BookingBitNo);
         dbOperator.AddParameter("CompanyID", model.CompanyID);
         dbOperator.AddParameter("OrderSource", model.OrderSource);
         dbOperator.AddParameter("ExternalPKID", model.ExternalPKID);
         dbOperator.AddParameter("TagID", model.TagID);
         return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
     }
 }
Beispiel #19
0
        public bool Add(ParkArea model)
        {
            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                model.DataStatus     = DataStatus.Normal;
                model.LastUpdateTime = DateTime.Now;
                model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into ParkArea(AreaID,AreaName,MasterID,PKID,CarbitNum,NeedToll,CameraWaitTime,TwoCameraWait,Remark,LastUpdateTime,HaveUpdate,DataStatus)");
                strSql.Append(" values(@AreaID,@AreaName,@MasterID,@PKID,@CarbitNum,@NeedToll,@CameraWaitTime,@TwoCameraWait,@Remark,@LastUpdateTime,@HaveUpdate,@DataStatus)");
                dbOperator.ClearParameters();
                dbOperator.AddParameter("AreaID", model.AreaID);
                dbOperator.AddParameter("AreaName", model.AreaName);
                dbOperator.AddParameter("MasterID", model.MasterID);
                dbOperator.AddParameter("PKID", model.PKID);
                dbOperator.AddParameter("CarbitNum", model.CarbitNum);
                dbOperator.AddParameter("NeedToll", (int)model.NeedToll);
                dbOperator.AddParameter("CameraWaitTime", (int)model.CameraWaitTime);
                dbOperator.AddParameter("TwoCameraWait", (int)model.TwoCameraWait);
                dbOperator.AddParameter("Remark", model.Remark);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #20
0
        public bool Add(BaseVillage model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BaseVillage(VID,VNo,VName,CPID,LinkMan,Mobile,Address,Coordinate,ProxyNo,LastUpdateTime,HaveUpdate,DataStatus,IsBoxWatch)");
            strSql.Append(" values(@VID,@VNo,@VName,@CPID,@LinkMan,@Mobile,@Address,@Coordinate,@ProxyNo,@LastUpdateTime,@HaveUpdate,@DataStatus,@IsBoxWatch)");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("VID", model.VID);
            dbOperator.AddParameter("VNo", model.VNo);
            dbOperator.AddParameter("VName", model.VName);
            dbOperator.AddParameter("CPID", model.CPID);
            dbOperator.AddParameter("LinkMan", model.LinkMan);
            dbOperator.AddParameter("Mobile", model.Mobile);
            dbOperator.AddParameter("Address", model.Address);
            dbOperator.AddParameter("Coordinate", model.Coordinate);
            dbOperator.AddParameter("ProxyNo", model.ProxyNo);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            dbOperator.AddParameter("IsBoxWatch", model.IsBoxWatch);
            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #21
0
        public bool Update(ParkCarModel model)
        {
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ParkCarModel set CarModelName=@CarModelName,IsDefault=@IsDefault,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate,MaxUseMoney=@MaxUseMoney,IsNaturalDay=@IsNaturalDay,PlateColor=@PlateColor ");
            strSql.Append(",DayMaxMoney=@DayMaxMoney,NightMaxMoney=@NightMaxMoney,DayStartTime=@DayStartTime,DayEndTime=@DayEndTime,NightStartTime=@NightStartTime,NightEndTime=@NightEndTime where  CarModelID=@CarModelID");
            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                UpdateDefault(model, dbOperator);

                dbOperator.ClearParameters();
                dbOperator.AddParameter("CarModelName", model.CarModelName);
                dbOperator.AddParameter("IsDefault", (int)model.IsDefault);
                dbOperator.AddParameter("CarModelID", model.CarModelID);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("MaxUseMoney", model.MaxUseMoney);
                dbOperator.AddParameter("IsNaturalDay", model.IsNaturalDay);
                dbOperator.AddParameter("PlateColor", model.PlateColor);

                dbOperator.AddParameter("DayMaxMoney", model.DayMaxMoney);
                dbOperator.AddParameter("NightMaxMoney", model.NightMaxMoney);
                dbOperator.AddParameter("DayStartTime", model.DayStartTime);
                dbOperator.AddParameter("DayEndTime", model.DayEndTime);
                dbOperator.AddParameter("NightStartTime", model.NightStartTime);
                dbOperator.AddParameter("NightEndTime", model.NightEndTime);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #22
0
        public bool Update(BaseVillage model)
        {
            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                model.DataStatus     = DataStatus.Normal;
                model.LastUpdateTime = DateTime.Now;
                model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                StringBuilder strSql = new StringBuilder();
                strSql.Append("update BaseVillage set VNo=@VNo,VName=@VName,CPID=@CPID,LinkMan=@LinkMan,Mobile=@Mobile,Address=@Address,Coordinate=@Coordinate,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate");
                strSql.Append(" ,IsBoxWatch=@IsBoxWatch where VID=@VID");
                dbOperator.ClearParameters();
                dbOperator.AddParameter("VID", model.VID);
                dbOperator.AddParameter("VNo", model.VNo);
                dbOperator.AddParameter("VName", model.VName);
                dbOperator.AddParameter("CPID", model.CPID);
                dbOperator.AddParameter("LinkMan", model.LinkMan);
                dbOperator.AddParameter("Mobile", model.Mobile);
                dbOperator.AddParameter("Address", model.Address);
                dbOperator.AddParameter("Coordinate", model.Coordinate);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("IsBoxWatch", model.IsBoxWatch);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #23
0
        public bool Add(BaseCard model, DbOperator dbOperator)
        {
            model.DataStatus = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into BaseCard(CardID,EmployeeID,CardNo,CardNumb,CardType,Balance,State,Deposit,RegisterTime ,OperatorID,CardSystem,VID,LastUpdateTime,HaveUpdate,DataStatus)");
            strSql.Append(" values(@CardID,@EmployeeID,@CardNo,@CardNumb,@CardType,@Balance,@State,@Deposit,@RegisterTime ,@OperatorID,@CardSystem,@VID,@LastUpdateTime,@HaveUpdate,@DataStatus)");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("CardID", model.CardID);
            dbOperator.AddParameter("EmployeeID", model.EmployeeID);
            dbOperator.AddParameter("CardNo", model.CardNo);
            dbOperator.AddParameter("CardNumb", model.CardNumb);
            dbOperator.AddParameter("CardType", (int)model.CardType);
            dbOperator.AddParameter("Balance", model.Balance);
            dbOperator.AddParameter("State", (int)model.State);
            dbOperator.AddParameter("Deposit", model.Deposit);
            dbOperator.AddParameter("RegisterTime", model.RegisterTime);
            dbOperator.AddParameter("OperatorID",model.OperatorID);
            dbOperator.AddParameter("CardSystem", (int)model.CardSystem);
            dbOperator.AddParameter("VID",model.VID);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            return dbOperator.ExecuteNonQuery(strSql.ToString()) > 0;
        }
Beispiel #24
0
        private bool AddFeeRule(ParkFeeRule model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ParkFeeRule(FeeRuleID,RuleName,FeeType,CarTypeID,CarModelID,AreaID,LastUpdateTime,HaveUpdate,DataStatus,RuleText,IsOffline)");
            strSql.Append(" values(@FeeRuleID,@RuleName,@FeeType,@CarTypeID,@CarModelID,@AreaID,@LastUpdateTime,@HaveUpdate,@DataStatus,@RuleText,@IsOffline)");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("FeeRuleID", model.FeeRuleID);
            dbOperator.AddParameter("RuleName", model.RuleName);
            dbOperator.AddParameter("FeeType", (int)model.FeeType);
            dbOperator.AddParameter("CarTypeID", model.CarTypeID);
            dbOperator.AddParameter("CarModelID", model.CarModelID);
            dbOperator.AddParameter("AreaID", model.AreaID);
            dbOperator.AddParameter("RuleText", model.RuleText);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            dbOperator.AddParameter("IsOffline", model.IsOffline);
            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #25
0
        public bool ModifyBaseCard(BaseCard model, out string ErrorMessage)
        {
            ErrorMessage = "";
            try
            {
                using (DbOperator dbOperator = ConnectionManager.CreateConnection())
                {
                    model.LastUpdateTime = DateTime.Now;
                    model.HaveUpdate = SystemDefaultConfig.DataUpdateFlag;

                    StringBuilder strSql = new StringBuilder();
                    strSql.Append(@"update BaseCard set Balance=@Balance,CardID=@CardID,CardNo=@CardNo,
                                    CardNumb=@CardNumb,CardSystem=@CardSystem,CardType=@CardType,
                                    Deposit=@Deposit,EmployeeID=@EmployeeID,HaveUpdate=@HaveUpdate,LastUpdateTime=@LastUpdateTime,
                                    OperatorID=@OperatorID,State=@State,VID=@VID");
                    strSql.Append(" where CardID=@CardID");
                    dbOperator.ClearParameters();
                    dbOperator.AddParameter("Balance", model.Balance);
                    dbOperator.AddParameter("CardID", model.CardID);
                    dbOperator.AddParameter("CardNo", model.CardNo);
                    dbOperator.AddParameter("CardNumb", model.CardNumb);
                    dbOperator.AddParameter("CardSystem", (int)model.CardSystem);
                    dbOperator.AddParameter("CardType", (int)model.CardType);  
                    dbOperator.AddParameter("Deposit", model.Deposit);
                    dbOperator.AddParameter("EmployeeID", model.EmployeeID);
                    dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                    dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                    dbOperator.AddParameter("OperatorID", model.OperatorID);
                    dbOperator.AddParameter("State", (int)model.State);
                    dbOperator.AddParameter("VID", model.VID);
                    return dbOperator.ExecuteNonQuery(strSql.ToString()) > 0;
                }
            }
            catch (Exception e)
            {
                ErrorMessage = e.Message;
            }
            return false;
        }
Beispiel #26
0
        private bool AddFeeRuleDetails(List <ParkFeeRuleDetail> parkFeeRuleDetails, DbOperator dbOperator)
        {
            if (parkFeeRuleDetails == null || parkFeeRuleDetails.Count == 0)
            {
                throw new ArgumentNullException("parkFeeRuleDetails");
            }

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ParkFeeRuleDetail(RuleDetailID,RuleID,StartTime,EndTime,Supplement,LoopType,Limit");
            strSql.Append(",FreeTime,FirstTime,FirstFee,Loop1PerTime,Loop1PerFee,Loop2Start,Loop2PerTime,Loop2PerFee,LastUpdateTime,HaveUpdate,DataStatus)");
            strSql.Append(" values(@RuleDetailID,@RuleID,@StartTime,@EndTime,@Supplement,@LoopType,@Limit");
            strSql.Append(",@FreeTime,@FirstTime,@FirstFee,@Loop1PerTime,@Loop1PerFee,@Loop2Start,@Loop2PerTime,@Loop2PerFee,@LastUpdateTime,@HaveUpdate,@DataStatus)");

            foreach (var model in parkFeeRuleDetails)
            {
                model.DataStatus     = DataStatus.Normal;
                model.LastUpdateTime = DateTime.Now;
                model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

                dbOperator.ClearParameters();
                dbOperator.AddParameter("RuleDetailID", model.RuleDetailID);
                dbOperator.AddParameter("RuleID", model.RuleID);
                dbOperator.AddParameter("StartTime", model.StartTime);
                dbOperator.AddParameter("EndTime", model.EndTime);
                dbOperator.AddParameter("Supplement", model.Supplement);
                dbOperator.AddParameter("LoopType", (int)model.LoopType);
                dbOperator.AddParameter("Limit", model.Limit);
                dbOperator.AddParameter("FreeTime", model.FreeTime);
                dbOperator.AddParameter("FirstTime", model.FirstTime);
                dbOperator.AddParameter("FirstFee", model.FirstFee);
                dbOperator.AddParameter("Loop1PerTime", model.Loop1PerTime);
                dbOperator.AddParameter("Loop1PerFee", model.Loop1PerFee);
                dbOperator.AddParameter("Loop2Start", model.Loop2Start);
                dbOperator.AddParameter("Loop2PerTime", model.Loop2PerTime);
                dbOperator.AddParameter("Loop2PerFee", model.Loop2PerFee);
                dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
                bool result = dbOperator.ExecuteNonQuery(strSql.ToString()) > 0;
                if (!result)
                {
                    return(false);
                }
            }
            return(true);
        }
        //        public int Update(Domain.CompanyUpgrade companyUpgrade) {
        //            string sql = @"UPDATE [dbo].[T_CompanyUpgradeApplication] SET [UserNo] = @UserNo,[Name] = @Name,[AbbreviateName] = @AbbreviateName,[OrginationCode] = @OrginationCode,
        //                         [OfficePhones] = @OfficePhones,[ManagerName] = @ManagerName,[ManagerPhone] = @ManagerPhone,[EmergencyName] = @EmergencyName,[EmergencyPhone] = @EmergencyPhone,
        //                         [Type] = @Type,[AccountType] = @AccountType,[Audited] =@Audited,[AuditTime]=@AuditTime,[ApplyTime] = @ApplyTime WHERE [Company] = @Company";
        //            using (var dbOperator = new DbOperator(Provider, ConnectionString)) {
        //                dbOperator.AddParameter("Company", companyUpgrade.CompanyId);
        //                dbOperator.AddParameter("UserNo", companyUpgrade.UserNo);
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.CompanyName)) {
        //                    dbOperator.AddParameter("Name", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("Name", companyUpgrade.CompanyName);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.AbbreviateName)) {
        //                    dbOperator.AddParameter("AbbreviateName", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("AbbreviateName", companyUpgrade.AbbreviateName);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.OrginationCode)) {
        //                    dbOperator.AddParameter("OrginationCode", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("OrginationCode", companyUpgrade.OrginationCode);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.CompanyPhone)) {
        //                    dbOperator.AddParameter("OfficePhones", DBNull.Value);
        //                }  else {
        //                    dbOperator.AddParameter("OfficePhones", companyUpgrade.CompanyPhone);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.ManagerName)) {
        //                    dbOperator.AddParameter("ManagerName", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("ManagerName", companyUpgrade.ManagerName);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.ManagerPhone)) {
        //                    dbOperator.AddParameter("ManagerPhone", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("ManagerPhone", companyUpgrade.ManagerPhone);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.EmergencyName)) {
        //                    dbOperator.AddParameter("EmergencyName", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("EmergencyName", companyUpgrade.EmergencyName);
        //                }
        //                if (string.IsNullOrWhiteSpace(companyUpgrade.EmergencyPhone)) {
        //                    dbOperator.AddParameter("EmergencyPhone", DBNull.Value);
        //                } else {
        //                    dbOperator.AddParameter("EmergencyPhone", companyUpgrade.EmergencyPhone);
        //                }
        //                dbOperator.AddParameter("Type", (int)companyUpgrade.CompanyType);
        //                dbOperator.AddParameter("AccountType", (int)companyUpgrade.AccountType);
        //                dbOperator.AddParameter("Audited",companyUpgrade.Audited);
        //                if (companyUpgrade.AuditTime.HasValue) {
        //                    dbOperator.AddParameter("AuditTime", companyUpgrade.AuditTime);
        //                } else  {
        //                    dbOperator.AddParameter("AuditTime",DBNull.Value);
        //                }
        //                dbOperator.AddParameter("ApplyTime", companyUpgrade.ApplyTime);
        //                return dbOperator.ExecuteNonQuery(sql);
        //            }
        //        }

        public CompanyUpgrade Query(Guid companyId)
        {
            CompanyUpgrade companyUpgrade = null;
            string         sql            = @"SELECT [UserNo],[Name],[AbbreviateName],[OrginationCode],[OfficePhones],[ManagerName],[ManagerPhone],
                         [EmergencyName],[EmergencyPhone],[Type],[AccountType],[Audited],[AuditTime],[ApplyTime] FROM [dbo].[T_CompanyUpgradeApplication]
                          WHERE  [Company] = @Company";

            using (var dbOperator = new DbOperator(Provider, ConnectionString))
            {
                dbOperator.AddParameter("Company", companyId);
                using (var reader = dbOperator.ExecuteReader(sql))
                {
                    while (reader.Read())
                    {
                        companyUpgrade         = new CompanyUpgrade();
                        companyUpgrade.Company = companyId;
                        companyUpgrade.UserNo  = reader.GetString(0);
                        if (!reader.IsDBNull(1))
                        {
                            companyUpgrade.Name = reader.GetString(1);
                        }
                        if (!reader.IsDBNull(2))
                        {
                            companyUpgrade.AbbreviateName = reader.GetString(2);
                        }
                        if (!reader.IsDBNull(3))
                        {
                            companyUpgrade.OrginationCode = reader.GetString(3);
                        }
                        if (!reader.IsDBNull(4))
                        {
                            companyUpgrade.OfficePhones = reader.GetString(4);
                        }
                        if (!reader.IsDBNull(5))
                        {
                            companyUpgrade.ManagerName = reader.GetString(5);
                        }
                        if (!reader.IsDBNull(6))
                        {
                            companyUpgrade.ManagerPhone = reader.GetString(6);
                        }
                        if (!reader.IsDBNull(7))
                        {
                            companyUpgrade.EmergencyName = reader.GetString(7);
                        }
                        if (!reader.IsDBNull(8))
                        {
                            companyUpgrade.EmergencyPhone = reader.GetString(8);
                        }
                        companyUpgrade.Type        = (Common.Enums.CompanyType)reader.GetByte(9);
                        companyUpgrade.AccountType = (Common.Enums.AccountBaseType)reader.GetByte(10);
                        companyUpgrade.Audited     = reader.GetBoolean(11);
                        if (!reader.IsDBNull(12))
                        {
                            companyUpgrade.AuditTime = reader.GetDateTime(12);
                        }
                        companyUpgrade.ApplyTime = reader.GetDateTime(13);
                    }
                }
            }
            return(companyUpgrade);
        }
Beispiel #28
0
        public bool Add(ParkDevice model, DbOperator dbOperator)
        {
            model.DataStatus     = DataStatus.Normal;
            model.LastUpdateTime = DateTime.Now;
            model.HaveUpdate     = SystemDefaultConfig.DataUpdateFlag;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ParkDevice(DeviceID,GateID,DeviceType,PortType,Baudrate,SerialPort,IpAddr,IpPort,UserName,UserPwd,NetID,LedNum,DeviceNo,OfflinePort,DataStatus,LastUpdateTime,HaveUpdate,IsCapture,IsSVoice,IsCarBit,IsContestDev,ControllerType,DisplayMode,IsMonitor)");
            strSql.Append(" values(@DeviceID,@GateID,@DeviceType,@PortType,@Baudrate,@SerialPort,@IpAddr,@IpPort,@UserName,@UserPwd,@NetID,@LedNum,@DeviceNo,@OfflinePort,@DataStatus,@LastUpdateTime,@HaveUpdate,@IsCapture,@IsSVoice,@IsCarBit,@IsContestDev,@ControllerType,@DisplayMode,@IsMonitor)");
            dbOperator.ClearParameters();
            dbOperator.AddParameter("DeviceID", model.DeviceID);
            dbOperator.AddParameter("GateID", model.GateID);
            dbOperator.AddParameter("DeviceType", model.DeviceType);
            dbOperator.AddParameter("PortType", model.PortType);
            dbOperator.AddParameter("Baudrate", model.Baudrate);
            dbOperator.AddParameter("SerialPort", model.SerialPort);
            dbOperator.AddParameter("IpAddr", model.IpAddr);
            dbOperator.AddParameter("IpPort", model.IpPort);
            dbOperator.AddParameter("UserName", model.UserName);
            dbOperator.AddParameter("UserPwd", model.UserPwd);
            dbOperator.AddParameter("NetID", model.NetID);
            dbOperator.AddParameter("LedNum", model.LedNum);
            dbOperator.AddParameter("DeviceNo", model.DeviceNo);
            dbOperator.AddParameter("OfflinePort", model.OfflinePort);
            dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
            dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
            dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
            dbOperator.AddParameter("IsCapture", model.IsCapture);
            dbOperator.AddParameter("IsSVoice", model.IsSVoice);
            dbOperator.AddParameter("IsCarBit", model.IsCarBit);
            dbOperator.AddParameter("IsContestDev", model.IsContestDev);
            dbOperator.AddParameter("ControllerType", model.ControllerType);
            dbOperator.AddParameter("DisplayMode", model.DisplayMode);
            dbOperator.AddParameter("IsMonitor", model.IsMonitor);

            return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
        }
Beispiel #29
0
        public bool Create(WX_Menu model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into WX_Menu(MenuName,Url,KeywordId,MenuType,Sort,MasterID,DataStatus,CreateTime,CompanyID,MinIprogramAppId,MinIprogramPagePath)");
            strSql.Append(" values(@MenuName,@Url,@KeywordId,@MenuType,@Sort,@MasterID,@DataStatus,@CreateTime,@CompanyID,@MinIprogramAppId,@MinIprogramPagePath)");

            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                dbOperator.ClearParameters();
                dbOperator.AddParameter("MenuName", model.MenuName);
                dbOperator.AddParameter("Url", model.Url);
                dbOperator.AddParameter("KeywordId", model.KeywordId);

                dbOperator.AddParameter("MenuType", (int)model.MenuType);
                dbOperator.AddParameter("Sort", model.Sort);
                dbOperator.AddParameter("MasterID", model.MasterID);
                dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
                dbOperator.AddParameter("CreateTime", DateTime.Now);
                dbOperator.AddParameter("CompanyID", model.CompanyID);
                dbOperator.AddParameter("MinIprogramAppId", model.MinIprogramAppId);
                dbOperator.AddParameter("MinIprogramPagePath", model.MinIprogramPagePath);
                return(dbOperator.ExecuteNonQuery(strSql.ToString()) > 0);
            }
        }
Beispiel #30
0
        /// <summary>
        /// 退款操作
        /// </summary>
        /// <param name="GID"></param>
        /// <param name="Amout"></param>
        /// <param name="EndTime"></param>
        /// <returns></returns>
        public bool RefundCardAmout(List <ParkGrant> grantlist, DateTime EndTime, ParkOrder model)
        {
            try
            {
                using (DbOperator dbOperator = ConnectionManager.CreateReadConnection())
                {
                    dbOperator.BeginTransaction();
                    foreach (var obj in grantlist)
                    {
                        string strsql = "update ParkGrant set EndDate=@EndDate,LastUpdateTime=@LastUpdateTime,HaveUpdate=@HaveUpdate where GID=@GID";
                        dbOperator.ClearParameters();
                        dbOperator.AddParameter("EndDate", EndTime);
                        dbOperator.AddParameter("LastUpdateTime", DateTime.Now);
                        dbOperator.AddParameter("HaveUpdate", SystemDefaultConfig.DataUpdateFlag);
                        dbOperator.AddParameter("GID", obj.GID);
                        if (dbOperator.ExecuteNonQuery(strsql) < 0)
                        {
                            dbOperator.RollbackTransaction();
                            return(false);
                        }
                    }

                    StringBuilder strSql = new StringBuilder();
                    strSql.Append(@"insert into ParkOrder(RecordID,Amount,CarderateID,CashMoney,CashTime,DataStatus,DiscountAmount,HaveUpdate,LastUpdateTime,NewMoney,NewUsefulDate,
                                    NewUserBegin,OldMoney,OldUserBegin,OldUserulDate,OnlineOrderNo,OnlineUserID,OrderNo,OrderSource,OrderTime,OrderType,PayAmount,
                                    PayTime,PayWay,PKID,Remark,Status,TagID,UnPayAmount,UserID,FeeRuleID) ");
                    strSql.Append(@" values(@RecordID,@Amount,@CarderateID,@CashMoney,@CashTime,@DataStatus,@DiscountAmount,@HaveUpdate,@LastUpdateTime,@NewMoney,@NewUsefulDate,
                                    @NewUserBegin,@OldMoney,@OldUserBegin,@OldUserulDate,@OnlineOrderNo,@OnlineUserID,@OrderNo,@OrderSource,@OrderTime,@OrderType,@PayAmount,
                                    @PayTime,@PayWay,@PKID,@Remark,@Status,@TagID,@UnPayAmount,@UserID,@FeeRuleID);");
                    dbOperator.ClearParameters();
                    dbOperator.AddParameter("RecordID", model.RecordID);
                    dbOperator.AddParameter("Amount", model.Amount);
                    dbOperator.AddParameter("CarderateID", model.CarderateID);
                    dbOperator.AddParameter("CashMoney", model.CashMoney);
                    dbOperator.AddParameter("DataStatus", (int)model.DataStatus);
                    dbOperator.AddParameter("DiscountAmount", model.DiscountAmount);
                    dbOperator.AddParameter("HaveUpdate", model.HaveUpdate);
                    dbOperator.AddParameter("LastUpdateTime", model.LastUpdateTime);
                    dbOperator.AddParameter("NewMoney", model.NewMoney);
                    dbOperator.AddParameter("CashTime", DBNull.Value);
                    dbOperator.AddParameter("NewUsefulDate", model.NewUsefulDate);
                    dbOperator.AddParameter("OldUserulDate", model.OldUserulDate);
                    dbOperator.AddParameter("OldUserBegin", model.OldUserBegin);
                    dbOperator.AddParameter("NewUserBegin", model.NewUserBegin);
                    dbOperator.AddParameter("OldMoney", model.OldMoney);
                    dbOperator.AddParameter("OnlineOrderNo", model.OnlineOrderNo);
                    dbOperator.AddParameter("OnlineUserID", model.OnlineUserID);
                    dbOperator.AddParameter("OrderNo", model.OrderNo);
                    dbOperator.AddParameter("OrderSource", model.OrderSource);
                    dbOperator.AddParameter("OrderTime", model.OrderTime);
                    dbOperator.AddParameter("OrderType", model.OrderType);
                    dbOperator.AddParameter("PayAmount", model.PayAmount);
                    dbOperator.AddParameter("PayTime", model.PayTime);
                    dbOperator.AddParameter("PayWay", model.PayWay);
                    dbOperator.AddParameter("PKID", model.PKID);
                    dbOperator.AddParameter("FeeRuleID", model.FeeRuleID);
                    dbOperator.AddParameter("Remark", model.Remark);
                    dbOperator.AddParameter("Status", model.Status);
                    dbOperator.AddParameter("TagID", model.TagID);
                    dbOperator.AddParameter("UnPayAmount", model.UnPayAmount);
                    dbOperator.AddParameter("UserID", model.UserID);
                    if (dbOperator.ExecuteNonQuery(strSql.ToString()) < 0)
                    {
                        dbOperator.RollbackTransaction();
                        return(false);
                    }
                    dbOperator.CommitTransaction();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }