Пример #1
0
        public static int Insert(PaymentEntity paymentEntity)
        {
            if (paymentEntity.PaymentDBEntity.Count == 0)
            {
                return 0;
            }

            if (paymentEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckInsert(paymentEntity) > 0)
            {
                return 2;
            }

            PaymentDBEntity dbParm = (paymentEntity.PaymentDBEntity.Count > 0) ? paymentEntity.PaymentDBEntity[0] : new PaymentDBEntity();

            List<CommandInfo> sqlList = new List<CommandInfo>();
            CommandInfo InsertLmPaymentInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("PAYMENTCODE",OracleType.VarChar),
                                    new OracleParameter("PAYMENTNM",OracleType.VarChar)
                                };

            lmParm[0].Value = getMaxIDfromSeq("T_LM_B_PAYMENT_SEQ");
            lmParm[1].Value = dbParm.PaymentID;
            lmParm[2].Value = dbParm.Name_CN;
            InsertLmPaymentInfo.SqlName = "Payment";
            InsertLmPaymentInfo.SqlId = "t_lm_b_payment_insert";
            InsertLmPaymentInfo.Parameters = lmParm;
            sqlList.Add(InsertLmPaymentInfo);

            PaymentEntity platformList = CommonSelect(paymentEntity);

            if (platformList.QueryResult.Tables.Count > 0 && platformList.QueryResult.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drRow in platformList.QueryResult.Tables[0].Rows)
                {
                    CommandInfo InsertCsPaymentInfo = new CommandInfo();
                    OracleParameter[] csParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("PAYMENTID",OracleType.VarChar),
                                    new OracleParameter("PLATFORM_ID",OracleType.VarChar),
                                    new OracleParameter("ONLINESTATUS",OracleType.VarChar)
                                };

                    csParm[0].Value = getMaxIDfromSeq("T_LM_B_PAYMENT_PLAT_SEQ");
                    csParm[1].Value = dbParm.PaymentID;
                    csParm[2].Value = drRow["PlatformCODE"].ToString();
                    csParm[3].Value = "0";
                    InsertCsPaymentInfo.SqlName = "Payment";
                    InsertCsPaymentInfo.SqlId = "t_lm_b_payment_plat_insert";
                    InsertCsPaymentInfo.Parameters = csParm;
                    sqlList.Add(InsertCsPaymentInfo);
                }
            }

            DbManager.ExecuteSqlTran(sqlList);

            //DataCommand cmd = DataCommandManager.GetDataCommand("InsertCityList");
            //foreach (PaymentDBEntity dbParm in paymentEntity.PaymentDBEntity)
            //{
            //    cmd.SetParameterValue("@ChannelID", dbParm.ChannelID);
            //    cmd.SetParameterValue("@NameCN", dbParm.Name_CN);
            //    cmd.SetParameterValue("@NameEN", PinyinHelper.GetPinyin(dbParm.Name_CN));
            //    cmd.SetParameterValue("@OnlineStatus", dbParm.OnlineStatus);
            //    cmd.SetParameterValue("@Remark", dbParm.Remark);
            //    cmd.SetParameterValue("@CreateUser", (paymentEntity.LogMessages != null) ? paymentEntity.LogMessages.Userid : "");
            //    cmd.SetParameterValue("@UpdateUser", (paymentEntity.LogMessages != null) ? paymentEntity.LogMessages.Userid : "");
            //    cmd.ExecuteNonQuery();
            //}

            return 1;
        }
Пример #2
0
        public static HotelInfoEntity SaveRoomRatherList(HotelInfoEntity hotelInfoEntity)
        {
            if (hotelInfoEntity.HotelInfoDBEntity.Count == 0)
            {
                return hotelInfoEntity;
            }

            if (hotelInfoEntity.LogMessages == null)
            {
                return hotelInfoEntity;
            }

            HotelInfoDBEntity dbParm = (hotelInfoEntity.HotelInfoDBEntity.Count > 0) ? hotelInfoEntity.HotelInfoDBEntity[0] : new HotelInfoDBEntity();
            List<CommandInfo> cmdList = new List<CommandInfo>();
            string strSql = XmlSqlAnalyze.GotSqlTextFromXml("HotelInfo", "t_room_rather_list_save");

            DataTable dtResult = dbParm.RoomRather;
            for (int i = 0; i < dtResult.Rows.Count; i++)
            {
                CommandInfo cminfo = new CommandInfo();
                cminfo.CommandText = strSql;
                OracleParameter[] parm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("ROOMCODE",OracleType.VarChar),
                                    new OracleParameter("DTYPE",OracleType.VarChar),
                                    new OracleParameter("DVALE",OracleType.VarChar),
                                    new OracleParameter("CREATEUSER",OracleType.VarChar)
                                };

                parm[0].Value = dbParm.HotelID;
                parm[1].Value = dtResult.Rows[i]["ROOMCD"].ToString();
                parm[2].Value = dtResult.Rows[i]["DISCOUNTCD"].ToString();
                parm[3].Value = dtResult.Rows[i]["DISCOUNTXT"].ToString();
                parm[4].Value = hotelInfoEntity.LogMessages.Username;
                cminfo.Parameters = parm;
                cmdList.Add(cminfo);
            }

            DbHelperOra.ExecuteSqlTran(cmdList);
            return hotelInfoEntity;
        }
        public static int Insert(HotelFacilitiesEntity hotelfacilitiesEntity)
        {
            if (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count == 0)
            {
                return 0;
            }

            if (hotelfacilitiesEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckInsert(hotelfacilitiesEntity) > 0)
            {
                return 2;
            }

            HotelFacilitiesDBEntity dbParm = (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count > 0) ? hotelfacilitiesEntity.HotelFacilitiesDBEntity[0] : new HotelFacilitiesDBEntity();

            CommandInfo InsertLmPaymentInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("NAMECN",OracleType.VarChar),
                                    new OracleParameter("TYPE",OracleType.VarChar),
                                    new OracleParameter("CODE",OracleType.VarChar),
                                    new OracleParameter("SEQ",OracleType.VarChar)
                                };

            lmParm[0].Value = getMaxIDfromSeq("t_lm_b_facilities_SEQ");
            lmParm[1].Value = dbParm.Name_CN;
            lmParm[2].Value = dbParm.Type;
            lmParm[3].Value = 'P' + lmParm[0].Value.ToString().PadLeft(4, '0');
            lmParm[4].Value = dbParm.FTSeq;
            DbManager.ExecuteSql("HotelFacilities", "t_lm_b_hotel_facilities_insert", lmParm);

            return 1;
        }
Пример #4
0
        public static int Update(PaymentEntity paymentEntity)
        {
            if (paymentEntity.PaymentDBEntity.Count == 0)
            {
                return 0;
            }

            if (paymentEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckUpdate(paymentEntity) > 0)
            {
                return 2;
            }

            List<CommandInfo> sqlList = new List<CommandInfo>();

            bool iflag = true;
            string PaymentID = "";
            foreach(PaymentDBEntity paymentDBEntity in paymentEntity.PaymentDBEntity)
            {
                if (iflag)
                {
                    PaymentEntity commonEntity = new PaymentEntity();
                    commonEntity.PaymentDBEntity = new List<PaymentDBEntity>();
                    PaymentDBEntity commonpaycodeDBEntity = new PaymentDBEntity();
                    commonpaycodeDBEntity.PaymentNo = paymentDBEntity.PaymentNo.ToString();
                    commonEntity.PaymentDBEntity.Add(commonpaycodeDBEntity);
                    DataSet dsResult = Select(commonEntity).QueryResult;
                    PaymentID = (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0) ? dsResult.Tables[0].Rows[0]["paymentcode"].ToString() : "";
                    iflag = false;
                }
                if (paymentDBEntity.UpdatType.Equals("1"))
                {
                    CommandInfo InsertCsMainPaymentInfo = new CommandInfo();
                    OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("PAYMENTNM",OracleType.VarChar)
                                };

                    lmParm[0].Value = int.Parse(paymentDBEntity.PaymentNo.ToString());
                    lmParm[1].Value = paymentDBEntity.Name_CN;

                    InsertCsMainPaymentInfo.SqlName = "Payment";
                    InsertCsMainPaymentInfo.SqlId = "t_lm_b_payment_update";
                    InsertCsMainPaymentInfo.Parameters = lmParm;
                    sqlList.Add(InsertCsMainPaymentInfo);
                }
                else
                {
                    CommandInfo InsertCsPaymentInfo = new CommandInfo();
                    OracleParameter[] csParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("PAYMENTID",OracleType.VarChar),
                                    new OracleParameter("PLATFORM_ID",OracleType.VarChar),
                                    new OracleParameter("ONLINESTATUS",OracleType.VarChar)
                                };

                    csParm[0].Value = (string.IsNullOrEmpty(paymentDBEntity.PaymentNo)) ? getMaxIDfromSeq("T_LM_B_PAYMENT_PLAT_SEQ") : int.Parse(paymentDBEntity.PaymentNo.ToString());
                    csParm[1].Value = PaymentID;
                    csParm[2].Value = paymentDBEntity.PaymFormID;
                    csParm[3].Value = paymentDBEntity.OnlineStatus;
                    InsertCsPaymentInfo.SqlName = "Payment";
                    InsertCsPaymentInfo.SqlId = "t_lm_b_payment_plat_update";
                    InsertCsPaymentInfo.Parameters = csParm;
                    sqlList.Add(InsertCsPaymentInfo);
                }
            }

            DbManager.ExecuteSqlTran(sqlList);

            //OracleParameter[] parm ={
            //                        new OracleParameter("ID",OracleType.Number),
            //                        new OracleParameter("ONLINESTATUS",OracleType.VarChar)

            //                    };

            //PaymentDBEntity dbParm = (paymentEntity.PaymentDBEntity.Count > 0) ? paymentEntity.PaymentDBEntity[0] : new PaymentDBEntity();

            //parm[0].Value = dbParm.PaymentID;
            //parm[1].Value = dbParm.OnlineStatus;
            //DbManager.ExecuteSql("Payment", "t_cs_payment_update", parm);
            //DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCityList");
            //foreach (PaymentDBEntity dbParm in paymentEntity.PaymentDBEntity)
            //{
            //    cmd.SetParameterValue("@ChannelNo", dbParm.ChannelNo);
            //    cmd.SetParameterValue("@ChannelID", dbParm.ChannelID);
            //    cmd.SetParameterValue("@NameCN", dbParm.Name_CN);
            //    cmd.SetParameterValue("@NameEN", PinyinHelper.GetPinyin(dbParm.Name_CN));
            //    cmd.SetParameterValue("@OnlineStatus", dbParm.OnlineStatus);
            //    cmd.SetParameterValue("@Remark", dbParm.Remark);
            //    cmd.SetParameterValue("@UpdateUser", (paymentEntity.LogMessages != null) ? paymentEntity.LogMessages.Userid : "");
            //    cmd.ExecuteNonQuery();
            //}
            return 1;
        }
Пример #5
0
        public static int DestinationUpdateBatchHotel(DestinationEntity destinationEntity)
        {
            if (destinationEntity.DestinationDBEntity.Count == 0)
            {
                return 0;
            }

            if (destinationEntity.LogMessages == null)
            {
                return 0;
            }

            DestinationDBEntity dbParm = (destinationEntity.DestinationDBEntity.Count > 0) ? destinationEntity.DestinationDBEntity[0] : new DestinationDBEntity();

            OracleParameter[] lmhotelParm ={
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("DESTINATIONID",OracleType.VarChar)
                                };
            lmhotelParm[0].Value = dbParm.CityID;
            lmhotelParm[1].Value = dbParm.DestinationID;
            DataSet dsCity = HotelVp.Common.DBUtility.DbManager.Query("Destination", "t_lm_b_destination_hotel_batchlist", false, lmhotelParm);

            int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            List<CommandInfo> cmdList = new List<CommandInfo>();

            string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("Destination", "t_lm_b_destination_hotel_save");
            int iCount = 0;

            for (int i = 0; i <= dsCity.Tables[0].Rows.Count - 1; i++)
            {
                if (String.IsNullOrEmpty(dsCity.Tables[0].Rows[i]["DESTINATIONID"].ToString()))
                {
                    continue;
                }

                dsCity.Tables[0].Rows[i]["DISTANCE"] = GetTotalDistance(dsCity.Tables[0].Rows[i]["HLLATITUDE"].ToString(), dsCity.Tables[0].Rows[i]["HLLONGITUDE"].ToString(), dsCity.Tables[0].Rows[i]["DTLATITUDE"].ToString(), dsCity.Tables[0].Rows[i]["DTLONGITUDE"].ToString());

                CommandInfo cminfo = new CommandInfo();
                cminfo.CommandText = strSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("DESTINATIONID",OracleType.VarChar),
                                    new OracleParameter("TYPEID",OracleType.VarChar),
                                    new OracleParameter("DISTANCE",OracleType.VarChar)
                                };

                lmParm[0].Value = dsCity.Tables[0].Rows[i]["CITYID"].ToString();
                lmParm[1].Value = dsCity.Tables[0].Rows[i]["HOTELID"].ToString();
                lmParm[2].Value = dsCity.Tables[0].Rows[i]["DESTINATIONID"].ToString();
                lmParm[3].Value = dsCity.Tables[0].Rows[i]["TYPEID"].ToString();
                lmParm[4].Value = dsCity.Tables[0].Rows[i]["DISTANCE"].ToString();
                cminfo.Parameters = lmParm;
                cmdList.Add(cminfo);
                iCount = iCount + 1;
                if (MaxLength == iCount)
                {
                    try
                    {
                        DbHelperOra.ExecuteSqlTran(cmdList);
                    }
                    catch
                    {
                    }

                    iCount = 0;
                    cmdList.Clear();
                }
            }

            if (iCount > 0)
            {
                try
                {
                    DbHelperOra.ExecuteSqlTran(cmdList);
                }
                catch
                {
                }
            }

            return 1;
        }
Пример #6
0
        public static void SetPushMsgByFileUpload(string fileName, string taskID)
        {
            string strFilePath = System.IO.Path.Combine(ConfigurationManager.AppSettings["UploadFilePath"].ToString(), fileName);
            DataTable dtResult = new DataTable();

            if (!System.IO.File.Exists(strFilePath))
            {
                return;
            }

            dtResult = LoadExcelToDataTable(strFilePath);

            if (dtResult.Rows.Count >0)
            {
                string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("PushMsg", "insert_lm_user_group_list");
                int iCount = 0;
                int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
                List<CommandInfo> cmdList = new List<CommandInfo>();

                foreach (DataRow drUser in dtResult.Rows)
                {
                    CommandInfo cminfo = new CommandInfo();
                    cminfo.CommandText = strSQL;
                    OracleParameter[] lmParm ={
                                    new OracleParameter("TelPhone",OracleType.VarChar),
                                    new OracleParameter("TaskID",OracleType.VarChar)
                                };

                    lmParm[0].Value = drUser[0].ToString();
                    lmParm[1].Value = taskID;
                    cminfo.Parameters = lmParm;
                    cmdList.Add(cminfo);
                    iCount = iCount + 1;
                    if (MaxLength == iCount)
                    {
                        try
                        {
                            DbHelperOra.ExecuteSqlTran(cmdList);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }

                        iCount = 0;
                        cmdList.Clear();
                    }
                }

                if (iCount > 0)
                {
                    try
                    {
                        DbHelperOra.ExecuteSqlTran(cmdList);
                    }
                    catch
                    {
                    }
                }
            }
        }
Пример #7
0
        public static int SetPromotionData(PromotionEntity promotionEntity, string strImageID)
        {
            PromotionDBEntity dbParm = (promotionEntity.PromotionDBEntity.Count > 0) ? promotionEntity.PromotionDBEntity[0] : new PromotionDBEntity();

            List<CommandInfo> sqlList = new List<CommandInfo>();

            CommandInfo UpdateLmPromInfo = new CommandInfo();
            OracleParameter[] lmPromParm ={
                                    new OracleParameter("ID",OracleType.VarChar)
                                };
            lmPromParm[0].Value = dbParm.ID;
            UpdateLmPromInfo.SqlName = "Promotion";
            UpdateLmPromInfo.SqlId = "t_lm_promotion_update";
            UpdateLmPromInfo.Parameters = lmPromParm;
            sqlList.Add(UpdateLmPromInfo);

            if ("1".Equals(dbParm.Status))
            {
                string PromotionCommonKey = String.IsNullOrEmpty(ConfigurationManager.AppSettings["PromotionCommonKey"]) ? "000000" : ConfigurationManager.AppSettings["PromotionCommonKey"].ToString();

                CommandInfo InsertLmPromInfo = new CommandInfo();
                OracleParameter[] lmPromInserParm ={
                                    new OracleParameter("ID",OracleType.VarChar),
                                    new OracleParameter("TITLE",OracleType.VarChar),
                                    new OracleParameter("PRIORITY",OracleType.VarChar),
                                    new OracleParameter("STARTDTIME",OracleType.VarChar),
                                    new OracleParameter("ENDDTIME",OracleType.VarChar),
                                    new OracleParameter("CONTENT",OracleType.VarChar),
                                    new OracleParameter("IMAGEID",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("OPERATEUSER",OracleType.VarChar),
                                    new OracleParameter("RATECODE",OracleType.VarChar),
                                    new OracleParameter("PROTYPE",OracleType.VarChar),
                                    new OracleParameter("COMMONLIST",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("USERGROUPLIST",OracleType.VarChar),
                                    new OracleParameter("PROMETHODID",OracleType.VarChar),
                                    new OracleParameter("LINKURL",OracleType.VarChar)
                                };
                lmPromInserParm[0].Value = dbParm.ID;
                lmPromInserParm[1].Value = dbParm.Title;
                lmPromInserParm[2].Value = dbParm.Priority;
                lmPromInserParm[3].Value = dbParm.StartDTime;
                lmPromInserParm[4].Value = dbParm.EndDTime;
                lmPromInserParm[5].Value = dbParm.Content;
                lmPromInserParm[6].Value = strImageID;
                lmPromInserParm[7].Value = dbParm.Status;
                lmPromInserParm[8].Value = (promotionEntity.LogMessages != null) ? promotionEntity.LogMessages.Userid : "";
                lmPromInserParm[9].Value = String.IsNullOrEmpty(dbParm.RateCode) ? "" : dbParm.RateCode;

                lmPromInserParm[10].Value = dbParm.Type;

                if ("0".Equals(dbParm.Type))
                {
                    InsertLmPromInfo.SqlId = "t_lm_promotion_detail_all_insert";

                    lmPromInserParm[11].Value = DBNull.Value;
                    lmPromInserParm[12].Value = DBNull.Value;
                    lmPromInserParm[14].Value = dbParm.Promethodid;
                }
                else if ("1".Equals(dbParm.Type))
                {
                    lmPromInserParm[11].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                    lmPromInserParm[12].Value = DBNull.Value;
                    lmPromInserParm[14].Value = dbParm.Promethodid;
                    InsertLmPromInfo.SqlId = "t_lm_promotion_detail_city_insert";
                }
                else if ("2".Equals(dbParm.Type))
                {
                    lmPromInserParm[11].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                    lmPromInserParm[12].Value = DBNull.Value;
                    lmPromInserParm[14].Value = dbParm.Promethodid;
                    InsertLmPromInfo.SqlId = "t_lm_promotion_detail_group_insert";
                }
                else if ("3".Equals(dbParm.Type))
                {
                    lmPromInserParm[11].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                    lmPromInserParm[12].Value = DBNull.Value;
                    lmPromInserParm[14].Value = dbParm.Promethodid;
                    InsertLmPromInfo.SqlId = "t_lm_promotion_detail_hotel_insert";
                }
                else if ("4".Equals(dbParm.Type))
                {
                    lmPromInserParm[11].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                    lmPromInserParm[12].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey : dbParm.HotelID;
                    lmPromInserParm[14].Value = dbParm.Promethodid;
                    InsertLmPromInfo.SqlId = "t_lm_promotion_detail_room_insert";
                }

                if (dbParm.UserGroupList.Length > 0)
                {
                    lmPromInserParm[13].Value = dbParm.UserGroupList.Substring(0, dbParm.UserGroupList.Length - 1);
                }
                else
                {
                    lmPromInserParm[13].Value = DBNull.Value;
                }

                if (String.IsNullOrEmpty(dbParm.LinkUrl))
                {
                    lmPromInserParm[15].Value = DBNull.Value;
                }
                else
                {
                    lmPromInserParm[15].Value = dbParm.LinkUrl;
                }
                InsertLmPromInfo.SqlName = "Promotion";
                InsertLmPromInfo.Parameters = lmPromInserParm;
                sqlList.Add(InsertLmPromInfo);
            }

            DbManager.ExecuteSqlTran(sqlList);
            return 1;
        }
Пример #8
0
        public static DestinationEntity DestinationInsert(DestinationEntity destinationEntity)
        {
            if (destinationEntity.DestinationDBEntity.Count == 0)
            {
                destinationEntity.Result = 0;
                return destinationEntity;
            }

            if (destinationEntity.LogMessages == null)
            {
                destinationEntity.Result = 0;
                return destinationEntity;
            }

            //if (CheckDestinationInsert(destinationEntity) > 0)
            //{
            //    return 2;
            //}

            if (CheckDestinationCityInsert(destinationEntity) == 0)
            {
                destinationEntity.Result = 3;
                return destinationEntity;
            }

            DestinationDBEntity dbParm = (destinationEntity.DestinationDBEntity.Count > 0) ? destinationEntity.DestinationDBEntity[0] : new DestinationDBEntity();

            CommandInfo InsertLmPaymentInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("TYPEID",OracleType.VarChar),
                                    new OracleParameter("NAMECN",OracleType.VarChar),
                                    new OracleParameter("ADDRESSCN",OracleType.VarChar),
                                    new OracleParameter("TELST",OracleType.VarChar),
                                    new OracleParameter("TELLG",OracleType.VarChar),
                                    new OracleParameter("LATITUDE",OracleType.VarChar),
                                    new OracleParameter("LONGITUDE",OracleType.VarChar)
                                };

            lmParm[0].Value = getMaxIDfromSeq("T_LM_B_DESTINATION_SEQ");
            lmParm[1].Value = dbParm.CityID;
            lmParm[2].Value = dbParm.DestinationTypeID;
            lmParm[3].Value = dbParm.Name_CN;
            lmParm[4].Value = dbParm.AddRess;
            lmParm[5].Value = dbParm.TelST;
            lmParm[6].Value = dbParm.TelLG;
            lmParm[7].Value = dbParm.Latitude;
            lmParm[8].Value = dbParm.Longitude;
            destinationEntity.DestinationDBEntity[0].DestinationID = lmParm[0].Value.ToString();
            DbManager.ExecuteSql("Destination", "t_lm_b_destination_insert", lmParm);

            destinationEntity.Result = 1;
            return destinationEntity;
        }
Пример #9
0
        public static int InsertConsultRoomUser(UserEntity userEntity)
        {
            if (userEntity.UserDBEntity.Count == 0)
            {
                return 0;
            }

            if (userEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckConsultInsert(userEntity) > 0)
            {
                return 2;
            }

            UserDBEntity dbParm = (userEntity.UserDBEntity.Count > 0) ? userEntity.UserDBEntity[0] : new UserDBEntity();
            OracleParameter[] parm ={
                                    new OracleParameter("USERID",OracleType.VarChar),
                                    new OracleParameter("RTYPE",OracleType.VarChar),
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("TAGID",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("CREATEUSER",OracleType.VarChar),
                                    new OracleParameter("TCID",OracleType.Int32),
                                    new OracleParameter("SALESID",OracleType.VarChar)
                                };

            if (String.IsNullOrEmpty(dbParm.UserID))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.UserID;
            }

            if (String.IsNullOrEmpty(dbParm.RType))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.RType;
            }

            if (String.IsNullOrEmpty(dbParm.CityID))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.CityID;
            }

            if (String.IsNullOrEmpty(dbParm.TagID))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.TagID;
            }

            if (String.IsNullOrEmpty(dbParm.HotelID))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.HotelID;
            }

            parm[5].Value = userEntity.LogMessages.Username;

            parm[6].Value = getMaxIDfromSeq("T_LM_CONSULT_ROOM_SEQ");

            if (String.IsNullOrEmpty(dbParm.SalesID))
            {
                parm[7].Value = DBNull.Value;
            }
            else
            {
                parm[7].Value = dbParm.SalesID;
            }

            HotelVp.Common.DBUtility.DbManager.ExecuteSql("User", "t_lm_consult_room_user_insert", parm);//t_lm_consult_room_seq.nextval

            if (dbParm.ALDelHT.Length > 0)
            {
                List<CommandInfo> sqlList = new List<CommandInfo>();
                string[] alHotel = dbParm.ALDelHT.Split(',');
                foreach (string strHotel in alHotel)
                {
                    if (String.IsNullOrEmpty(strHotel.Trim()))
                    {
                        continue;
                    }
                    CommandInfo InsertHotelExInfo = new CommandInfo();
                    OracleParameter[] lmHotelExParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("TLCRID",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("CREATEUSER",OracleType.VarChar)
                                };
                    lmHotelExParm[0].Value = getMaxIDfromSeq("T_LM_CONSULT_ROOM_HOTEL_EX_SEQ");
                    lmHotelExParm[1].Value = parm[6].Value;
                    lmHotelExParm[2].Value = strHotel;
                    lmHotelExParm[3].Value = userEntity.LogMessages.Username;

                    InsertHotelExInfo.SqlName = "User";
                    InsertHotelExInfo.SqlId = "t_lm_consult_room_hotel_insert";
                    InsertHotelExInfo.Parameters = lmHotelExParm;
                    sqlList.Add(InsertHotelExInfo);
                }
                DbManager.ExecuteSqlTran(sqlList);
            }
            return 1;
        }
        private static int AutoMappingBeding(AutoMappingBedEntity hotelcomparisonEntity)
        {
            CommonEntity _commonEntity = new CommonEntity();
            _commonEntity.LogMessages = new Common.Logger.LogMessage();

            IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
            IPAddress[] address = hostInfo.AddressList;
            string m_IP = address[0].ToString();

            _commonEntity.LogMessages.IpAddress = m_IP;
            _commonEntity.LogMessages.Computername = Dns.GetHostName();
            _commonEntity.LogMessages.Userid = "JOB System";
            _commonEntity.LogMessages.Username = "******";
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();

            DataSet dsResult = AutoMappingBedDA.AutoHotelRoomMappingList(hotelcomparisonEntity);

            DataTable dtMapping = new DataTable();
            dtMapping.Columns.Add("SOURCE");
            dtMapping.Columns.Add("HOTELID");
            dtMapping.Columns.Add("ROOMCD");
            dtMapping.Columns.Add("BED");
            string ELBed = string.Empty;
            string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("AutoMappingBed", "SaveHotelRoomBed");
            int iCount = 0;
            int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            List<CommandInfo> cmdList = new List<CommandInfo>();

            DataRow[] drTemp;
            for (int i = 0; i < dsResult.Tables[0].Rows.Count; i++)
            {
                drTemp = dtMapping.Select("SOURCE='" + dsResult.Tables[0].Rows[i]["MPType"].ToString().Trim() + "' and HOTELID='" + dsResult.Tables[0].Rows[i]["Mapping_Hotel"].ToString().Trim() + "'" + " and ROOMCD = '" + dsResult.Tables[0].Rows[i]["Mapping_Room"].ToString().Trim() + "'");
                if (drTemp.Count() <= 0)
                {
                    Console.WriteLine(dsResult.Tables[0].Rows[i]["Mapping_Hotel"].ToString().Trim() + " - " + dsResult.Tables[0].Rows[i]["Mapping_Room"].ToString().Trim() + " 艺龙接口调用开始");
                    GetMappingPrice(dsResult.Tables[0].Rows[i]["MPType"].ToString().Trim(), dsResult.Tables[0].Rows[i]["Mapping_Hotel"].ToString().Trim(), dsResult.Tables[0].Rows[i]["Mapping_Room"].ToString().Trim(), ref dtMapping);
                    Console.WriteLine(dsResult.Tables[0].Rows[i]["Mapping_Hotel"].ToString().Trim() + " - " + dsResult.Tables[0].Rows[i]["Mapping_Room"].ToString().Trim() + " 艺龙接口调用结束");
                    Console.WriteLine(dtMapping.Rows.Count);

                    drTemp = dtMapping.Select("SOURCE='" + dsResult.Tables[0].Rows[i]["MPType"].ToString().Trim() + "' and HOTELID='" + dsResult.Tables[0].Rows[i]["Mapping_Hotel"].ToString().Trim() + "'" + " and ROOMCD = '" + dsResult.Tables[0].Rows[i]["Mapping_Room"].ToString().Trim() + "'");
                    if (drTemp.Count() <= 0)
                    {
                        Console.WriteLine("无");
                        continue;
                    }
                    else
                    {
                        ELBed = drTemp[0]["BED"].ToString();
                    }
                }
                else
                {
                    Console.WriteLine(dtMapping.Rows.Count);
                    ELBed = drTemp[0]["BED"].ToString();
                }

                if (String.IsNullOrEmpty(ELBed))
                {
                    continue;
                }

                dsResult.Tables[0].Rows[i]["ROOMBED"] = ELBed;

                CommandInfo cminfo = new CommandInfo();
                cminfo.CommandText = strSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                   new OracleParameter("ROOMCODE",OracleType.VarChar),
                                   new OracleParameter("ROOMAREA",OracleType.VarChar),
                                   new OracleParameter("UPDATEUSER",OracleType.VarChar)
                                };
                lmParm[0].Value = dsResult.Tables[0].Rows[i]["Hotel_ID"].ToString().Trim();
                lmParm[1].Value = dsResult.Tables[0].Rows[i]["Room_Code"].ToString().Trim();
                lmParm[2].Value = dsResult.Tables[0].Rows[i]["ROOMBED"].ToString().Trim();
                lmParm[3].Value = "CMS JOB";

                cminfo.Parameters = lmParm;
                cmdList.Add(cminfo);
                iCount = iCount + 1;

                if (MaxLength == iCount)
                {
                    try
                    {
                        AutoMappingBedDA.SaveHotelRoomBedList(cmdList);
                        Console.Write("成功");
                        iCount = 0;
                        cmdList.Clear();
                    }
                    catch
                    {
                        Console.Write("失败");
                    }
                }

                //AutoMappingBedDA.SaveHotelRoomBed(dsResult.Tables[0].Rows[i]);
            }

            if (iCount > 0)
            {
                try
                {
                    AutoMappingBedDA.SaveHotelRoomBedList(cmdList);
                    Console.Write("成功");
                    iCount = 0;
                    cmdList.Clear();
                }
                catch
                {
                    Console.Write("失败");
                }
            }
            //AutoMappingBedDA.UpdateOverDateData();

            //if ("1".Equals(hotelcomparisonEntity.AutoHotelComparisonDBEntity[0].SaveType))
            //{
            //    DataSet dsMailData = AutoMappingBedDA.GetMailDataList();

            //    string strMailBody = "";
            //    string strMailSubject = "今日{0}家酒店价格过高 " + DateTime.Now.ToShortDateString();

            //    if (dsMailData.Tables.Count > 0 && dsMailData.Tables["Master"].Rows.Count > 0)
            //    {
            //        strMailSubject = String.Format(strMailSubject, dsMailData.Tables["Master"].Rows[0]["BHLID"].ToString());
            //    }
            //    else
            //    {
            //        strMailSubject = String.Format(strMailSubject, "0");
            //    }

            //    strMailBody = SetMailBodyData(dsMailData);

            //    SendMailExpress(strMailBody, strMailSubject);
            //}

            return dsResult.Tables[0].Rows.Count;
        }
Пример #11
0
        public static int Insert(UserGroupEntity userGroupEntity)
        {
            if (userGroupEntity.UserGroupDBEntity.Count == 0)
            {
                return 0;
            }

            if (userGroupEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckInsert(userGroupEntity) > 0)
            {
                return 2;
            }

            UserGroupDBEntity dbParm = (userGroupEntity.UserGroupDBEntity.Count > 0) ? userGroupEntity.UserGroupDBEntity[0] : new UserGroupDBEntity();

            string manualAdd = dbParm.ManualAdd.Replace("'", "").Replace(",",",").Replace("\r\n", "");
            string[] manualList = manualAdd.Split(',');
            string errorString = "";
            string complString = "";
            ArrayList complList = new ArrayList();
            ArrayList tempList = new ArrayList();

            int MaxLength = 300;
            int iLength = 0;

            for (int imanual = 0; imanual <= manualList.Count() - 1; imanual++)
            {
                if (IsMobileNumber(manualList[imanual].ToString().Trim()) && manualList[imanual].ToString().Trim().Length == 11)
                {
                    if (!tempList.Contains(manualList[imanual].ToString().Trim()))
                    {
                        tempList.Add(manualList[imanual].ToString().Trim());
                        complString = complString + manualList[imanual].ToString().Trim() + ",";
                        iLength = iLength + 1;

                        if (iLength == MaxLength)
                        {
                            iLength = 0;
                            complString = complString.Substring(0, complString.Length - 1);
                            complList.Add(complString);
                            complString = "";
                        }
                    }
                }
                else
                {
                    errorString = errorString + manualList[imanual].ToString().Trim() + ",";
                }
            }

            if (iLength < MaxLength)
            {
                complString = (complString.Length > 0) ? complString.Substring(0, complString.Length - 1) : complString;
                complList.Add(complString);
            }

            errorString = (errorString.Length > 0) ? errorString.Substring(0, errorString.Length - 1) : errorString.Trim();
            //complList = (complList.Length > 0) ? complList.Substring(0, complList.Length - 1) : complList.Trim();
            userGroupEntity.UserGroupDBEntity[0].ErrManualAdd = errorString;
            userGroupEntity.UserGroupDBEntity[0].ComplManualAdd = complList;

            //if (CheckInsert(userGroupEntity) > 0)
            //{
            //    return 2;
            //}

            //DataSet dsCity = CheckCity(userGroupEntity);
            //if (dsCity.Tables.Count == 0 || dsCity.Tables[0].Rows.Count == 0)
            //{
            //    return 3;
            //}

            //UserGroupDBEntity dbParm = (userGroupEntity.UserGroupDBEntity.Count > 0) ? userGroupEntity.UserGroupDBEntity[0] : new UserGroupDBEntity();

            List<CommandInfo> sqlList = new List<CommandInfo>();
            CommandInfo InsertLmUserGroupInfo = new CommandInfo();
            OracleParameter[] lmUserGroupParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("USERGROUPNAME",OracleType.VarChar),
                                    new OracleParameter("REGISTSTART",OracleType.VarChar),
                                    new OracleParameter("REGISTEND",OracleType.VarChar),
                                    new OracleParameter("LOGINSTART",OracleType.VarChar),
                                    new OracleParameter("LOGINEND",OracleType.VarChar),
                                    new OracleParameter("SUBMITORDERFROM",OracleType.Int32),
                                    new OracleParameter("SUBMITORDERTO",OracleType.Int32),
                                    new OracleParameter("COMPLETEORDERFROM",OracleType.Int32),
                                    new OracleParameter("COMPLETEORDERTO",OracleType.Int32),
                                    new OracleParameter("LASTORDERSTART",OracleType.VarChar),
                                    new OracleParameter("LASTORDEREND",OracleType.VarChar),
                                    new OracleParameter("MANUALADD",OracleType.VarChar)
                                };

            lmUserGroupParm[0].Value = getMaxIDfromSeq("T_LM_USERGROUP_SEQ");
            lmUserGroupParm[1].Value = dbParm.UserGroupNM;

            if (String.IsNullOrEmpty(dbParm.RegistStart))
            {
                lmUserGroupParm[2].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[2].Value = DateTime.Parse(dbParm.RegistStart);
                lmUserGroupParm[2].Value = dbParm.RegistStart;
            }

            if (String.IsNullOrEmpty(dbParm.RegistEnd))
            {
                lmUserGroupParm[3].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[3].Value = DateTime.Parse(dbParm.RegistEnd);
                lmUserGroupParm[3].Value = dbParm.RegistEnd;
            }

            if (String.IsNullOrEmpty(dbParm.LoginStart))
            {
                lmUserGroupParm[4].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[4].Value = DateTime.Parse(dbParm.LoginStart);
                lmUserGroupParm[4].Value = dbParm.LoginStart;
            }

            if (String.IsNullOrEmpty(dbParm.LoginEnd))
            {
                lmUserGroupParm[5].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[5].Value = DateTime.Parse(dbParm.LoginEnd);
                lmUserGroupParm[5].Value = dbParm.LoginEnd;
            }

            if (String.IsNullOrEmpty(dbParm.SubmitOrderFrom))
            {
                lmUserGroupParm[6].Value = DBNull.Value;
            }
            else
            {
                lmUserGroupParm[6].Value = Int32.Parse(dbParm.SubmitOrderFrom);
            }

            if (String.IsNullOrEmpty(dbParm.SubmitOrderTo))
            {
                lmUserGroupParm[7].Value = DBNull.Value;
            }
            else
            {
                lmUserGroupParm[7].Value = Int32.Parse(dbParm.SubmitOrderTo);
            }

            if (String.IsNullOrEmpty(dbParm.CompleteOrderFrom))
            {
                lmUserGroupParm[8].Value = DBNull.Value;
            }
            else
            {
                lmUserGroupParm[8].Value = Int32.Parse(dbParm.CompleteOrderFrom);
            }

            if (String.IsNullOrEmpty(dbParm.CompleteOrderTo))
            {
                lmUserGroupParm[9].Value = DBNull.Value;
            }
            else
            {
                lmUserGroupParm[9].Value = Int32.Parse(dbParm.CompleteOrderTo);
            }

            if (String.IsNullOrEmpty(dbParm.LastOrderStart))
            {
                lmUserGroupParm[10].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[10].Value = DateTime.Parse(dbParm.LastOrderStart);
                lmUserGroupParm[10].Value = dbParm.LastOrderStart;
            }

            if (String.IsNullOrEmpty(dbParm.LastOrderEnd))
            {
                lmUserGroupParm[11].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[11].Value = DateTime.Parse(dbParm.LastOrderEnd);
                lmUserGroupParm[11].Value = dbParm.LastOrderEnd;
            }

            lmUserGroupParm[12].Value = dbParm.ManualAdd;

            InsertLmUserGroupInfo.SqlName = "UserGroup";
            InsertLmUserGroupInfo.SqlId = "t_lm_usergroup_insert";
            InsertLmUserGroupInfo.Parameters = lmUserGroupParm;
            sqlList.Add(InsertLmUserGroupInfo);

            string[] RegChannelList = dbParm.RegChannelList.Trim().Replace("'", "").Split(',');
            string RegChannelString = "";
            if (RegChannelList.Length > 0)
            {
                foreach (string RegCrlString in RegChannelList)
                {
                    if (RegCrlString.Trim().Length > 0)
                    {
                        RegChannelString = RegChannelString + RegCrlString.Substring(RegCrlString.IndexOf('_') + 1) + ",";
                    }
                }

                //RegChannelString = RegChannelString.Substring(0, RegChannelString.Length - 1);

                CommandInfo InsertlmUGROUPRCLInfo = new CommandInfo();

                OracleParameter[] lmRclParm ={
                                    new OracleParameter("USERGROUPID_RCL",OracleType.VarChar),
                                    new OracleParameter("REGCHANELCODE",OracleType.VarChar)
                                };

                lmRclParm[0].Value = lmUserGroupParm[0].Value;
                lmRclParm[1].Value = RegChannelString;
                InsertlmUGROUPRCLInfo.SqlName = "UserGroup";
                InsertlmUGROUPRCLInfo.SqlId = "t_lm_usergroup_rechanel_insert";
                InsertlmUGROUPRCLInfo.Parameters = lmRclParm;
                sqlList.Add(InsertlmUGROUPRCLInfo);
            }

            string PlatformList = dbParm.PlatformList.Trim().Replace("'", "");
            if (PlatformList.Length > 0)
            {
                CommandInfo InsertlmUGROUPPTMInfo = new CommandInfo();

                OracleParameter[] lmPtmParm ={
                                    new OracleParameter("USERGROUPID_PTM",OracleType.VarChar),
                                    new OracleParameter("PLATFORMCODE",OracleType.VarChar)
                                };

                lmPtmParm[0].Value = lmUserGroupParm[0].Value;
                lmPtmParm[1].Value = PlatformList;
                InsertlmUGROUPPTMInfo.SqlName = "UserGroup";
                InsertlmUGROUPPTMInfo.SqlId = "t_lm_usergroup_platform_insert";
                InsertlmUGROUPPTMInfo.Parameters = lmPtmParm;
                sqlList.Add(InsertlmUGROUPPTMInfo);
            }

            CommandInfo InsertLmUserListInfo = new CommandInfo();
            OracleParameter[] lmUserListParm ={
                                    new OracleParameter("USERGROUPID",OracleType.Int32),
                                    new OracleParameter("REGISTSTART",OracleType.VarChar),
                                    new OracleParameter("REGISTEND",OracleType.VarChar),
                                    new OracleParameter("LOGINSTART",OracleType.VarChar),
                                    new OracleParameter("LOGINEND",OracleType.VarChar),
                                    new OracleParameter("SUBMITORDERFROM",OracleType.Int32),
                                    new OracleParameter("SUBMITORDERTO",OracleType.Int32),
                                    new OracleParameter("COMPLETEORDERFROM",OracleType.Int32),
                                    new OracleParameter("COMPLETEORDERTO",OracleType.Int32),
                                    new OracleParameter("LASTORDERSTART",OracleType.VarChar),
                                    new OracleParameter("LASTORDEREND",OracleType.VarChar),
                                    new OracleParameter("REGCHANNELLIST",OracleType.VarChar),
                                    new OracleParameter("PLATFORMLIST",OracleType.VarChar)
                                };

            lmUserListParm[0].Value = lmUserGroupParm[0].Value;

            if (String.IsNullOrEmpty(dbParm.RegistStart))
            {
                lmUserListParm[1].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[2].Value = DateTime.Parse(dbParm.RegistStart);
                lmUserListParm[1].Value = dbParm.RegistStart;
            }

            if (String.IsNullOrEmpty(dbParm.RegistEnd))
            {
                lmUserListParm[2].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[3].Value = DateTime.Parse(dbParm.RegistEnd);
                lmUserListParm[2].Value = dbParm.RegistEnd;
            }

            if (String.IsNullOrEmpty(dbParm.LoginStart))
            {
                lmUserListParm[3].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[4].Value = DateTime.Parse(dbParm.LoginStart);
                lmUserListParm[3].Value = dbParm.LoginStart;
            }

            if (String.IsNullOrEmpty(dbParm.LoginEnd))
            {
                lmUserListParm[4].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[5].Value = DateTime.Parse(dbParm.LoginEnd);
                lmUserListParm[4].Value = dbParm.LoginEnd;
            }

            if (String.IsNullOrEmpty(dbParm.SubmitOrderFrom))
            {
                lmUserListParm[5].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[5].Value = Int32.Parse(dbParm.SubmitOrderFrom);
            }

            if (String.IsNullOrEmpty(dbParm.SubmitOrderTo))
            {
                lmUserListParm[6].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[6].Value = Int32.Parse(dbParm.SubmitOrderTo);
            }

            if (String.IsNullOrEmpty(dbParm.CompleteOrderFrom))
            {
                lmUserListParm[7].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[7].Value = Int32.Parse(dbParm.CompleteOrderFrom);
            }

            if (String.IsNullOrEmpty(dbParm.CompleteOrderTo))
            {
                lmUserListParm[8].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[8].Value = Int32.Parse(dbParm.CompleteOrderTo);
            }

            if (String.IsNullOrEmpty(dbParm.LastOrderStart))
            {
                lmUserListParm[9].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[10].Value = DateTime.Parse(dbParm.LastOrderStart);
                lmUserListParm[9].Value = dbParm.LastOrderStart;
            }

            if (String.IsNullOrEmpty(dbParm.LastOrderEnd))
            {
                lmUserListParm[10].Value = DBNull.Value;
            }
            else
            {
                //lmUserGroupParm[11].Value = DateTime.Parse(dbParm.LastOrderEnd);
                lmUserListParm[10].Value = dbParm.LastOrderEnd;
            }

            if (String.IsNullOrEmpty(RegChannelString))
            {
                lmUserListParm[11].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[11].Value = (RegChannelString.Length > 1) ? RegChannelString.Substring(0, RegChannelString.Length -1) : "";
            }

            if (String.IsNullOrEmpty(PlatformList))
            {
                lmUserListParm[12].Value = DBNull.Value;
            }
            else
            {
                lmUserListParm[12].Value = (PlatformList.Length > 1) ? PlatformList.Substring(0, PlatformList.Length - 1) : "";
            }

            InsertLmUserListInfo.SqlName = "UserGroup";
            InsertLmUserListInfo.SqlId = "t_lm_usergroup_ult_insert";
            InsertLmUserListInfo.Parameters = lmUserListParm;
            sqlList.Add(InsertLmUserListInfo);

            if (userGroupEntity.UserGroupDBEntity[0].ComplManualAdd.Count > 0)
            {
                foreach (string strManual in userGroupEntity.UserGroupDBEntity[0].ComplManualAdd)
                {
                    if (String.IsNullOrEmpty(strManual))
                    {
                        continue;
                    }
                    CommandInfo InsertLmManualUserListInfo = new CommandInfo();
                    OracleParameter[] lmManualUserParm ={
                                    new OracleParameter("USERGROUPID",OracleType.Int32),
                                    new OracleParameter("MANUALADD",OracleType.VarChar)
                                };

                    lmManualUserParm[0].Value = lmUserGroupParm[0].Value;
                    lmManualUserParm[1].Value = strManual;

                    InsertLmManualUserListInfo.SqlName = "UserGroup";
                    InsertLmManualUserListInfo.SqlId = "t_lm_usergroup_ult_manual_insert";
                    InsertLmManualUserListInfo.Parameters = lmManualUserParm;
                    sqlList.Add(InsertLmManualUserListInfo);
                }
            }

            DbManager.ExecuteSqlTran(sqlList);

            if (userGroupEntity.UserGroupDBEntity[0].ErrManualAdd.Length > 0)
            {
                return 3;
            }
            else
            {
                return 1;
            }
        }
Пример #12
0
        public static SeltEntity SaveSettlementInfo(SeltEntity seltEntity)
        {
            SeltDBEntity dbParm = (seltEntity.SeltDBEntity.Count > 0) ? seltEntity.SeltDBEntity[0] : new SeltDBEntity();

            List<CommandInfo> cmdList = new List<CommandInfo>();
            CommandInfo cminfo = new CommandInfo();
            OracleParameter[] parm ={
                                    new OracleParameter("ID",OracleType.VarChar),
                                    new OracleParameter("UNIT_NAME",OracleType.VarChar),
                                    new OracleParameter("INVOICE_NAME",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_TERM",OracleType.VarChar),
                                    new OracleParameter("HOTEL_TAX",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_ADDRESS",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_PER",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_TEL",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_FAX",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_SALES",OracleType.VarChar),
                                    new OracleParameter("BILL_ITEM",OracleType.VarChar),
                                    new OracleParameter("HOTEL_TAXNO",OracleType.VarChar),
                                    new OracleParameter("HOTEL_PAYNO",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar),
                                    new OracleParameter("TERM_STDT",OracleType.VarChar)
                                };

            string strSQL = "";
            if (String.IsNullOrEmpty(dbParm.SeltID))
            {
                parm[0].Value = getMaxIDfromSeq("T_LM_SETTLEMENT_UNIT_SEQ");
                strSQL = "t_lm_settlement_unit_insert";
            }
            else
            {
                parm[0].Value = dbParm.SeltID;
                strSQL = "t_lm_settlement_unit_update";
            }

            if (String.IsNullOrEmpty(dbParm.UnitNm))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.UnitNm;
            }

            if (String.IsNullOrEmpty(dbParm.InvoiceNm))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.InvoiceNm;
            }

            if (String.IsNullOrEmpty(dbParm.Term))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.Term;
            }

            if (String.IsNullOrEmpty(dbParm.Tax))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.Tax;
            }

            if (String.IsNullOrEmpty(dbParm.Address))
            {
                parm[5].Value = DBNull.Value;
            }
            else
            {
                parm[5].Value = dbParm.Address;
            }

            if (String.IsNullOrEmpty(dbParm.Per))
            {
                parm[6].Value = DBNull.Value;
            }
            else
            {
                parm[6].Value = dbParm.Per;
            }

            if (String.IsNullOrEmpty(dbParm.Tel))
            {
                parm[7].Value = DBNull.Value;
            }
            else
            {
                parm[7].Value = dbParm.Tel;
            }

            if (String.IsNullOrEmpty(dbParm.Fax))
            {
                parm[8].Value = DBNull.Value;
            }
            else
            {
                parm[8].Value = dbParm.Fax;
            }

            if (String.IsNullOrEmpty(dbParm.Sales))
            {
                parm[9].Value = DBNull.Value;
            }
            else
            {
                parm[9].Value = dbParm.Sales;
            }

            if (String.IsNullOrEmpty(dbParm.BillItem))
            {
                parm[10].Value = DBNull.Value;
            }
            else
            {
                parm[10].Value = dbParm.BillItem;
            }

            if (String.IsNullOrEmpty(dbParm.TaxNo))
            {
                parm[11].Value = DBNull.Value;
            }
            else
            {
                parm[11].Value = dbParm.TaxNo;
            }

            if (String.IsNullOrEmpty(dbParm.PayNo))
            {
                parm[12].Value = DBNull.Value;
            }
            else
            {
                parm[12].Value = dbParm.PayNo;
            }

            parm[13].Value = dbParm.Status;
            parm[14].Value = seltEntity.LogMessages.Username;
            parm[15].Value = dbParm.TermStDt;

            cminfo.CommandText = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", strSQL);
            cminfo.Parameters = parm;
            cmdList.Add(cminfo);

            CommandInfo cmUpinfo = new CommandInfo();
            OracleParameter[] upparm ={
                                    new OracleParameter("UNIT_ID",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar)
                                };

            upparm[0].Value = parm[0].Value;
            upparm[1].Value = seltEntity.LogMessages.Username;

            cmUpinfo.CommandText = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", "t_lm_settlement_unit_hotel_update");
            cmUpinfo.Parameters = upparm;
            cmdList.Add(cmUpinfo);

            DataTable dtHotel = dbParm.dtHotelList;
            string strHotelSQL = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", "t_lm_settlement_unit_hotel_save");
            for (int i = 0; i <= dtHotel.Rows.Count - 1; i++)
            {
                CommandInfo cmhinfo = new CommandInfo();
                cmhinfo.CommandText = strHotelSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("UNIT_ID",OracleType.VarChar),
                                    new OracleParameter("HOTEL_ID",OracleType.VarChar),
                                    new OracleParameter("PRICE_CODE",OracleType.VarChar),
                                    new OracleParameter("VENDOR",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar)
                                };

                lmParm[0].Value = parm[0].Value;
                lmParm[1].Value = dtHotel.Rows[i]["HOTELID"].ToString();
                lmParm[2].Value = dtHotel.Rows[i]["PRICECD"].ToString();
                lmParm[3].Value = dtHotel.Rows[i]["VENDOR"].ToString();
                lmParm[4].Value = "1";
                lmParm[5].Value = seltEntity.LogMessages.Username;
                cmhinfo.Parameters = lmParm;
                cmdList.Add(cmhinfo);
            }

            DbHelperOra.ExecuteSqlTran(cmdList);
            seltEntity.Result = 1;

            return seltEntity;
        }
Пример #13
0
        public static int UpdateHotelCompareGridBatch(APPContentEntity appcontentEntity)
        {
            List<CommandInfo> sqlList = new List<CommandInfo>();
            string strSql = "";
            foreach (APPContentDBEntity dbParm in appcontentEntity.APPContentDBEntity)
            {
                CommandInfo UpdateHubsInfo = new CommandInfo();
                OracleParameter[] lmInfoParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar)
                                };
                lmInfoParm[0].Value = dbParm.HotelID;
                UpdateHubsInfo.SqlName = "APPContent";
                switch (dbParm.TypeID)
                {
                    case "HOTELNMZH":
                        strSql = "t_lm_b_prop_update_nm";
                        break;
                    case "HOTELNMEN":
                        strSql = "t_lm_b_prop_update_nmen";
                        break;
                    case "FOGSTATUS":
                        strSql = "t_lm_b_prop_update_status";
                        break;
                    case "CITY":
                        strSql = "t_lm_b_prop_update_city";
                        break;
                    case "DIAMOND":
                        strSql = "t_lm_b_prop_update_diamond";
                        break;
                    case "STAR":
                        strSql = "t_lm_b_prop_update_star";
                        break;
                    case "OPENDT":
                        strSql = "t_lm_b_prop_update_open";
                        break;
                    case "RENOVATIONDT":
                        strSql = "t_lm_b_prop_update_ren";
                        break;
                    case "TRADEAREA":
                        strSql = "t_lm_b_prop_update_tra";
                        break;
                    case "ADDRESS":
                        strSql = "t_lm_b_prop_update_address";
                        break;
                    case "WEBSITE":
                        strSql = "t_lm_b_prop_update_web";
                        break;
                    case "LINKTEL":
                        strSql = "t_lm_b_prop_update_tel";
                        break;
                    case "LINKFAX":
                        strSql = "t_lm_b_prop_update_fax";
                        break;
                    case "LINKMAN":
                        strSql = "t_lm_b_prop_update_man";
                        break;
                    case "LINKMAIL":
                        strSql = "t_lm_b_prop_update_mail";
                        break;
                    case "LONGITUDE":
                        strSql = "t_lm_b_prop_update_long";
                        break;
                    case "LATITUDE":
                        strSql = "t_lm_b_prop_update_lati";
                        break;
                    case "DESCZH":
                        strSql = "t_lm_b_prop_update_desc";
                        break;
                    default:
                        strSql = "";
                        break;
                }

                UpdateHubsInfo.SqlId = strSql;
                UpdateHubsInfo.Parameters = lmInfoParm;
                sqlList.Add(UpdateHubsInfo);
            }

            DbManager.ExecuteSqlTran(sqlList);
            return 1;
        }
Пример #14
0
        public static HotelInfoEntity CreateHotelInfo(HotelInfoEntity hotelInfoEntity)
        {
            if (hotelInfoEntity.HotelInfoDBEntity.Count == 0)
            {
                hotelInfoEntity.Result = 0;
                return hotelInfoEntity;
            }

            if (hotelInfoEntity.LogMessages == null)
            {
                hotelInfoEntity.Result = 0;
                return hotelInfoEntity;
            }

            if (CheckSupInsert(hotelInfoEntity) > 0)
            {
                hotelInfoEntity.Result = 2;
                return hotelInfoEntity;
            }

            if (CheckSupCity(hotelInfoEntity) <= 0)
            {
                hotelInfoEntity.Result = 3;
                return hotelInfoEntity;
            }

            List<CommandInfo> sqlList = new List<CommandInfo>();
            HotelInfoDBEntity dbParm = (hotelInfoEntity.HotelInfoDBEntity.Count > 0) ? hotelInfoEntity.HotelInfoDBEntity[0] : new HotelInfoDBEntity();

            CommandInfo InsertLmbPropInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("HOTELNM",OracleType.VarChar),
                                    new OracleParameter("HOTELEN",OracleType.VarChar),
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("STARRATING",OracleType.VarChar),
                                    new OracleParameter("DIAMONDRATING",OracleType.VarChar),
                                    new OracleParameter("ADDRESS",OracleType.VarChar),
                                    new OracleParameter("FAX",OracleType.VarChar),
                                     new OracleParameter("LONGITUDE",OracleType.VarChar),
                                    new OracleParameter("LATITUDE",OracleType.VarChar),
                                    new OracleParameter("CONTACTEMAIL",OracleType.VarChar),
                                    new OracleParameter("OPENDATE",OracleType.VarChar),
                                    new OracleParameter("REPAIRDATE",OracleType.VarChar),
                                    new OracleParameter("SIMPLEDESCZH",OracleType.VarChar),
                                    new OracleParameter("DESCZH",OracleType.VarChar),
                                    new OracleParameter("STATUSID",OracleType.VarChar),
                                    new OracleParameter("HOTELPN",OracleType.VarChar),
                                    new OracleParameter("TOTALROOMS",OracleType.VarChar),
                                    new OracleParameter("HOTELJP",OracleType.VarChar),
                                    new OracleParameter("ZIP",OracleType.VarChar),
                                    new OracleParameter("PRICELOW",OracleType.VarChar),
                                    new OracleParameter("CONTACTPER",OracleType.VarChar),
                                    new OracleParameter("CONTACTPHONE",OracleType.VarChar),
                                    new OracleParameter("PHONE",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.Int32),
                                    new OracleParameter("EVALUATION",OracleType.VarChar),
                                    new OracleParameter("HOTELREMARK",OracleType.VarChar),
                                    new OracleParameter("WEBSITE",OracleType.VarChar),
                                    new OracleParameter("BDLONGITUDE",OracleType.VarChar),
                                    new OracleParameter("BDLATITUDE",OracleType.VarChar),
                                    new OracleParameter("KEYWORDS",OracleType.VarChar),
                                    new OracleParameter("HOTELGROUP",OracleType.VarChar),
                                    new OracleParameter("ISMYHOTEL",OracleType.VarChar)
                                };

            lmParm[0].Value = dbParm.Name_CN;
            lmParm[1].Value = dbParm.Name_EN;
            lmParm[2].Value = dbParm.City;
            lmParm[3].Value = dbParm.StarRating.Split('|')[0].ToString().Trim();
            lmParm[4].Value = dbParm.StarRating.Split('|')[1].ToString().Trim();
            lmParm[5].Value = dbParm.AddRess;
            lmParm[6].Value = dbParm.Fax;
            lmParm[7].Value = dbParm.Longitude;
            lmParm[8].Value = dbParm.Latitude;
            lmParm[9].Value = dbParm.ContactEmail;
            lmParm[10].Value = dbParm.OpenDate;
            lmParm[11].Value = dbParm.RepairDate;
            lmParm[12].Value = dbParm.SimpleDescZh;
            lmParm[13].Value = dbParm.DescZh;
            lmParm[14].Value = dbParm.Status;
            lmParm[15].Value = dbParm.HotelPN;
            lmParm[16].Value = dbParm.TotalRooms;
            lmParm[17].Value = dbParm.HotelJP;
            lmParm[18].Value = dbParm.Zip;
            lmParm[19].Value = dbParm.PriceLow;
            lmParm[20].Value = dbParm.ContactPer;
            lmParm[21].Value = dbParm.ContactPhone;
            lmParm[22].Value = dbParm.Phone;
            lmParm[23].Value = getMaxIDfromSeq("T_LM_B_PROP_SEQ");
            lmParm[24].Value = dbParm.Evaluation;
            //lmParm[25].Value = dbParm.HotelRemark;
            if (string.IsNullOrEmpty(dbParm.HotelRemark))
            {
                lmParm[25].Value = DBNull.Value;
            }else
            {
                lmParm[25].Value = dbParm.HotelRemark;
            }

            lmParm[26].Value = dbParm.WebSite;
            lmParm[27].Value = dbParm.BDLongitude;
            lmParm[28].Value = dbParm.BDLatitude;
            lmParm[29].Value = dbParm.KeyWords;
            lmParm[30].Value = dbParm.HotelGroup;
            lmParm[31].Value = dbParm.IsMyHotel;
            //lmParm[9].Value = dbParm.Bussiness;
            //DbManager.ExecuteSql("HotelInfo", "t_lm_b_suphotelinfo_insert", lmParm);

            InsertLmbPropInfo.SqlName = "HotelInfo";
            InsertLmbPropInfo.SqlId = "t_lm_b_createhotelinfo_insert";
            InsertLmbPropInfo.Parameters = lmParm;
            sqlList.Add(InsertLmbPropInfo);

            CommandInfo InsertLmbBussInfo = new CommandInfo();
            OracleParameter[] lmBussParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar)
                                };

            lmBussParm[0].Value = lmParm[23].Value;

            InsertLmbBussInfo.SqlName = "HotelInfo";
            InsertLmbBussInfo.SqlId = "t_lm_b_fvphotelbussinfo_insert";
            InsertLmbBussInfo.Parameters = lmBussParm;
            sqlList.Add(InsertLmbBussInfo);

            if (!String.IsNullOrEmpty(dbParm.Bussiness))
            {
                string strAreaID = "";
                string[] strBusList = dbParm.Bussiness.Split(',');
                foreach (string par in strBusList)
                {
                    strAreaID = (par.IndexOf("]") >= 0) ? par.Substring((par.IndexOf('[') + 1), (par.IndexOf(']') - 1)) : "";
                    if (String.IsNullOrEmpty(strAreaID))
                    {
                        continue;
                    }
                    CommandInfo InsertLmbAreaInfo = new CommandInfo();
                    OracleParameter[] lmAreaParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("AREAID",OracleType.VarChar)
                                };

                    lmAreaParm[0].Value = lmParm[23].Value;
                    lmAreaParm[1].Value = strAreaID;

                    InsertLmbAreaInfo.SqlName = "HotelInfo";
                    InsertLmbAreaInfo.SqlId = "t_lm_b_suphotelareainfo_insert";
                    InsertLmbAreaInfo.Parameters = lmAreaParm;
                    sqlList.Add(InsertLmbAreaInfo);
                }
            }

            DbManager.ExecuteSqlTran(sqlList);

            hotelInfoEntity.Result = 1;
            hotelInfoEntity.ErrorMSG = lmParm[23].Value.ToString();
            return hotelInfoEntity;
        }
Пример #15
0
        //private static string AppendString(string param)
        //{
        //    string result = "";
        //    string[] temp = param.Split(',');
        //    foreach (string strTemp in temp)
        //    {
        //        result = (!String.IsNullOrEmpty(strTemp)) ? result + "'" + strTemp + "'," : result;
        //    }
        //    result = (result.Length > 1) ? result.Substring(0, result.Length - 1) : result;
        //    return result;
        //}
        //private static bool IsMobileNumber(string str_telephone)
        //{
        //    return System.Text.RegularExpressions.Regex.IsMatch(str_telephone, @"(1[3,4,5,8][0-9])\d{8}$");
        //}
        public static PromotionEntity Update(PromotionEntity promotionEntity)
        {
            if (promotionEntity.PromotionDBEntity.Count == 0)
            {
                promotionEntity.Result = 0;
                return promotionEntity;
            }

            if (promotionEntity.LogMessages == null)
            {
                promotionEntity.Result = 0;
                return promotionEntity;
            }

            if (!CheckUpdate(promotionEntity))
            {
                promotionEntity.Result = 2;
                return promotionEntity;
            }

            PromotionDBEntity dbParm = (promotionEntity.PromotionDBEntity.Count > 0) ? promotionEntity.PromotionDBEntity[0] : new PromotionDBEntity();

            if ("1".Equals(dbParm.Status))
            {
                DataSet dsErr = CheckErrUpdate(promotionEntity);
                if (dsErr.Tables.Count > 0 && dsErr.Tables[0].Rows.Count > 0)
                {
                    promotionEntity.Result = 3;
                    promotionEntity.ErrorMSG = dsErr.Tables[0].Rows[0]["pro_title"].ToString();
                    return promotionEntity;
                }
            }

            List<CommandInfo> sqlList = new List<CommandInfo>();

            string strImageID = "";
            if (!String.IsNullOrEmpty(dbParm.ImagePath))
            {

                CommandInfo InsertLmImagesInfo = new CommandInfo();
                OracleParameter[] lmImagesParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("TITLE",OracleType.VarChar),
                                    new OracleParameter("PATH",OracleType.VarChar)
                                };
                if (String.IsNullOrEmpty(dbParm.Imageid))
                {
                    lmImagesParm[0].Value = getMaxIDfromSeq("T_IMAGE_SEQ");
                }
                else
                {
                    lmImagesParm[0].Value = dbParm.Imageid;
                }
                lmImagesParm[1].Value = DBNull.Value;
                lmImagesParm[2].Value = dbParm.ImagePath;

                InsertLmImagesInfo.SqlName = "Promotion";

                if (String.IsNullOrEmpty(dbParm.Imageid))
                {
                    InsertLmImagesInfo.SqlId = "t_lm_promotion_t_images_insert";
                }
                else
                {
                    InsertLmImagesInfo.SqlId = "t_lm_promotion_t_images_update";
                }

                InsertLmImagesInfo.Parameters = lmImagesParm;
                sqlList.Add(InsertLmImagesInfo);
                strImageID = lmImagesParm[0].Value.ToString();
            }

            CommandInfo InsertLmPromMsgInfo = new CommandInfo();
            OracleParameter[] lmPromMsgParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("TITLE",OracleType.VarChar),
                                    new OracleParameter("PRIORITY",OracleType.VarChar),
                                    new OracleParameter("STARTDTIME",OracleType.VarChar),
                                    new OracleParameter("ENDDTIME",OracleType.VarChar),
                                    new OracleParameter("CONTENT",OracleType.VarChar),
                                    new OracleParameter("IMAGEID",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("OPERATEUSER",OracleType.VarChar),
                                    new OracleParameter("RATECODE",OracleType.VarChar),
                                    new OracleParameter("PROMETHODID",OracleType.VarChar)
                                };

            lmPromMsgParm[0].Value = dbParm.ID;
            lmPromMsgParm[1].Value = dbParm.Title;
            lmPromMsgParm[2].Value = dbParm.Priority;
            lmPromMsgParm[3].Value = dbParm.StartDTime;
            lmPromMsgParm[4].Value = dbParm.EndDTime;
            lmPromMsgParm[5].Value = dbParm.Content;

            if (String.IsNullOrEmpty(strImageID))
            {
                lmPromMsgParm[6].Value = DBNull.Value;
            }
            else
            {
                lmPromMsgParm[6].Value = strImageID;
            }
            lmPromMsgParm[7].Value = dbParm.Status;
            lmPromMsgParm[8].Value = (promotionEntity.LogMessages != null) ? promotionEntity.LogMessages.Userid : "";
            lmPromMsgParm[9].Value = String.IsNullOrEmpty(dbParm.RateCode) ? "" : dbParm.RateCode;
            lmPromMsgParm[10].Value = dbParm.Promethodid;

            InsertLmPromMsgInfo.SqlName = "Promotion";
            InsertLmPromMsgInfo.SqlId = "t_lm_promotionmsg_update";
            InsertLmPromMsgInfo.Parameters = lmPromMsgParm;
            sqlList.Add(InsertLmPromMsgInfo);

            CommandInfo UpdateLmPromMsgDetailDelInfo = new CommandInfo();
            OracleParameter[] lmPromMsgDetailDelParm ={
                                    new OracleParameter("ID",OracleType.Int32)
                                };

            lmPromMsgDetailDelParm[0].Value = dbParm.ID;

            UpdateLmPromMsgDetailDelInfo.SqlName = "Promotion";
            UpdateLmPromMsgDetailDelInfo.SqlId = "t_lm_promotionmsg_detail_update";
            UpdateLmPromMsgDetailDelInfo.Parameters = lmPromMsgDetailDelParm;
            sqlList.Add(UpdateLmPromMsgDetailDelInfo);

            string PromotionCommonKey = String.IsNullOrEmpty(ConfigurationManager.AppSettings["PromotionCommonKey"]) ? "000000" : ConfigurationManager.AppSettings["PromotionCommonKey"].ToString();

            CommandInfo InsertLmPromMsgDetailInfo = new CommandInfo();
            OracleParameter[] lmPromMsgDetailParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("PROTYPE",OracleType.VarChar),
                                    new OracleParameter("COMMONLIST",OracleType.VarChar),
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("LINKURL",OracleType.VarChar)
                                };

            lmPromMsgDetailParm[0].Value = lmPromMsgParm[0].Value;
            lmPromMsgDetailParm[1].Value = dbParm.Type;

            InsertLmPromMsgDetailInfo.SqlName = "Promotion";

            if ("0".Equals(dbParm.Type))
            {
                InsertLmPromMsgDetailInfo.SqlId = "t_lm_promotionmsg_detail_all_insert";

                lmPromMsgDetailParm[2].Value = DBNull.Value;
                lmPromMsgDetailParm[3].Value = DBNull.Value;
            }
            else if ("1".Equals(dbParm.Type))
            {
                lmPromMsgDetailParm[2].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                lmPromMsgDetailParm[3].Value = DBNull.Value;
                InsertLmPromMsgDetailInfo.SqlId = "t_lm_promotionmsg_detail_city_insert";
            }
            else if ("2".Equals(dbParm.Type))
            {
                lmPromMsgDetailParm[2].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                lmPromMsgDetailParm[3].Value = DBNull.Value;
                InsertLmPromMsgDetailInfo.SqlId = "t_lm_promotionmsg_detail_group_insert";
            }
            else if ("3".Equals(dbParm.Type))
            {
                lmPromMsgDetailParm[2].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                lmPromMsgDetailParm[3].Value = DBNull.Value;
                InsertLmPromMsgDetailInfo.SqlId = "t_lm_promotionmsg_detail_hotel_insert";
            }
            else if ("4".Equals(dbParm.Type))
            {
                lmPromMsgDetailParm[2].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey + "," : dbParm.CommonList;
                lmPromMsgDetailParm[3].Value = ("1".Equals(dbParm.ChkType)) ? PromotionCommonKey : dbParm.HotelID;
                InsertLmPromMsgDetailInfo.SqlId = "t_lm_promotionmsg_detail_room_insert";
            }

            if (String.IsNullOrEmpty(dbParm.LinkUrl))
            {
                lmPromMsgDetailParm[4].Value = DBNull.Value;
            }
            else
            {
                lmPromMsgDetailParm[4].Value = dbParm.LinkUrl;
            }

            InsertLmPromMsgDetailInfo.Parameters = lmPromMsgDetailParm;
            sqlList.Add(InsertLmPromMsgDetailInfo);

            if (dbParm.UserGroupList.Length > 0)
            {
                CommandInfo InsertLmPromMsgUserGroupInfo = new CommandInfo();
                OracleParameter[] lmPromMsgDetailUserGroupParm ={
                                    new OracleParameter("ID",OracleType.Int32),
                                    new OracleParameter("PROTYPE",OracleType.VarChar),
                                    new OracleParameter("USERGROUPLIST",OracleType.VarChar),
                                    new OracleParameter("LINKURL",OracleType.VarChar)
                                };
                lmPromMsgDetailUserGroupParm[0].Value = lmPromMsgParm[0].Value;
                lmPromMsgDetailUserGroupParm[1].Value = "5";
                lmPromMsgDetailUserGroupParm[2].Value = dbParm.UserGroupList;
                if (String.IsNullOrEmpty(dbParm.LinkUrl))
                {
                    lmPromMsgDetailUserGroupParm[3].Value = DBNull.Value;
                }
                else
                {
                    lmPromMsgDetailUserGroupParm[3].Value = dbParm.LinkUrl;
                }
                InsertLmPromMsgUserGroupInfo.SqlName = "Promotion";
                InsertLmPromMsgUserGroupInfo.SqlId = "t_lm_promotionmsg_usergroup_insert";
                InsertLmPromMsgUserGroupInfo.Parameters = lmPromMsgDetailUserGroupParm;
                sqlList.Add(InsertLmPromMsgUserGroupInfo);
            }

            DbManager.ExecuteSqlTran(sqlList);
            SetPromotionData(promotionEntity, strImageID);
            promotionEntity.Result = 1;
            return promotionEntity;
        }
Пример #16
0
        public static void PinyingSetting()
        {
            DateTime dtBegin = new DateTime();
            dtBegin = System.DateTime.Now;
            DataSet dsHotel = PinyingDA.GetHotelPinyingList();

            if (dsHotel.Tables.Count == 0 || dsHotel.Tables[0].Rows.Count == 0)
            {
                return;
            }

            CommonEntity _commonEntity = new CommonEntity();
            _commonEntity.LogMessages = new Common.Logger.LogMessage();

            IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
            IPAddress[] address = hostInfo.AddressList;
            string m_IP = address[0].ToString();

            _commonEntity.LogMessages.IpAddress = m_IP;
            _commonEntity.LogMessages.Computername = Dns.GetHostName();
            _commonEntity.LogMessages.Userid = "JOB System";
            _commonEntity.LogMessages.Username = "******";
            _commonEntity.CommonDBEntity = new List<CommonDBEntity>();

            string strResult = "";
            string strContent = "";
            string strTemp = "酒店目的地信息管理--酒店ID:{0} 全拼:{1} 短拼:{2}";
            string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("Pinying", "t_lm_b_pinying_hotel_save");
            Hashtable htList = new Hashtable();
            int iCount = 0;
            int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            List<CommandInfo> cmdList = new List<CommandInfo>();

            ChineseCode chineseCode = new ChineseCode();
            for (int i = 0; i <= dsHotel.Tables[0].Rows.Count - 1; i++)
            {
                if (String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["HOTELID"].ToString()))
                {
                    continue;
                }

                //dsHotel.Tables[0].Rows[i]["LPINYIN"] = HotelVp.Common.Utilities.PinyinHelper.GetPinyin(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());
                //dsHotel.Tables[0].Rows[i]["SPINYIN"] = HotelVp.Common.Utilities.PinyinHelper.GetShortPinyin(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());

                try
                {
                    dsHotel.Tables[0].Rows[i]["LPINYIN"] = String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()) ? "" : chineseCode.GetSpell(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim());
                    dsHotel.Tables[0].Rows[i]["SPINYIN"] = String.IsNullOrEmpty(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()) ? "" : chineseCode.IndexCode(dsHotel.Tables[0].Rows[i]["PROPNAME"].ToString().Trim()).ToLower();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                CommandInfo cminfo = new CommandInfo();
                cminfo.CommandText = strSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("LPINYIN",OracleType.VarChar),
                                    new OracleParameter("SPINYIN",OracleType.VarChar)
                                };

                lmParm[0].Value = dsHotel.Tables[0].Rows[i]["HOTELID"].ToString();
                lmParm[1].Value = dsHotel.Tables[0].Rows[i]["LPINYIN"].ToString();
                lmParm[2].Value = dsHotel.Tables[0].Rows[i]["SPINYIN"].ToString();
                cminfo.Parameters = lmParm;
                cmdList.Add(cminfo);
                iCount = iCount + 1;
                if (MaxLength == iCount)
                {
                    try
                    {
                        PinyingDA.SavePinyingCommonList(cmdList);
                        strResult = "成功";
                    }
                    catch
                    {
                        strResult = "失败";
                    }

                    foreach (CommandInfo tempinfo in cmdList)
                    {
                        OracleParameter[] tempParm = (OracleParameter[])tempinfo.Parameters;
                        strContent = string.Format(strTemp, tempParm[0].Value.ToString(), tempParm[1].Value.ToString(), tempParm[2].Value.ToString());

                        CommonDBEntity commonDBEntity = new CommonDBEntity();
                        commonDBEntity.Event_Type = "JOB-酒店拼音设置";
                        commonDBEntity.Event_Content = strContent;
                        commonDBEntity.Event_Result = strResult;
                        commonDBEntity.Event_ID = tempParm[0].Value.ToString();
                        commonDBEntity.UserID = "JOB System";
                        commonDBEntity.UserID = "JOB System";

                        _commonEntity.LogMessages.Event_id = tempParm[0].Value.ToString();
                        _commonEntity.CommonDBEntity.Add(commonDBEntity);
                        CommonBP.InsertEventHistory(_commonEntity);
                        _commonEntity.CommonDBEntity.Clear();
                        Console.WriteLine(strContent + "设置结果:" + strResult);
                    }

                    iCount = 0;
                    cmdList.Clear();
                }
            }

            if (iCount > 0)
            {
                try
                {
                    PinyingDA.SavePinyingCommonList(cmdList);
                    strResult = "成功";
                }
                catch
                {
                    strResult = "失败";
                }

                foreach (CommandInfo tempinfo in cmdList)
                {
                    OracleParameter[] tempParm = (OracleParameter[])tempinfo.Parameters;
                    strContent = string.Format(strTemp, tempParm[0].Value.ToString(), tempParm[1].Value.ToString(), tempParm[2].Value.ToString());

                    CommonDBEntity commDBEntity = new CommonDBEntity();
                    commDBEntity.Event_Type = "JOB-酒店拼音设置";
                    commDBEntity.Event_Content = strContent;
                    commDBEntity.Event_Result = strResult;
                    commDBEntity.Event_ID = tempParm[0].Value.ToString();

                    _commonEntity.LogMessages.Event_id = tempParm[0].Value.ToString();
                    _commonEntity.CommonDBEntity.Add(commDBEntity);
                    CommonBP.InsertEventHistory(_commonEntity);
                    _commonEntity.CommonDBEntity.Clear();
                    Console.WriteLine(strContent + "设置结果:" + strResult);
                }
            }

            DateTime dtEnd = new DateTime();
            dtEnd = System.DateTime.Now;

            Console.WriteLine(dtEnd - dtBegin);
        }
        public static int FtTypeSeqListUpdate(HotelFacilitiesEntity hotelfacilitiesEntity)
        {
            if (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count == 0)
            {
                return 0;
            }

            if (hotelfacilitiesEntity.LogMessages == null)
            {
                return 0;
            }

            HotelFacilitiesDBEntity dbParm = (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count > 0) ? hotelfacilitiesEntity.HotelFacilitiesDBEntity[0] : new HotelFacilitiesDBEntity();

            List<CommandInfo> sqlList = new List<CommandInfo>();

            Hashtable htList = dbParm.FTSeqList;

            foreach (System.Collections.DictionaryEntry key in htList)
            {
                CommandInfo UpdateCsTypeInfo = new CommandInfo();
                OracleParameter[] parm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("SEQ",OracleType.VarChar)

                                };
                parm[0].Value = key.Key;
                parm[1].Value = key.Value;
                UpdateCsTypeInfo.SqlName = "HotelFacilities";
                UpdateCsTypeInfo.SqlId = "t_lm_b_hotel_facilities_type_seq_update";
                UpdateCsTypeInfo.Parameters = parm;
                sqlList.Add(UpdateCsTypeInfo);
            }

            DbManager.ExecuteSqlTran(sqlList);
            //DbManager.ExecuteSql("HotelFacilities", "t_lm_b_hotel_facilities_type_seq_update", parm);
            return 1;
        }
Пример #18
0
        public static int DestinationUpdate(DestinationEntity destinationEntity)
        {
            if (destinationEntity.DestinationDBEntity.Count == 0)
            {
                return 0;
            }

            if (destinationEntity.LogMessages == null)
            {
                return 0;
            }

            //if (CheckDestinationUpdate(destinationEntity) > 0)
            //{
            //    return 2;
            //}

            if (CheckDestinationCityInsert(destinationEntity) == 0)
            {
                return 3;
            }

            DestinationDBEntity dbParm = (destinationEntity.DestinationDBEntity.Count > 0) ? destinationEntity.DestinationDBEntity[0] : new DestinationDBEntity();

            CommandInfo InsertLmPaymentInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("CITYID",OracleType.VarChar),
                                    new OracleParameter("TYPEID",OracleType.VarChar),
                                    new OracleParameter("NAMECN",OracleType.VarChar),
                                    new OracleParameter("ADDRESSCN",OracleType.VarChar),
                                    new OracleParameter("TELST",OracleType.VarChar),
                                    new OracleParameter("TELLG",OracleType.VarChar),
                                    new OracleParameter("LATITUDE",OracleType.VarChar),
                                    new OracleParameter("LONGITUDE",OracleType.VarChar),
                                    new OracleParameter("ONLINESTATUS",OracleType.VarChar)
                                };

            lmParm[0].Value = dbParm.DestinationID;
            lmParm[1].Value = dbParm.CityID;
            lmParm[2].Value = dbParm.DestinationTypeID;
            lmParm[3].Value = dbParm.Name_CN;
            lmParm[4].Value = dbParm.AddRess;
            lmParm[5].Value = dbParm.TelST;
            lmParm[6].Value = dbParm.TelLG;
            lmParm[7].Value = dbParm.Latitude;
            lmParm[8].Value = dbParm.Longitude;
            lmParm[9].Value = dbParm.OnlineStatus;
            DbManager.ExecuteSql("Destination", "t_lm_b_destination_update", lmParm);
            return 1;
        }
        public static int HotelInsert(HotelFacilitiesEntity hotelfacilitiesEntity)
        {
            if (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count == 0)
            {
                return 0;
            }

            if (hotelfacilitiesEntity.LogMessages == null)
            {
                return 0;
            }

            HotelFacilitiesDBEntity dbParm = (hotelfacilitiesEntity.HotelFacilitiesDBEntity.Count > 0) ? hotelfacilitiesEntity.HotelFacilitiesDBEntity[0] : new HotelFacilitiesDBEntity();

            List<CommandInfo> sqlList = new List<CommandInfo>();

            CommandInfo UpdateCsHotelInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar)
                                };
            lmParm[0].Value = dbParm.HotelID;
            UpdateCsHotelInfo.SqlName = "HotelFacilities";
            UpdateCsHotelInfo.SqlId = "t_lm_b_hotel_service_save_update";
            UpdateCsHotelInfo.Parameters = lmParm;
            sqlList.Add(UpdateCsHotelInfo);

            foreach (string drRow in dbParm.AryFalLisT)
            {
                CommandInfo InsertCsHotelInfo = new CommandInfo();
                OracleParameter[] csParm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("FACILITIESCODE",OracleType.VarChar)
                                };

                csParm[0].Value = dbParm.HotelID;
                csParm[1].Value = drRow.Trim();

                InsertCsHotelInfo.SqlName = "HotelFacilities";
                InsertCsHotelInfo.SqlId = "t_lm_b_hotel_service_save";
                InsertCsHotelInfo.Parameters = csParm;
                sqlList.Add(InsertCsHotelInfo);
            }

            //OracleParameter[] lmParm ={
            //                        new OracleParameter("ID",OracleType.Number),
            //                        new OracleParameter("NAMECN",OracleType.VarChar)
            //                    };

            //lmParm[0].Value = getMaxIDfromSeq("t_lm_b_facilities_hotel_SEQ");
            //lmParm[1].Value = dbParm.Name_CN;
            //DbManager.ExecuteSql("HotelFacilities", "t_lm_b_hotel_service_save", lmParm);
            DbManager.ExecuteSqlTran(sqlList);
            return 1;
        }
Пример #20
0
        public static int Insert(DestinationEntity destinationEntity)
        {
            if (destinationEntity.DestinationDBEntity.Count == 0)
            {
                return 0;
            }

            if (destinationEntity.LogMessages == null)
            {
                return 0;
            }

            if (CheckInsert(destinationEntity) > 0)
            {
                return 2;
            }

            DestinationDBEntity dbParm = (destinationEntity.DestinationDBEntity.Count > 0) ? destinationEntity.DestinationDBEntity[0] : new DestinationDBEntity();

            CommandInfo InsertLmPaymentInfo = new CommandInfo();
            OracleParameter[] lmParm ={
                                    new OracleParameter("ID",OracleType.Number),
                                    new OracleParameter("PARENTSID",OracleType.VarChar),
                                    new OracleParameter("NAMECN",OracleType.VarChar)
                                };

            lmParm[0].Value = getMaxIDfromSeq("T_LM_B_DESTINATION_TYPE_SEQ");
            lmParm[1].Value = dbParm.ParentsID;
            lmParm[2].Value = dbParm.Name_CN;
            DbManager.ExecuteSql("Destination", "t_lm_b_destination_type_insert", lmParm);

            if (!String.IsNullOrEmpty(dbParm.ParentsID))
            {
                UpdateFlag(dbParm.ParentsID, "0");
            }

            return 1;
        }
Пример #21
0
        public static void BDTudeConvertSetting()
        {
            string strResult = "";
            string strSQL = XmlSqlAnalyze.GotSqlTextFromXml("GGBDTude", "t_lm_b_hotel_save");
            int iCount = 0;
            int MaxLength = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["MaxLength"].ToString())) ? 1000 : int.Parse(ConfigurationManager.AppSettings["MaxLength"].ToString());
            List<CommandInfo> cmdList = new List<CommandInfo>();
            string[] Los = new string[2];
            DataSet dsHotel = GGBDTudeDA.GetHotelList();
            for (int i = 0; i <= dsHotel.Tables[0].Rows.Count; i++)
            {
                // 城市-销售人员名-酒店名前四个字母
                try
                {
                    Los = GGBDCovertHelper.GGBDCovert(dsHotel.Tables[0].Rows[i]["longitude"].ToString(), dsHotel.Tables[0].Rows[i]["latitude"].ToString());
                    CommandInfo cminfo = new CommandInfo();
                    cminfo.CommandText = strSQL;
                    OracleParameter[] parm ={
                                    new OracleParameter("HOTELID",OracleType.VarChar),
                                    new OracleParameter("LONGITUDE",OracleType.VarChar),
                                    new OracleParameter("LATITUDE",OracleType.VarChar)
                                };
                    parm[0].Value = dsHotel.Tables[0].Rows[i]["prop"].ToString();
                    parm[1].Value = Los[0];
                    parm[2].Value = Los[1];

                    cminfo.Parameters = parm;
                    cmdList.Add(cminfo);
                    iCount = iCount + 1;

                    if (MaxLength == iCount)
                    {
                        try
                        {
                            GGBDTudeDA.SaveHotelTudeCommonList(cmdList);
                            iCount = 0;
                            cmdList.Clear();
                            strResult = "成功";
                        }
                        catch
                        {
                            strResult = "失败";
                        }
                    }
                    //GGBDTudeDA.SaveHotelTude(dsHotel.Tables[0].Rows[i]["prop"].ToString(), GGBDCovert.GGBDCovert(dsHotel.Tables[0].Rows[i]["longitude"].ToString(), dsHotel.Tables[0].Rows[i]["latitude"].ToString()));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }

            if (iCount > 0)
            {
                try
                {
                    GGBDTudeDA.SaveHotelTudeCommonList(cmdList);
                    strResult = "成功";
                }
                catch
                {
                    strResult = "失败";
                }
            }

            Console.WriteLine(strResult);
        }