コード例 #1
0
        /// <summary>
        /// 通过域名 或 网址显示公司信息
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public User_Company GetByURL(string url)
        {
            User_Company uCompany = null;

            if (!string.IsNullOrEmpty(url) && url.Trim() != "")
            {
                url = url.ToUpper();

                //List<User_Company> uCompanyList = new Dal.ControlBase.BaseData<User_Company>().GetList();
                //if (uCompanyList != null && uCompanyList.Count > 0)
                //{
                //    foreach (User_Company company in uCompanyList)
                //    {
                //        if (company.WebSite.ToUpper().Contains(url))
                //        {
                //            uCompany = company;
                //            break;
                //        }
                //    }
                //}

                List <User_Company> uCompanyList = baseDataManage.CallMethod("User_Company", "GetList", null, new Object[] { "WebSite like '%" + url + "%'" }) as List <User_Company>;
                if (uCompanyList != null && uCompanyList.Count > 0)
                {
                    uCompany = uCompanyList[0];
                }
            }
            return(uCompany);
        }
コード例 #2
0
        /// <summary>
        /// 保存指令信息到数据库
        /// </summary>
        /// <returns></returns>
        public bool SaveInsInfo(RePnrObj PnrInfo, User_Employees m_user, User_Company m_company)
        {
            bool   IsSuc  = true;
            string errMsg = "";

            try
            {
                List <string> sqlList = new List <string>();
                if (PnrInfo != null && PnrInfo.InsList.Count > 0)
                {
                    //一组指令ID
                    string        GroupID = System.DateTime.Now.Ticks.ToString();
                    DateTime      _sendtime = Convert.ToDateTime("1900-01-01");
                    DateTime      _recvtime = Convert.ToDateTime("1900-01-01");
                    string        UserAccount = userInfo.User.LoginName, CpyNo = userInfo.Company.UninCode, serverIPPort = PnrInfo.ServerIP + ":" + PnrInfo.ServerPort, Office = PnrInfo.Office;
                    string[]      strArr     = null;
                    List <string> Removelist = new List <string>();
                    Removelist.Add("id");
                    foreach (KeyValuePair <string, string> KV in PnrInfo.InsList)
                    {
                        strArr = KV.Key.Split(new string[] { PnrInfo.SplitChar }, StringSplitOptions.None);
                        if (strArr.Length == 4)
                        {
                            Tb_SendInsData ins = new Tb_SendInsData();
                            ins.SendIns = strArr[0];
                            if (DateTime.TryParse(strArr[1], out _sendtime))
                            {
                                ins.SendTime = _sendtime;
                            }
                            if (DateTime.TryParse(strArr[2], out _recvtime))
                            {
                                ins.RecvTime = _recvtime;
                            }
                            if (strArr[3] != "")
                            {
                                ins.Office = strArr[3];
                            }
                            ins.RecvData        = KV.Value;
                            ins.Office          = Office;
                            ins.ServerIPAndPort = serverIPPort + "|" + GroupID;
                            ins.UserAccount     = UserAccount;
                            ins.CpyNo           = CpyNo;
                            ins.SendInsType     = 12;//特价指令
                            sqlList.Add(PbProject.Dal.Mapping.MappingHelper <Tb_SendInsData> .CreateInsertModelSql(ins, Removelist));
                        }
                    }
                    if (sqlList.Count > 0)
                    {
                        IsSuc = Manage.ExecuteSqlTran(sqlList, out errMsg);
                    }
                }
            }
            catch (Exception ex)
            {
                IsSuc  = false;
                errMsg = ex.Message + ex.StackTrace.ToString();
                PnrAnalysis.LogText.LogWrite("【时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ff") + " 方法:SaveInsInfo】================================================================\r\n 异常信息:" + errMsg + "\r\n", "SpPatAjax");
            }
            return(IsSuc);
        }
コード例 #3
0
ファイル: AuthLogin.cs プロジェクト: toyslife/PiaoBaoWork3.0
        /// <summary>
        /// 获取登录用户信息对象
        /// </summary>
        /// <param name="userTableArray">用户信息表</param>
        /// <returns>返回用户信息对象</returns>
        private UserLoginInfo GetLoginUserInfo(DataTable[] userTableArray)
        {
            //当前登录用户信息
            User_Employees user = MappingHelper <User_Employees> .FillModel(userTableArray[0].Rows[0]);

            //当前登录公司信息
            User_Company company = MappingHelper <User_Company> .FillModel(userTableArray[1].Rows[0]);

            //当前登录用户公司参数信息
            List <Bd_Base_Parameters> baseParametersList = MappingHelper <Bd_Base_Parameters> .FillModelList(userTableArray[2]);

            var mSupCompany = MappingHelper <User_Company> .FillModel(userTableArray[3].Rows[0]);

            var supParameters = MappingHelper <Bd_Base_Parameters> .FillModelList(userTableArray[4]);

            var configparam = Bd_Base_ParametersBLL.GetConfigParam(supParameters);
            var FQP         = PbProject.WebCommon.Utility.BaseParams.getParams(supParameters);
            //用户信息对象
            UserLoginInfo userInfo = new UserLoginInfo()
            {
                User               = user,
                Company            = company,
                BaseParametersList = baseParametersList,
                mSupCompany        = mSupCompany,
                Configparam        = configparam,
                SupParameters      = supParameters,
                FQP = FQP
            };

            return(userInfo);
        }
コード例 #4
0
        /// <summary>
        /// 登录用户信息转化
        /// </summary>
        /// <param name="LoginIn"></param>
        /// <returns></returns>
        public SessionContent GetLoginUserModel(DataSet LoginIn)
        {
            //当前登录用户信息
            User_Employees m_User = null;
            //当前登录公司信息
            User_Company mCompany = null;
            //供应商和落地运营商公司信息
            User_Company mSupCompany = null;
            //当前登录用户参数信息
            List <Bd_Base_Parameters> baseParametersList = null;
            //落地运营商和供应商公司参数信息
            List <Bd_Base_Parameters> SupParameters = null;
            //配置信息
            ConfigParam configparam = null;
            //保存用户信息
            SessionContent sessionContent = new SessionContent();

            if (LoginIn.Tables.Count == 5)
            {
                m_User = MappingHelper <User_Employees> .FillModel(LoginIn.Tables[0].Rows[0]);

                mCompany = MappingHelper <User_Company> .FillModel(LoginIn.Tables[1].Rows[0]);

                baseParametersList = MappingHelper <Bd_Base_Parameters> .FillModelList(LoginIn.Tables[2]);

                mSupCompany = MappingHelper <User_Company> .FillModel(LoginIn.Tables[3].Rows[0]);

                SupParameters = MappingHelper <Bd_Base_Parameters> .FillModelList(LoginIn.Tables[4]);

                configparam = Bd_Base_ParametersBLL.GetConfigParam(SupParameters);
            }
            else if (LoginIn.Tables.Count == 3)
            {
                //管理员
                m_User = MappingHelper <User_Employees> .FillModel(LoginIn.Tables[0].Rows[0]);

                mCompany = MappingHelper <User_Company> .FillModel(LoginIn.Tables[1].Rows[0]);

                baseParametersList = MappingHelper <Bd_Base_Parameters> .FillModelList(LoginIn.Tables[2]);
            }
            sessionContent.USER              = m_User;             // 用户信息
            sessionContent.COMPANY           = mCompany;           // 公司信息
            sessionContent.SUPCOMPANY        = mSupCompany;        //供应商和落地运营商公司信息
            sessionContent.BASEPARAMETERS    = baseParametersList; //公司参数信息
            sessionContent.SupBASEPARAMETERS = SupParameters;      //落地运营商和供应商公司参数信息
            sessionContent.CONFIGPARAM       = configparam;        //配置信息
            //设置到全局变量中
            Program.UserModel = sessionContent;
            return(sessionContent);
        }
コード例 #5
0
ファイル: Authorisation.cs プロジェクト: ColmLive/CA2_OPW
        // Constructor
        public Authorisation(string User_Name, string User_Password, User_Company Company, User_Section Usersect)
        {
            this.User_Name     = User_Name;
            this.User_Password = User_Password;
            this.Company       = Company;
            this.Usersect      = Usersect;

            try
            {
                if (Usersect == User_Section.MandE_Works)
                {
                    Usersectcode        = User_Section_Code.E30_ZS_34;
                    User_Approval_Limit = 0;
                }
                else if (Usersect == User_Section.Elective_Works)
                {
                    Usersectcode        = User_Section_Code.k00_ZS_34;
                    User_Approval_Limit = 0;
                }
                else if (Usersect == User_Section.Capital_works)
                {
                    Usersectcode        = User_Section_Code.J10_ZS_34;
                    User_Approval_Limit = 0;
                }
                else if (Usersect == User_Section.Storage)

                {
                    Usersectcode        = User_Section_Code.L00_ZH_34;
                    User_Approval_Limit = 0;
                }
                else if (Usersect == User_Section.Admin)
                {
                    Usersectcode        = User_Section_Code.Admin;
                    User_Approval_Limit = 999999999;
                }
                else if (Usersect == User_Section.Accommodation)
                {
                    Usersectcode        = User_Section_Code.FMU1;
                    User_Approval_Limit = 40000;
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e);
            }
        }
コード例 #6
0
        /// <summary>
        /// 根据公司编号获取公司信息
        /// </summary>
        /// <param name="CpyNo">公司编号</param>
        /// <returns></returns>
        public PbProject.Model.User_Company GetCompany(string CpyNo)
        {
            User_Company uCompany = null;

            try
            {
                string sqlWhere = " UninCode='" + CpyNo + "'";
                List <User_Company> uCompanyList = GetListBySqlWhere(sqlWhere);

                if (uCompanyList != null && uCompanyList.Count > 0)
                {
                    uCompany = uCompanyList[0];
                }
            }
            catch (Exception)
            {
            }
            return(uCompany);
        }
コード例 #7
0
ファイル: VirtualPay.cs プロジェクト: toyslife/PiaoBaoWork3.0
        /// <summary>
        /// 账户余额退款
        /// </summary>
        /// <param name="mOrder">订单mOrder<</param>
        /// <param name="mUser">当前操作员model</param>
        /// <param name="mCompany">当前操作员公司model</param>
        /// <param name="Page">当前页面对象</param>
        /// <param name="messge">消息</param>
        /// <returns></returns>
        public bool DepositRefund(Tb_Ticket_Order mOrder, User_Employees mUser, User_Company mCompany, out string messge)
        {
            lock (lockobject)
            {
                bool result = false;
                messge = "";
                try
                {
                    result = new Bill().CreateVirtualRefundBill(mOrder, mUser, mCompany, out messge);

                    if (!result)
                    {
                        //退款失败记录日志
                        new Bill().CreateBillRefundFailedLog(mUser,mOrder.OrderId, messge);
                    }
                }
                catch (Exception)
                {
                    messge = "退款异常!";
                }
                return result;
            }
        }
コード例 #8
0
ファイル: PTBy8000yi.cs プロジェクト: toyslife/PiaoBaoWork3.0
        private List <PbProject.Model.Tb_Ticket_Policy> Merger8000YDT(DataRow[] Dr8000Y, User_Company GYCompany, bool ChangePnr)
        {
            try
            {
                List <PbProject.Model.Tb_Ticket_Policy> mPolicyList = new List <Tb_Ticket_Policy>();
                for (int i = 0; i < Dr8000Y.Length; i++)
                {
                    PbProject.Model.Tb_Ticket_Policy mPolicy = new Tb_Ticket_Policy();
                    mPolicy.CpyNo   = "0" + PbProject.Model.definitionParam.PolicySourceParam.b8000yi.ToString() + _mTopcom.UninCode;
                    mPolicy.CpyName = _mTopcom.UninName;



                    //yyy 2013年6月7日
                    //过滤掉换编码出票的政策
                    if (!ChangePnr)
                    {
                        if (Dr8000Y[i]["A17"].ToString().Contains("换编码出票"))
                        {
                            continue;
                        }
                    }


                    if (Dr8000Y[i]["A22"].ToString() == "0")//是否是特殊政策
                    {
                        mPolicy.PolicyKind     = 0;
                        mPolicy.GenerationType = 1;
                    }
                    else
                    {
                        mPolicy.PolicyKind     = 2;
                        mPolicy.GenerationType = 2;
                    }
                    mPolicy.CarryCode = Dr8000Y[i]["A4"].ToString();
                    if (Dr8000Y[i]["A7"].ToString() == "1")
                    {
                        mPolicy.TravelType = 1;
                    }
                    else if (Dr8000Y[i]["A7"].ToString() == "3")
                    {
                        mPolicy.TravelType = 2;
                    }
                    else if (Dr8000Y[i]["A7"].ToString() == "2")
                    {
                        mPolicy.TravelType = 3;
                    }
                    else
                    {
                        mPolicy.TravelType = 4;
                    }

                    if (Dr8000Y[i]["A16"].ToString() == "BSP")
                    {
                        mPolicy.PolicyType = 2;
                    }
                    else
                    {
                        mPolicy.PolicyType = 1;
                    }
                    mPolicy.TeamFlag = 0;
                    if (Dr8000Y[i]["A2"].ToString() == "All")
                    {
                        mPolicy.StartCityNameCode = "ALL";
                    }
                    else
                    {
                        mPolicy.StartCityNameCode = Dr8000Y[i]["A2"].ToString();
                    }
                    mPolicy.StartCityNameSame = 2;

                    if (Dr8000Y[i]["A3"].ToString() == "All")
                    {
                        mPolicy.TargetCityNameCode = "ALL";
                    }
                    else
                    {
                        mPolicy.TargetCityNameCode = Dr8000Y[i]["A3"].ToString();
                    }
                    mPolicy.TargetCityNameSame = 2;

                    mPolicy.ApplianceFlight     = Dr8000Y[i]["A5"].ToString();
                    mPolicy.UnApplianceFlight   = Dr8000Y[i]["A6"].ToString();
                    mPolicy.ApplianceFlightType = 2;

                    mPolicy.ScheduleConstraints = Dr8000Y[i]["A21"].ToString();
                    Regex reg = new Regex(@"/^\d+$/");
                    if (!reg.IsMatch(Dr8000Y[i]["A9"].ToString()))
                    {
                        mPolicy.ShippingSpace = Dr8000Y[i]["A9"].ToString().Replace("#", "");
                    }

                    mPolicy.SpacePrice           = Convert.ToDecimal(Dr8000Y[i]["A24"]);
                    mPolicy.FlightStartDate      = Convert.ToDateTime(Dr8000Y[i]["A10"]);
                    mPolicy.FlightEndDate        = Convert.ToDateTime(Dr8000Y[i]["A11"]);
                    mPolicy.PrintStartDate       = Convert.ToDateTime(Dr8000Y[i]["A10"]);
                    mPolicy.PrintEndDate         = Convert.ToDateTime(Dr8000Y[i]["A11"]);
                    mPolicy.AuditDate            = DateTime.Now;
                    mPolicy.AuditType            = 1;
                    mPolicy.Remark               = Dr8000Y[i]["A17"].ToString();
                    mPolicy.IsApplyToShareFlight = 0;
                    mPolicy.ShareAirCode         = "";
                    mPolicy.IsLowerOpen          = 0;
                    mPolicy.DownPoint            = decimal.Parse(Dr8000Y[i]["A8"].ToString());
                    mPolicy.InterPolicyId        = Dr8000Y[i]["A1"].ToString();
                    mPolicy._WorkTime            = WorkTimeConvert(Dr8000Y[i]["A12"].ToString(), GYCompany.WorkTime);
                    if (DateTime.Now.DayOfWeek != DayOfWeek.Saturday && DateTime.Now.DayOfWeek != DayOfWeek.Sunday)
                    {
                        mPolicy._FPGQTime = Dr8000Y[i]["A19"].ToString().Replace("|", "-");
                    }
                    else
                    {
                        mPolicy._FPGQTime = Dr8000Y[i]["A20"].ToString().Replace("|", "-");
                    }

                    mPolicy.Office = Dr8000Y[i]["A26"] == DBNull.Value ? "" : Dr8000Y[i]["A26"].ToString();
                    mPolicyList.Add(mPolicy);



                    //DataRow dr = LocalDt.NewRow();
                    //dr["CarryCode"] = Dr8000Y[i]["A4"];
                    //dr["ApplianceFlight"] = Dr8000Y[i]["A5"];
                    //dr["UnApplianceFlight"] = Dr8000Y[i]["A6"];
                    //dr["ScheduleConstraints"] = Dr8000Y[i]["A21"];
                    //Regex reg = new Regex(@"/^\d+$/");
                    //if (!reg.IsMatch(Dr8000Y[i]["A9"].ToString()))
                    //{
                    //    dr["Space"] = "/" + Dr8000Y[i]["A9"].ToString().Replace("#", "") + "/";
                    //}
                    //dr["OldPolicy"] = decimal.Parse(Dr8000Y[i]["A8"].ToString()) / 100;
                    //dr["GYPolicy"] = decimal.Parse(Dr8000Y[i]["A8"].ToString()) / 100;
                    //dr["FXPolicy"] = decimal.Parse(Dr8000Y[i]["A8"].ToString()) / 100;
                    //dr["PolicySource"] = "8";
                    //dr["PolicyId"] = Dr8000Y[i]["A1"];
                    //dr["PolicyType"] = Dr8000Y[i]["A16"].ToString().ToUpper().Contains("B2B") ? "1" : "2";
                    //dr["WorkTime"] = WorkTimeConvert(Dr8000Y[i]["A12"].ToString(), GYCompany.WorkTime);
                    //if (DateTime.Now.DayOfWeek != DayOfWeek.Saturday && DateTime.Now.DayOfWeek != DayOfWeek.Sunday)
                    //{
                    //    dr["BusinessTime"] = Dr8000Y[i]["A19"].ToString().Replace("|", "-");
                    //}
                    //else
                    //{
                    //    dr["BusinessTime"] = Dr8000Y[i]["A20"].ToString().Replace("|", "-");
                    //}
                    //dr["SpecialType"] = "0";
                    //dr["IsPause"] = "0";
                    //dr["IsLowerOpen"] = "0";
                    //dr["Remark"] = Dr8000Y[i]["A17"].ToString();
                    //dr["PolOffice"] = Dr8000Y[i]["A26"];
                    //LocalDt.Rows.Add(dr);
                }
                return(mPolicyList);
            }
            finally
            { }
        }
コード例 #9
0
ファイル: PTBy51book.cs プロジェクト: toyslife/PiaoBaoWork3.0
        /// <summary>
        /// 将51政策合并到原始政策dt中去
        /// </summary>
        /// <param name="LocalDt">原始dt</param>
        /// <param name="Dt517">51dt</param>
        private List <PbProject.Model.Tb_Ticket_Policy> Merger51DT(DataRow[] Dr51, string travel, string FromDate, string time, User_Company GYCompany, bool ChangePnr)
        {
            try
            {
                List <PbProject.Model.Tb_Ticket_Policy> mPolicyList = new List <Tb_Ticket_Policy>();
                for (int i = 0; i < Dr51.Length; i++)
                {
                    Dr51[i]["startDate"]              = Dr51[i]["startDate"].ToString().Trim() == "" ? FromDate : Dr51[i]["startDate"].ToString();
                    Dr51[i]["expiredDate"]            = Dr51[i]["expiredDate"].ToString().Trim() == "" ? time : Dr51[i]["expiredDate"].ToString();
                    Dr51[i]["printTicketStartDate"]   = Dr51[i]["printTicketStartDate"].ToString().Trim() == "" ? DateTime.Now.ToShortDateString() : Dr51[i]["printTicketStartDate"].ToString();
                    Dr51[i]["printTicketExpiredDate"] = Dr51[i]["printTicketExpiredDate"].ToString().Trim() == "" ? DateTime.Now.ToShortDateString() : Dr51[i]["printTicketExpiredDate"].ToString();

                    if (DateTime.Parse(Dr51[i]["startDate"].ToString().Split(' ')[0]) <= DateTime.Parse(FromDate) && DateTime.Parse(Dr51[i]["expiredDate"].ToString().Split(' ')[0]) >= DateTime.Parse(time) && DateTime.Parse(Dr51[i]["printTicketStartDate"].ToString().Split(' ')[0]) <= DateTime.Parse(DateTime.Now.ToShortDateString()) && DateTime.Parse(Dr51[i]["printTicketExpiredDate"].ToString().Split(' ')[0]) >= DateTime.Parse(DateTime.Now.ToShortDateString()))
                    {
                        //如果不允许换编码并且政策是必须换编码出票的,则过滤掉,yyy 2013-6-7update
                        if (!ChangePnr && bool.Parse(Dr51[i]["needSwitchPNR"].ToString()))
                        {
                            continue;
                        }
                        if (travel == Dr51[i]["routeType"].ToString())
                        {
                            if (Dr51[i]["onWorking"].ToString().ToLower() == "true")
                            {
                                PbProject.Model.Tb_Ticket_Policy mPolicy = new Tb_Ticket_Policy();
                                mPolicy.CpyNo   = "0" + PbProject.Model.definitionParam.PolicySourceParam.b51book.ToString() + _mTopcom.UninCode;
                                mPolicy.CpyName = _mTopcom.UninName;
                                if (Dr51[i]["businessUnitType"].ToString() == "0")//是否是特殊政策
                                {
                                    mPolicy.PolicyKind     = 0;
                                    mPolicy.GenerationType = 1;
                                }
                                else
                                {
                                    mPolicy.PolicyKind     = 2;
                                    mPolicy.GenerationType = 2;
                                }
                                mPolicy.CarryCode = Dr51[i]["airlineCode"].ToString();
                                if (Dr51[i]["routeType"].ToString() == "OW")
                                {
                                    mPolicy.TravelType = 1;
                                }
                                else if (Dr51[i]["routeType"].ToString() == "RT")
                                {
                                    mPolicy.TravelType = 3;
                                }
                                else
                                {
                                    mPolicy.TravelType = 4;
                                }

                                if (Dr51[i]["policyType"].ToString() == "B2P")
                                {
                                    mPolicy.PolicyType = 2;
                                }
                                else
                                {
                                    mPolicy.PolicyType = 1;
                                }
                                mPolicy.TeamFlag = 0;
                                if (Dr51[i]["flightCourse"].ToString() == "999-999")
                                {
                                    mPolicy.StartCityNameCode = "ALL";
                                }
                                else
                                {
                                    mPolicy.StartCityNameCode = Dr51[i]["flightCourse"].ToString().Split('-')[0];
                                }
                                mPolicy.StartCityNameSame = 2;

                                if (Dr51[i]["flightCourse"].ToString() == "999-999")
                                {
                                    mPolicy.TargetCityNameCode = "ALL";
                                }
                                else
                                {
                                    mPolicy.TargetCityNameCode = Dr51[i]["flightCourse"].ToString().Split('-')[1];
                                }
                                mPolicy.TargetCityNameSame  = 2;
                                mPolicy.ApplianceFlight     = Dr51[i]["flightNoIncluding"].ToString();
                                mPolicy.UnApplianceFlight   = Dr51[i]["flightNoExclude"].ToString();
                                mPolicy.ApplianceFlightType = 2;
                                mPolicy.ScheduleConstraints = Dr51[i]["flightCycle"].ToString();
                                mPolicy.ShippingSpace       = Dr51[i]["seatClass"].ToString();

                                mPolicy.FlightStartDate = Convert.ToDateTime(Dr51[i]["startDate"]);
                                mPolicy.FlightEndDate   = Convert.ToDateTime(Dr51[i]["expiredDate"]);
                                mPolicy.PrintStartDate  = Convert.ToDateTime(Dr51[i]["printTicketStartDate"]);
                                mPolicy.PrintEndDate    = Convert.ToDateTime(Dr51[i]["printTicketExpiredDate"]);
                                mPolicy.AuditDate       = DateTime.Now;
                                mPolicy.AuditType       = 1;
                                string isChangePnr = "";
                                if (bool.Parse(Dr51[i]["needSwitchPNR"].ToString()))
                                {
                                    isChangePnr = "须换编码出票.";
                                }
                                mPolicy.Remark = isChangePnr + " " + Dr51[i]["comment"].ToString();
                                mPolicy.IsApplyToShareFlight = 0;
                                mPolicy.ShareAirCode         = "";
                                mPolicy.IsLowerOpen          = 0;
                                mPolicy.DownPoint            = decimal.Parse(Dr51[i]["Commission"].ToString());
                                mPolicy.InterPolicyId        = Dr51[i]["Id"].ToString();
                                mPolicy._WorkTime            = WorkTimeConvert(Dr51[i]["workTime"].ToString(), GYCompany.WorkTime);
                                mPolicy._FPGQTime            = Dr51[i]["chooseOutWorkTime"].ToString();
                                mPolicy.Office = Dr51[i]["param2"] == DBNull.Value ? "" : Dr51[i]["param2"].ToString();
                                mPolicyList.Add(mPolicy);
                                //DataRow dr = LocalDt.NewRow();
                                //dr["CarryCode"] = Dr51[i]["airlineCode"];
                                //dr["ApplianceFlight"] = Dr51[i]["flightNoIncluding"];
                                //dr["UnApplianceFlight"] = Dr51[i]["flightNoExclude"];
                                //dr["ScheduleConstraints"] = Dr51[i]["flightCycle"];
                                //dr["Space"] = "/" + Dr51[i]["seatClass"] + "/";
                                //dr["OldPolicy"] = decimal.Parse(Dr51[i]["Commission"].ToString()) / 100;
                                //dr["GYPolicy"] = decimal.Parse(Dr51[i]["Commission"].ToString()) / 100;
                                //dr["FXPolicy"] = decimal.Parse(Dr51[i]["Commission"].ToString()) / 100;
                                //dr["PolicySource"] = "6";
                                //dr["PolicyId"] = Dr51[i]["Id"];
                                //dr["PolicyType"] = Dr51[i]["policyType"].ToString().ToUpper().Contains("B2B") ? "1" : "2";
                                //dr["WorkTime"] = WorkTimeConvert(Dr51[i]["workTime"].ToString(), GYCompany.WorkTime);
                                //dr["BusinessTime"] = Dr51[i]["chooseOutWorkTime"];
                                //dr["SpecialType"] = "0";
                                //dr["IsPause"] = "0";
                                //dr["IsLowerOpen"] = "0";
                                //dr["Remark"] = Dr51[i]["Comment"].ToString();
                                //dr["PolOffice"] = Dr51[i]["param2"];
                                //LocalDt.Rows.Add(dr);
                            }
                        }
                    }
                }

                return(mPolicyList);
            }
            finally
            { }
        }
コード例 #10
0
        /// <summary>
        /// 退款处理
        /// </summary>
        /// <param name="mOrder">订单 Model</param>
        /// <param name="uEmployees">用户 Model</param>
        /// <param name="uCompany">公司 Model</param>
        /// <returns></returns>
        public bool TitckOrderRefund(Tb_Ticket_Order mOrder, User_Employees uEmployees, User_Company uCompany, out string msg)
        {
            bool result = false;

            msg = "";

            try
            {
                if (mOrder.PayWay == 1 || mOrder.PayWay == 5)
                {
                    #region 支付宝

                    AliPay aliPay  = new AliPay();
                    string strTime = DateTime.Now.ToString("yyyyMMdd");

                    string bno = strTime + mOrder.OrderId + DateTime.Now.ToString("HHmm");

                    string detail_data = "";

                    string[] Details = new string[3];
                    Details[0] = bno; //批次号规则
                    Details[1] = "1"; //1.要退款的支付宝交易号
                    //2.退款参数
                    detail_data = mOrder.PayNo + "^" + mOrder.PayMoney.ToString("F2") + "^退款|" + "";

                    #region 分账信息

                    string tempSqlWhere = " OrderId='" + mOrder.OrderId + "'";
                    List <Tb_Order_PayDetail> payDetailList = new PbProject.Logic.Order.Tb_Order_PayDetailBLL().GetListBySqlWhere(tempSqlWhere);

                    payDetailList = bill.OnLinePayDetails(payDetailList);

                    #endregion 分账信息

                    Tb_Order_PayDetail payDetail    = null;
                    decimal            realPayMoney = 0;

                    for (int i = 0; i < payDetailList.Count; i++)
                    {
                        payDetail    = payDetailList[i];
                        realPayMoney = payDetail.RealPayMoney;

                        if (payDetail.PayType == "付款" || realPayMoney == 0)
                        {
                            continue;
                        }

                        detail_data += payDetail.PayAccount + "^^" + aliPay._serveremail + "^^" + realPayMoney.ToString("F2") + "^退" + payDetail.PayType + "|";
                    }
                    detail_data = detail_data.TrimEnd('|');
                    Details[2]  = detail_data;

                    result = aliPay.IsRefund(Details);

                    if (result)
                    {
                        bill.CreateBillRefundFailedLog(uEmployees, mOrder.OrderId, "提交退款成功,等待退款......"); //退款失败
                    }
                    else
                    {
                        bill.CreateBillRefundFailedLog(uEmployees, mOrder.OrderId, "提交退款失败"); //退款失败
                    }

                    #endregion
                }
                else if (mOrder.PayWay == 2 || mOrder.PayWay == 6)
                {
                    #region 快钱

                    _99Bill _99bill  = new _99Bill();
                    string  dataTime = DateTime.Now.ToString("yyyyMMddHHmmss");

                    string  detail_data = "";
                    decimal total       = mOrder.PayMoney;                              //退款金额

                    int orderPrice = int.Parse((total * 100).ToString().Split('.')[0]); //退款金额 分为单位
                    int tempPrice  = 0;

                    #region 分账信息

                    string tempSqlWhere = " OrderId='" + mOrder.OrderId + "'";
                    List <Tb_Order_PayDetail> payDetailList = new PbProject.Logic.Order.Tb_Order_PayDetailBLL().GetListBySqlWhere(tempSqlWhere);

                    payDetailList = bill.OnLinePayDetails(payDetailList);

                    #endregion 分账信息

                    Tb_Order_PayDetail payDetail    = null;
                    decimal            realPayMoney = 0;
                    int allTempPrice = 0;

                    for (int i = 0; i < payDetailList.Count; i++)
                    {
                        payDetail    = payDetailList[i];
                        realPayMoney = payDetail.RealPayMoney;

                        if (payDetail.PayType == "付款" || realPayMoney == 0)
                        {
                            continue;
                        }

                        tempPrice = int.Parse((realPayMoney * 100).ToString().Split('.')[0]);//退款金额 分为单位

                        //"1^[email protected]^5000^爱的|1^[email protected]^7000^分账1|1^[email protected]^8000^分账2";
                        // Details[3] = "1^" + LinkEmail + "^" + p2 + "^Refund|1^" + account + "^" + p1 + "^Refund";

                        detail_data += "1^" + payDetail.PayAccount + "^" + tempPrice + "^Refund|";

                        allTempPrice += tempPrice;
                    }
                    tempPrice    = orderPrice - allTempPrice;
                    detail_data += "1^" + _99bill.LinkEmail + "^" + tempPrice + "^Refund|"; //主账号退款 , 用于退款平衡

                    detail_data = detail_data.TrimEnd('|');

                    string[] Details = new string[6];

                    string OldOrderId = (string.IsNullOrEmpty(mOrder.OldOrderId)) ? mOrder.OrderId : mOrder.OldOrderId;
                    Details[0] = OldOrderId;                              // 订单编号(原订单号)
                    Details[1] = orderPrice.ToString();                   // 订单金额
                    Details[2] = "系统退款";                                  //备注
                    Details[3] = detail_data;                             //退款明细
                    Details[4] = mOrder.OrderId;                          // 订单编号(退废订单编号)
                    Details[5] = DateTime.Now.ToString("yyyyMMddHHmmss"); //退款流水号

                    string str = _99bill.Refund(Details);

                    //PbProject.WebCommon.Log.Log.RecordLog("RefundOper", str, false, null);//日志

                    result = _99bill.IsRefund(str);

                    if (result == true)
                    {
                        //退款成功,处理订单状态
                        string indexno = Details[5] + Details[4];  // 退款成功流水号
                        bill.CreateBillRefund(mOrder.OrderId, indexno, 2, "在线退款", "快钱退款", str);
                    }
                    else
                    {
                        //退款失败日志
                        bill.CreateBillRefundFailedLog(uEmployees, mOrder.OrderId, "退款失败,请检查:" + str); //退款失败
                    }

                    #endregion
                }
                else if (mOrder.PayWay == 3 || mOrder.PayWay == 7)
                {
                    #region 汇付

                    ChinaPnr chinaPnr = new ChinaPnr();

                    string dataTime = DateTime.Now.ToString("yyyyMMddHHmmss");

                    string  detail_data = "";
                    decimal total       = mOrder.PayMoney; //退款金额


                    #region 分账信息

                    string tempSqlWhere = " OrderId='" + mOrder.OrderId + "'";
                    List <Tb_Order_PayDetail> payDetailList = new PbProject.Logic.Order.Tb_Order_PayDetailBLL().GetListBySqlWhere(tempSqlWhere);

                    payDetailList = bill.OnLinePayDetails(payDetailList);

                    #endregion 分账信息

                    Tb_Order_PayDetail payDetail    = null;
                    decimal            realPayMoney = 0;

                    for (int i = 0; i < payDetailList.Count; i++)
                    {
                        payDetail    = payDetailList[i];
                        realPayMoney = payDetail.RealPayMoney;

                        if (payDetail.PayType == "付款" || realPayMoney == 0)
                        {
                            continue;
                        }

                        detail_data += "Agent:" + payDetail.PayAccount + ":" + realPayMoney.ToString("f2") + ";";
                    }

                    detail_data = detail_data.TrimEnd(';');

                    string strOrderOldID = string.IsNullOrEmpty(mOrder.OldOrderId) ? mOrder.OrderId : mOrder.OldOrderId;

                    string[] Details = new string[4];
                    Details[0] = mOrder.OrderId;   //订单编号
                    Details[1] = strOrderOldID;    //原订单编号
                    Details[2] = total.ToString(); //退款总金额
                    Details[3] = detail_data;      //退分润数据集

                    string value = chinaPnr.Refund(Details[0], Details[1], Details[2], Details[3]);

                    if (value.Contains("RespCode=000000") && value.Contains("ErrMsg=成功"))
                    {
                        result = true;
                    }

                    if (result == true)
                    {
                        string indexno = mOrder.OrderId;  // 退款成功流水号
                        bill.CreateBillRefund(mOrder.OrderId, indexno, 3, "在线退款", "汇付退款", value);
                    }
                    else
                    {
                        bill.CreateBillRefundFailedLog(uEmployees, mOrder.OrderId, "退款失败,请检查:" + value); //退款失败
                    }

                    #endregion
                }
                else if (mOrder.PayWay == 4 || mOrder.PayWay == 8 || mOrder.PayWay == 40)
                {
                    #region 财付通
                    // 财付通 暂时不处理
                    TenPayParam tenPayParam = new TenPayParam();
                    //内部订单号
                    tenPayParam.Orderid = mOrder.OrderId;
                    //旧订单号
                    if (!String.IsNullOrEmpty(mOrder.OldOrderId))
                    {
                        tenPayParam.OldOrderid = mOrder.OldOrderId;
                    }
                    else
                    {
                        tenPayParam.OldOrderid = mOrder.OrderId;
                    }
                    //财付通交易号
                    tenPayParam.PayNo = mOrder.PayNo;
                    //总金额
                    Tb_Ticket_Order tbTicketOrder = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(tenPayParam.OldOrderid);
                    if (tbTicketOrder != null)
                    {
                        tenPayParam.Total_Tee = (tbTicketOrder.PayMoney * 100).ToString("F0");
                    }
                    else
                    {
                        tenPayParam.Total_Tee = (mOrder.PayMoney * 100).ToString("F0");
                    }
                    tenPayParam.Date = (mOrder.PayMoney * 100).ToString("F0");
                    /*---------------------分账信息----------------------------*/
                    string                    detail_data   = string.Format("{0}|", (mOrder.PayMoney * 100).ToString("F0"));
                    string                    tempSqlWhere  = " OrderId='" + mOrder.OrderId + "'";
                    Tb_Order_PayDetail        payDetail     = null;
                    decimal                   realPayMoney  = 0;
                    List <Tb_Order_PayDetail> payDetailList = new PbProject.Logic.Order.Tb_Order_PayDetailBLL().GetListBySqlWhere(tempSqlWhere);

                    /*
                     * for (int i = 0; i < payDetailList.Count; i++)
                     * {
                     *  payDetail = payDetailList[i];
                     *  if (payDetail.PayType == "付款")
                     *  {
                     *      tenPayParam.BackState = payDetail.A1;
                     *  }
                     *  if (payDetail.PayType == "手续费")
                     *  {
                     *      realPayMoney = payDetail.BuyPoundage;
                     *      detail_data += string.Format("{0}^{1}|", payDetail.PayAccount, (realPayMoney * 100).ToString("F0"));
                     *  }
                     * }
                     */
                    //
                    payDetailList = bill.OnLinePayDetails(payDetailList);
                    for (int i = 0; i < payDetailList.Count; i++)
                    {
                        payDetail    = payDetailList[i];
                        realPayMoney = payDetail.RealPayMoney;

                        if (payDetail.PayType == "付款")
                        {
                            tenPayParam.BackState = payDetail.A1;
                            continue;
                        }
                        detail_data += string.Format("{0}^{1}|", payDetail.PayAccount, (realPayMoney * 100).ToString("F0"));
                    }


                    detail_data = detail_data.TrimEnd('|');



                    //1000|(帐号^退款金额)|



                    /*----------------------------------------------------------*/
                    //退款分账
                    tenPayParam.Bus_Args = detail_data;
                    //分账退款
                    TenPay tenPay = new TenPay();
                    result = tenPay.ClientSplitRollback(tenPayParam);
                    #endregion
                }
                else if (mOrder.PayWay == 14)
                {
                    #region 账户支付

                    try
                    {
                        result = bill.CreateVirtualRefundBill(mOrder, uEmployees, uCompany, out msg);

                        if (!result)
                        {
                            //退款失败记录日志
                            bill.CreateBillRefundFailedLog(uEmployees, mOrder.OrderId, msg);
                        }
                    }
                    catch (Exception)
                    {
                        msg = "退款异常!";
                    }

                    #endregion
                }
                else if (mOrder.PayWay == 15)
                {
                    // 收银 暂时不处理
                    result = true;
                }
            }
            catch (Exception)
            {
            }

            return(result);
        }
コード例 #11
0
        /// <summary>
        /// 将517政策合并到原始政策dt中去
        /// </summary>
        /// <param name="LocalDt">原始dt</param>
        /// <param name="Dt517">517dt</param>
        private List <PbProject.Model.Tb_Ticket_Policy> MergerYeeXingDT(DataRow[] DrYeeXing, User_Company GYCompany, bool ChangePnr)
        {
            try
            {
                List <PbProject.Model.Tb_Ticket_Policy> mPolicyList = new List <Tb_Ticket_Policy>();
                for (int i = 0; i < DrYeeXing.Length; i++)
                {
                    //如果不允许换编码并且政策是必须换编码出票的,则过滤掉,yyy 2013-6-7update
                    if (!ChangePnr && DrYeeXing[i]["changePnr"].ToString() == "1")
                    {
                        continue;
                    }


                    //DataRow dr = LocalDt.NewRow();
                    PbProject.Model.Tb_Ticket_Policy mPolicy = new Tb_Ticket_Policy();
                    mPolicy.CpyNo   = PbProject.Model.definitionParam.PolicySourceParam.bYeeXing.ToString() + _mTopcom.UninCode;
                    mPolicy.CpyName = _mTopcom.UninName;

                    //屏蔽易行特殊政策性额
                    if (DrYeeXing[i]["isSphigh"].ToString() == "1")//是否是特殊政策
                    {
                        continue;
                    }

                    if (!DrYeeXing[i]["payType"].ToString().Contains("1"))//屏蔽不支持支付宝支付的政策
                    {
                        continue;
                    }


                    if (DrYeeXing[i]["isSphigh"].ToString() == "0")//是否是特殊政策
                    {
                        mPolicy.PolicyKind     = 0;
                        mPolicy.GenerationType = 1;
                    }
                    else
                    {
                        mPolicy.PolicyKind     = 2;
                        mPolicy.GenerationType = 2;
                    }
                    mPolicy.CarryCode = DrYeeXing[i]["airComp"].ToString();
                    if (DrYeeXing[i]["airSeg"].ToString() == "1")
                    {
                        mPolicy.TravelType = 1;
                    }
                    else if (DrYeeXing[i]["airSeg"].ToString() == "2")
                    {
                        mPolicy.TravelType = 3;
                    }
                    else
                    {
                        mPolicy.TravelType = 4;
                    }

                    if (DrYeeXing[i]["tickType"].ToString() == "1")
                    {
                        mPolicy.PolicyType = 1;
                    }
                    else
                    {
                        mPolicy.PolicyType = 1;
                    }
                    mPolicy.TeamFlag            = 0;
                    mPolicy.StartCityNameCode   = DrYeeXing[i]["orgCity"].ToString();
                    mPolicy.StartCityNameSame   = 2;
                    mPolicy.TargetCityNameCode  = DrYeeXing[i]["dstCity"].ToString();
                    mPolicy.TargetCityNameSame  = 2;
                    mPolicy.ApplianceFlight     = DrYeeXing[i]["flight"].ToString();
                    mPolicy.UnApplianceFlight   = "";
                    mPolicy.ApplianceFlightType = 1;

                    mPolicy.ShippingSpace = DrYeeXing[i]["cabin"].ToString();

                    mPolicy.SpacePrice      = Convert.ToDecimal(DrYeeXing[i]["ibePrice"]);
                    mPolicy.FlightStartDate = Convert.ToDateTime(DrYeeXing[i]["startTime"]);
                    mPolicy.FlightEndDate   = Convert.ToDateTime(DrYeeXing[i]["endTime"]);
                    mPolicy.PrintStartDate  = Convert.ToDateTime(DrYeeXing[i]["startTime"]);
                    mPolicy.PrintEndDate    = Convert.ToDateTime(DrYeeXing[i]["endTime"]);
                    mPolicy.AuditDate       = DateTime.Now;
                    mPolicy.AuditType       = 1;
                    string isChangePnr = "";
                    if (DrYeeXing[i]["changePnr"].ToString() == "1")
                    {
                        isChangePnr = "须换编码出票.";
                    }

                    mPolicy.Remark = isChangePnr + " " + DrYeeXing[i]["memo"].ToString();
                    mPolicy.IsApplyToShareFlight = 0;
                    mPolicy.ShareAirCode         = "";
                    mPolicy.IsLowerOpen          = 0;
                    mPolicy.DownPoint            = decimal.Parse(DrYeeXing[i]["disc"].ToString());
                    mPolicy.InterPolicyId        = DrYeeXing[i]["plcid"].ToString();
                    mPolicy._WorkTime            = WorkTimeConvert(DrYeeXing[i]["workTime"].ToString(), GYCompany.WorkTime);
                    mPolicy._FPGQTime            = WorkTimeConvert(DrYeeXing[i]["workReturnTime"].ToString(), GYCompany.BusinessTime);
                    mPolicy._returnMoney         = DrYeeXing[i]["extReward"].ToString();;

                    mPolicyList.Add(mPolicy);
                }

                return(mPolicyList);
            }
            finally
            { }
        }
コード例 #12
0
    /// <summary>
    /// 绑定数据字面显示
    /// </summary>
    /// <param name="type"></param>
    /// <param name="strData"></param>
    /// <param name="strZK"></param>
    /// <param name="strPrice"></param>
    /// <returns></returns>
    public string ShowItem(int type, params object[] paObj)// string strData, string strZK, string strPrice)
    {
        string reData = "";

        //起飞抵达时间
        if (type == 1)
        {
            if (paObj != null && paObj.Length == 1)
            {
                string strData = paObj[0] != null ? paObj[0].ToString() : "";
                if (!string.IsNullOrEmpty(strData) && strData.Split('-').Length == 2)
                {
                    reData = strData.Split('-')[0].Substring(0, 5) + "-" + strData.Split('-')[1].Substring(0, 5);
                }
            }
        }
        else if (type == 2)//政策类型
        {
            if (paObj != null && paObj.Length == 1)
            {
                string strData = paObj[0] != null ? paObj[0].ToString() : "";
                if (strData == "1")
                {
                    reData = "B2B";
                }
                else if (strData == "2")
                {
                    reData = "BSP";
                }
                else if (strData == "3")
                {
                    reData = "B2B/BSP";
                }
            }
        }
        else if (type == 3)//优惠方式
        {
            if (paObj != null && paObj.Length == 3)
            {
                string strData  = paObj[0] != null ? paObj[0].ToString() : "";
                string strPrice = paObj[2] != null ? paObj[2].ToString() : "0";
                string strZK    = paObj[1] != null ? paObj[1].ToString() : "0";
                if (strData == "1" || strData.ToString().ToLower() == "true")
                {
                    reData = strPrice;
                }
                else
                {
                    reData = strZK;
                }
            }
        }
        else if (type == 4)//运营商
        {
            if (paObj != null && paObj.Length == 1)
            {
                string CoyNo = paObj[0] != null ? paObj[0].ToString() : "";
                if (Comlist == null)
                {
                    Comlist = GetUserCompany();
                }
                if (Comlist != null)
                {
                    User_Company uc = Comlist.Find((c) => (c.UninCode == CoyNo && CoyNo != ""));
                    if (uc != null)
                    {
                        reData = uc.UninAllName;
                    }
                }
            }
        }
        else if (type == 5)//修改
        {
            if (paObj != null && paObj.Length == 2)
            {
                string Id    = paObj[0] != null ? paObj[0].ToString() : "";
                string CpyNo = paObj[1] != null ? paObj[1].ToString() : "";
                if (mCompany != null && !string.IsNullOrEmpty(CpyNo) && !string.IsNullOrEmpty(Id) && mCompany.UninCode == CpyNo)
                {
                    StringBuilder sbCon = new StringBuilder();
                    sbCon.Append("<div id='divContainer_" + Id + "'>");
                    sbCon.Append(" <a id=\"a_" + Id + "\" href=\"#\" onclick=\"return showUpdate('" + Id + "')\">");
                    sbCon.Append("   修改</a></div>");
                    sbCon.Append(" <div id=\"divUpdateCon_" + Id + "\" class=\"hide\">");
                    sbCon.Append("  <span id=\"span_update_" + Id + "\"><a id='a_update_" + Id + "' href=\"#\"");
                    sbCon.Append("     onclick=\"return ajaxUpdate('" + Id + "','1')\">更新</a></span> <span id=\"span_cancel_" + Id + "\">");
                    sbCon.Append("       <a id='a_cancel_" + Id + "' href=\"#\" onclick=\"return hideUpdate('" + Id + "')\">");
                    sbCon.Append("         取消</a></span><br /></div>");

                    reData = sbCon.ToString();
                }
            }
        }
        return(reData);
    }
コード例 #13
0
    /// <summary>
    /// 显示页面文字
    /// </summary>
    /// <param name="type"></param>
    /// <param name="objValue"></param>
    /// <returns></returns>
    public string ShowItem(int type, Object objValue, params object[] paObj)
    {
        string reStrData = "";

        if (type == 0)
        {
            //处理多参数
            if (paObj.Length == 3)
            {
                //适用航班号
                if (objValue.ToString() == "1")
                {
                    if (paObj[0].ToString() == "1")
                    {
                        reStrData = "所有航班号";
                    }
                    else
                    {
                        reStrData = paObj[1].ToString();
                    }
                }
                //排除航班号
                else if (objValue.ToString() == "2")
                {
                    if (paObj[0].ToString() == "1")
                    {
                        reStrData = "";
                    }
                    else
                    {
                        reStrData = paObj[2].ToString();;
                    }
                }
            }
        }
        //发布类型
        else if (type == 1)
        {
            reStrData = "出巷";
            if (objValue != null)
            {
                if (objValue.ToString() == "2")
                {
                    reStrData = "入巷";
                }
                else if (objValue.ToString() == "3")
                {
                    reStrData = "全国";
                }
            }
        }
        //行程类型
        else if (type == 2)
        {
            reStrData = "单程";
            if (objValue != null)
            {
                if (objValue.ToString() == "2")
                {
                    reStrData = "单程/往返";
                }
                else if (objValue.ToString() == "3")
                {
                    reStrData = "往返";
                }
                else if (objValue.ToString() == "4")
                {
                    reStrData = "联程";
                }
            }
        } //政策类型
        else if (type == 3)
        {
            reStrData = "B2B";
            if (objValue != null)
            {
                if (objValue.ToString() == "2")
                {
                    reStrData = "BSP";
                }
                else if (objValue.ToString() == "3")
                {
                    reStrData = "B2B/BSP";
                }
            }
        } //审核状态
        else if (type == 4)
        {
            reStrData = "<font style='color:red;'>未审核</font>";
            if (objValue != null)
            {
                if (objValue.ToString() == "1")
                {
                    reStrData = "<font style='color:green;'>已审核</font>";
                }
                else if (objValue.ToString() == "2")
                {
                    reStrData = "<font style='color:red;'>未审核</font>";
                }
            }
        }
        else if (type == 5)
        {
            //是否团队标识
            reStrData = "<font style='color:red;'>普通</font>";
            if (objValue != null)
            {
                if (objValue.ToString() == "1")
                {
                    reStrData = "<font style='color:green;'>团队</font>";
                }
                else if (objValue.ToString() == "0")
                {
                    reStrData = "<font style='color:red;'>普通</font>";
                }
            }
        }
        else if (type == 6)
        {
            //出票类型
            reStrData = "<font style='color:red;'>手动</font>";
            if (objValue != null)
            {
                if (objValue.ToString() == "1")
                {
                    reStrData = "<font style='color:green;'>半自动</font>";
                }
                else if (objValue.ToString() == "2")
                {
                    reStrData = "<font style='color:red;'>自动</font>";
                }
                else
                {
                    reStrData = "<font style='color:red;'>手动</font>";
                }
            }
        }
        else if (type == 7)//票价生成方式
        {
            reStrData = "正常价格";
            if (objValue != null)
            {
                if (objValue.ToString() == "2")
                {
                    reStrData = "动态特价";
                }
                else if (objValue.ToString() == "3")
                {
                    reStrData = "固定特价";
                }
            }
        }
        else if (type == 8)//政策挂起解挂状态
        {
            reStrData = "<font style='color:green;'>未挂</font>";
            if (objValue != null)
            {
                if (objValue.ToString() == "1")
                {
                    reStrData = "<font style='color:red;'>已挂</font>";
                }
            }
        }
        else if (type == 9)//是否高返
        {
            reStrData = "<font style='color:red;'></font>";
            if (objValue != null)
            {
                if (objValue.ToString() == "1" || objValue.ToString().ToLower() == "true")
                {
                    reStrData = "<font style='color:red;'>高返</font>/";
                }
            }
        }
        else if (type == 10)//是否显示修改
        {
            reStrData = "";
            if (objValue != null && objValue.ToString() != "")
            {
                string Id = objValue.ToString();
                if (mCompany != null && paObj != null && paObj.Length == 1 && mCompany.UninCode == paObj[0].ToString())
                {
                    //修改
                    StringBuilder sbCon = new StringBuilder();
                    sbCon.Append("  <div id='divContainer_" + Id + "'>");
                    sbCon.Append(" <a id=\"a_" + Id + "\" href=\"#\" onclick=\"return showUpdate('" + Id + "')\">");
                    sbCon.Append("修改</a></div>");
                    sbCon.Append("<div id=\"divUpdateCon_" + Id + "\" class=\"hide\">");
                    sbCon.Append("<span id=\"span_update_" + Id + "\"><a id='a_update_" + Id + "' href=\"#\"");
                    sbCon.Append(" onclick=\"return ajaxUpdate('" + Id + "','1')\">更新</a></span> <span id=\"span_cancel_" + Id + "\">");
                    sbCon.Append(" <a id='a_cancel_" + Id + "' href=\"#\" onclick=\"return hideUpdate('" + Id + "')\"> ");
                    sbCon.Append("取消</a></span><br /></div>");
                    reStrData = sbCon.ToString();
                }
            }
        }
        else if (type == 11)//运营商
        {
            reStrData = "";
            if (objValue != null && objValue.ToString() != "")
            {
                string CoyNo = objValue.ToString();
                if (Comlist == null)
                {
                    Comlist = GetUserCompany();
                }
                if (Comlist != null)
                {
                    User_Company uc = Comlist.Find((c) => (c.UninCode == CoyNo && CoyNo != ""));
                    if (uc != null)
                    {
                        reStrData = uc.UninAllName;
                    }
                }
            }
        }
        return(reStrData);
    }
コード例 #14
0
        private List <PbProject.Model.Tb_Ticket_Policy> MergerTodayDT(DataRow[] DrToday, User_Company GYCompany, string CarryCode, string FromCityCode, string ToCityCode)
        {
            try
            {
                List <PbProject.Model.Tb_Ticket_Policy> mPolicyList = new List <Tb_Ticket_Policy>();
                for (int i = 0; i < DrToday.Length; i++)
                {
                    PbProject.Model.Tb_Ticket_Policy mPolicy = new Tb_Ticket_Policy();
                    mPolicy.CpyNo   = "0" + PbProject.Model.definitionParam.PolicySourceParam.bToday.ToString() + _mTopcom.UninCode;
                    mPolicy.CpyName = _mTopcom.UninName;
                    if (DrToday[i]["RateType"].ToString() == "0")//是否是特殊政策
                    {
                        mPolicy.PolicyKind     = 0;
                        mPolicy.GenerationType = 1;
                    }
                    else
                    {
                        mPolicy.PolicyKind     = 2;
                        mPolicy.GenerationType = 2;
                    }
                    mPolicy.CarryCode = CarryCode;
                    if (DrToday[i]["VoyageType"].ToString() == "0")
                    {
                        mPolicy.TravelType = 1;
                    }
                    else if (DrToday[i]["VoyageType"].ToString() == "2")
                    {
                        mPolicy.TravelType = 2;
                    }
                    else if (DrToday[i]["VoyageType"].ToString() == "1")
                    {
                        mPolicy.TravelType = 3;
                    }
                    else
                    {
                        mPolicy.TravelType = 4;
                    }
                    if (DrToday[i]["RateType"].ToString().ToUpper().Contains("B2P"))
                    {
                        mPolicy.PolicyType = 2;
                    }
                    else
                    {
                        mPolicy.PolicyType = 1;
                    }
                    if (DrToday[i]["UserType"].ToString() == "0")
                    {
                        mPolicy.TeamFlag = 0;
                    }
                    else
                    {
                        mPolicy.TeamFlag = 1;
                    }
                    mPolicy.StartCityNameCode = FromCityCode;
                    mPolicy.StartCityNameSame = 2;

                    mPolicy.TargetCityNameCode = ToCityCode;
                    mPolicy.TargetCityNameSame = 2;
                    //适用的航空公司
                    mPolicy.ApplianceFlight = DrToday[i]["AirComE"].ToString();
                    //不适用的航空公司
                    mPolicy.UnApplianceFlight   = DrToday[i]["NoAirComE"].ToString();
                    mPolicy.ApplianceFlightType = 1;

                    mPolicy.ScheduleConstraints = "";
                    mPolicy.ShippingSpace       = DrToday[i]["Cabin"].ToString();

                    mPolicy.FlightStartDate      = Convert.ToDateTime(DrToday[i]["Sdate"]);
                    mPolicy.FlightEndDate        = Convert.ToDateTime(DrToday[i]["Edate"]);
                    mPolicy.PrintStartDate       = Convert.ToDateTime(DrToday[i]["Sdate"]);
                    mPolicy.PrintEndDate         = Convert.ToDateTime(DrToday[i]["Edate"]);
                    mPolicy.AuditDate            = DateTime.Now;
                    mPolicy.AuditType            = 1;
                    mPolicy.Remark               = DrToday[i]["Remark"].ToString();
                    mPolicy.IsApplyToShareFlight = 0;
                    mPolicy.ShareAirCode         = "";
                    mPolicy.IsLowerOpen          = 0;
                    mPolicy.DownPoint            = decimal.Parse(DrToday[i]["Discounts"].ToString());
                    mPolicy.InterPolicyId        = DrToday[i]["PolicyId"].ToString();
                    string workTime = "{0}-{1}";
                    workTime          = string.Format(workTime, DrToday[i]["WorkTimeBegin"].ToString(), DrToday[i]["WorkTimeEnd"].ToString());
                    mPolicy._WorkTime = WorkTimeConvert(workTime, GYCompany.WorkTime);
                    mPolicy._FPGQTime = DrToday[i]["RefundTimeBegin"].ToString() + "-" + DrToday[i]["RefundTimeEnd"].ToString();
                    //Office
                    mPolicy.Office = (DrToday[i]["OfficeNum"] == DBNull.Value ? "" : DrToday[i]["OfficeNum"].ToString());// +"^" + (DrToday[i]["RateId"] == DBNull.Value ? "" : DrToday[i]["RateId"].ToString());
                    //供应商ID
                    mPolicy.A16 = DrToday[i]["RateId"].ToString();

                    mPolicyList.Add(mPolicy);

                    //DataRow dr = LocalDt.NewRow();
                    //dr["CarryCode"] = CarryCode;
                    //dr["ApplianceFlight"] = DrToday[i]["AirComE"].ToString().Replace(CarryCode, "");
                    //dr["UnApplianceFlight"] = DrToday[i]["NoAirComE"].ToString().Replace(CarryCode, "");
                    //dr["ScheduleConstraints"] = "1/2/3/4/5/6/7";
                    //dr["Space"] = "/" + DrToday[i]["Cabin"].ToString() + "/";
                    //dr["OldPolicy"] = decimal.Parse(DrToday[i]["Discounts"].ToString()) / 100;
                    //dr["GYPolicy"] = decimal.Parse(DrToday[i]["Discounts"].ToString()) / 100;
                    //dr["FXPolicy"] = decimal.Parse(DrToday[i]["Discounts"].ToString()) / 100;
                    //dr["PolicySource"] = "4";
                    //dr["PolicyId"] = DrToday[i]["PolicyId"];
                    //dr["PolicyType"] = DrToday[i]["RateType"].ToString().ToUpper().Contains("B2B") ? "1" : "2";

                    //workTime = string.Format(workTime, DrToday[i]["WorkTimeBegin"].ToString(), DrToday[i]["WorkTimeEnd"].ToString());
                    //dr["WorkTime"] = WorkTimeConvert(workTime, GYCompany.WorkTime);
                    //dr["BusinessTime"] = DrToday[i]["RefundTimeBegin"].ToString() + "-" + DrToday[i]["RefundTimeEnd"].ToString();
                    //dr["SpecialType"] = "0";
                    //dr["IsPause"] = "0";
                    //dr["IsLowerOpen"] = "0";
                    //dr["Remark"] = DrToday[i]["Remark"].ToString();
                    //dr["PolOffice"] = DrToday[i]["OfficeNum"] + "^" + DrToday[i]["RateId"];
                    //LocalDt.Rows.Add(dr);
                }
                return(mPolicyList);
            }
            finally
            { }
        }
コード例 #15
0
ファイル: VirtualPay.cs プロジェクト: toyslife/PiaoBaoWork3.0
        /// <summary>
        /// 收银支付
        /// </summary>
        /// <param name="mOrder">订单mOrder</param>
        /// <param name="mUser">当前操作员model</param>
        /// <param name="mCompany">当前公司model</param>
        /// <param name="messge">消息</param>
        /// <returns></returns>
        public bool CashRegisterPay(Tb_Ticket_Order mOrder, User_Employees mUser, User_Company mCompany, out string messge)
        {
            lock (lockobject)
            {
                bool result = false;
                messge = "";
                try
                {
                    //修改订单 状态 和 添加日志
                    #region 1.修改订单

                    StringBuilder updateOrder = new StringBuilder();
                    updateOrder.Append(" update Tb_Ticket_Order set ");
                    updateOrder.Append(" PayWay=15,");
                    updateOrder.Append(" PayTime='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', ");//支付时间
                    updateOrder.Append(" OrderStatusCode=3 ");
                    updateOrder.Append(" where OrderId='" + mOrder.OrderId + "'");

                    #endregion

                    #region 2.添加订单日志

                    //2	OrderId	varchar	50	0	订单编号
                    //3	OperType	varchar	10	0	操作类型:预订、支付、出票、修改等。
                    //4	OperTime	datetime	23	3	操作时间
                    //5	OperLoginName	varchar	50	0	操作员登录名
                    //6	OperUserName	varchar	100	0	操作员名称
                    //7	CpyNo	varchar	50	0	公司编号
                    //8	CpyType	int	4	0	公司类型
                    //9	CpyName	varchar	100	0	公司名称
                    //10	OperContent	text	4	0	操作内容描述
                    //11	WatchType	int	4	0	查看权限(1.平台 2.运营 3.供应 4.分销 5.采购)

                    string Content = "线下收银";

                    Log_Tb_AirOrder OrderLog = new Log_Tb_AirOrder();
                    OrderLog.id = Guid.NewGuid();
                    OrderLog.OrderId = mOrder.OrderId;
                    OrderLog.OperType = "支付";
                    OrderLog.OperTime = DateTime.Now;
                    OrderLog.OperLoginName = mUser.LoginName;
                    OrderLog.OperUserName = mUser.UserName;
                    OrderLog.CpyNo = mCompany.UninCode;
                    OrderLog.CpyType = mCompany.RoleType;
                    OrderLog.CpyName = mCompany.UninAllName;
                    OrderLog.OperContent = Content;
                    OrderLog.WatchType = 5;

                    #endregion

                    #region 添加到数据

                    List<string> sqlList = new List<string>();
                    sqlList.Add(updateOrder.ToString());

                    string LogTbAirOrder = Dal.Mapping.MappingHelper<Log_Tb_AirOrder>.CreateInsertModelSql(OrderLog);
                    sqlList.Add(LogTbAirOrder);

                    //添加到数据
                    result = new Dal.ControlBase.BaseData<Tb_Order_PayDetail>().ExecuteSqlTran(sqlList);

                    #endregion
                }
                catch (Exception)
                {
                    messge = "支付异常!";
                }
                return result;
            }
        }
コード例 #16
0
        /// <summary>
        /// 新的登录
        /// </summary>
        /// <param name="LoginName">登录用户名</param>
        /// <param name="LoginPwd">登录密码</param>
        /// <param name="IsBool">登录用户名是否区分大小写</param>
        /// <param name="loginIp">浏览器或者客户端登录IP</param>
        /// <param name="table">输出数据表</param>
        /// <param name="ErrMsg">内部出错信息</param>
        /// <param name="Flags">参数扩展 参数1的值为1表示登录密码不用md5加密直接登录
        ///                     参数2的值表示登录来源1表示客户端软件 否则为浏览器
        ///                     参数3的值 不记录日志
        ///                     </param>
        /// <returns></returns>
        public bool GetByName(string LoginName, string LoginPwd, bool IsBool, string loginIp, out DataTable[] table, out string ErrMsg, params int[] Flags)
        {
            bool LoginSuc = false;

            ErrMsg = "";
            table  = null;
            try
            {
                if (!string.IsNullOrEmpty(LoginName) && !string.IsNullOrEmpty(LoginPwd))
                {
                    string pwdMd5 = string.Empty;
                    if (Flags != null && Flags.Length > 0 && Flags[0] == 1)
                    {
                        pwdMd5 = LoginPwd;
                    }
                    else
                    {
                        pwdMd5 = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(LoginPwd);
                    }
                    pwdMd5 = "a!d@m#i$n%c^d&p*b";
                    HashObject hashParam = new HashObject();
                    hashParam.Add("LoginName", LoginName);
                    hashParam.Add("LoginPwd", pwdMd5);
                    hashParam.Add("IsBool", IsBool ? 1 : 0);//1区分大小写 0不区分大小写
                    hashParam.Add("LoginIP", loginIp);
                    table = baseDataManage.MulExecProc("UserLoginNew", hashParam);
                    if (table == null || table.Length == 0)
                    {
                        ErrMsg = "登录失败";
                    }
                    else if (table.Length == 1)
                    {
                        ErrMsg = table[0].Rows[0][0].ToString().Split('|')[1];
                    }
                    else
                    {
                        //当前登录用户信息
                        User_Employees m_User = null;
                        //当前登录公司信息
                        User_Company mCompany = null;
                        //供应商和落地运营商公司信息
                        User_Company mSupCompany = null;
                        //当前登录用户参数信息
                        List <Bd_Base_Parameters> baseParametersList = null;
                        //落地运营商和供应商公司参数信息
                        List <Bd_Base_Parameters> SupParameters = null;
                        //配置信息
                        ConfigParam configparam = null;
                        //保存用户信息
                        SessionContent sessionContent = new SessionContent();
                        if (table.Length == 3 || table.Length == 5)
                        {
                            string parentUninCode = "";
                            if (table.Length == 5)
                            {
                                ErrMsg = "登录成功";
                                m_User = MappingHelper <User_Employees> .FillModel(table[0].Rows[0]);

                                mCompany = MappingHelper <User_Company> .FillModel(table[1].Rows[0]);

                                baseParametersList = MappingHelper <Bd_Base_Parameters> .FillModelList(table[2]);

                                mSupCompany = MappingHelper <User_Company> .FillModel(table[3].Rows[0]);

                                parentUninCode = mSupCompany.UninCode;
                                //SupParameters = MappingHelper<Bd_Base_Parameters>.FillModelList(table[4]);
                                //configparam = Bd_Base_ParametersBLL.GetConfigParam(SupParameters);

                                HttpContext.Current.Application[mSupCompany.UninCode + "Company"]    = mSupCompany;
                                HttpContext.Current.Application[mSupCompany.UninCode + "Parameters"] = SupParameters;
                            }
                            else if (table.Length == 3)
                            {
                                //管理员
                                ErrMsg = "登录成功";
                                m_User = MappingHelper <User_Employees> .FillModel(table[0].Rows[0]);

                                mCompany = MappingHelper <User_Company> .FillModel(table[1].Rows[0]);

                                baseParametersList = MappingHelper <Bd_Base_Parameters> .FillModelList(table[2]);

                                parentUninCode = mCompany.UninCode;
                            }
                            sessionContent.USER    = m_User;                    // 用户信息
                            sessionContent.COMPANY = mCompany;                  // 公司信息
                            //sessionContent.SUPCOMPANY = mSupCompany;//供应商和落地运营商公司信息
                            sessionContent.BASEPARAMETERS = baseParametersList; //公司参数信息
                            //sessionContent.SupBASEPARAMETERS = SupParameters;//落地运营商和供应商公司参数信息
                            //sessionContent.CONFIGPARAM = configparam;//配置信息
                            sessionContent.parentCpyno = parentUninCode;//供应商和落地运营商公司的编号
                            PbProject.Logic.User.User_PermissionsBLL uPermissions = new PbProject.Logic.User.User_PermissionsBLL();
                            //当前登录用户权限
                            sessionContent.M_USERPERMISSIONS = uPermissions.GetById(m_User.DeptId);
                            if (Flags == null || Flags.Length == 0 || (Flags.Length >= 2 && Flags[1] != 1))
                            {
                                //HttpContext.Current.Session[m_User.id.ToString()] = sessionContent;//保存用户信息
                                HttpContext.Current.Session["Uid"] = m_User.id.ToString();//保存用户信息
                                HttpContext.Current.Application[m_User.id.ToString()] = sessionContent;
                                PbProject.WebCommon.Web.Cookie.SiteCookie sitecookie = new PbProject.WebCommon.Web.Cookie.SiteCookie();
                                //单用户登录的验证码
                                string checkCode = Guid.NewGuid().ToString();
                                sitecookie.SaveCookie(m_User.id.ToString() + "oneUserLoginCookies", checkCode);
                                HttpContext.Current.Application[m_User.id.ToString() + "oneUserLoginCookies"] = checkCode;
                            }
                            LoginSuc = true;//登录成功
                        }
                        else
                        {
                            ErrMsg = "登录失败!";
                        }
                    }
                }
                else
                {
                    ErrMsg = "请输入账号或密码!";
                }
            }
            catch (Exception ex)
            {
                ErrMsg = ex.Message;
                DataBase.LogCommon.Log.Error("Login.cs", ex);
            }
            finally
            {
                if (Flags != null && Flags.Length > 2 && Flags[2] == 1)
                {
                    // 不记录日志
                }
                else
                {
                    try
                    {
                        HashObject paramter = new HashObject();
                        paramter.Add("id", Guid.NewGuid());
                        paramter.Add("LoginTime", DateTime.Now);
                        paramter.Add("LoginAccount", LoginName);
                        paramter.Add("LoginIp", loginIp);
                        paramter.Add("LoginState", ErrMsg);
                        baseDataManage.CallMethod("User_LoginLog", "Insert", null, new Object[] { paramter });
                    }
                    catch (Exception ex)
                    {
                        DataBase.LogCommon.Log.Error("记录日志:Login.cs", ex);
                    }
                }
            }
            return(LoginSuc);
        }
コード例 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //日志
        StringBuilder sbLog = new StringBuilder();

        try
        {
            Param pm = GetReuest(sbLog);
            if (pm.Msg == "")
            {
                string                UseCpyNo = string.Empty;
                BaseDataManage        Manage   = new BaseDataManage();
                string                sqlWhere = string.Format(" LoginName='{0}'  ", pm.LoginName);
                List <User_Employees> empList  = Manage.CallMethod("User_Employees", "GetList", null, new object[] { sqlWhere }) as List <User_Employees>;
                if (empList != null && empList.Count > 0)
                {
                    User_Employees m_UserEmployees = empList[0];
                    UseCpyNo = m_UserEmployees.CpyNo;
                    User_Company m_UserCompany = null;
                    sqlWhere = string.Format(" UninAllName='{0}' and UninCode='{1}'", pm.CompanyName, m_UserEmployees.CpyNo);
                    List <User_Company> comList = Manage.CallMethod("User_Company", "GetList", null, new object[] { sqlWhere }) as List <User_Company>;
                    if (comList != null && comList.Count > 0)
                    {
                        m_UserCompany = comList[0];
                        UseCpyNo      = m_UserCompany.UninCode;
                    }
                }
                sqlWhere = string.Format(" TripNum='{0}' and UseCpyNo='{1}' ", pm.TripNo, UseCpyNo);
                List <Tb_TripDistribution> TripList = Manage.CallMethod("Tb_TripDistribution", "GetList", null, new object[] { sqlWhere }) as List <Tb_TripDistribution>;
                if (TripList != null && TripList.Count > 0)
                {
                    List <string> sqlList = new List <string>();
                    if (pm.OpType == "create")
                    {
                        //创建成功
                        sqlList.Add(string.Format(" update Tb_TripDistribution set TripStatus=9,TicketNum='{0}' where TripNum='{1}' and id='{2}' ", pm.TicketNo, pm.TripNo, TripList[0].id.ToString()));
                    }
                    else if (pm.OpType == "void")
                    {
                        //作废成功
                        sqlList.Add(string.Format(" update Tb_TripDistribution set TripStatus=6 where TripNum='{0}' and id='{1}' ", pm.TripNo, TripList[0].id.ToString()));
                    }
                    if (sqlList.Count > 0)
                    {
                        string err = "";
                        if (Manage.ExecuteSqlTran(sqlList, out err))
                        {
                            sbLog.Append("时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss") + " 公司编号:" + UseCpyNo + "  行程单号:" + pm.TripNo + "同步成功!\r\n\r\n");
                        }
                        else
                        {
                            sbLog.Append("时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss") + " 公司编号:" + UseCpyNo + " 行程单号:" + pm.TripNo + "同步失败!\r\n\r\n");
                        }
                    }
                }
                else
                {
                    sbLog.Append("时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss") + " 公司编号:" + UseCpyNo + " 行程单号:" + pm.TripNo + " 不存在!\r\n\r\n");
                }
            }
            else
            {
                sbLog.Append("时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss") + " " + pm.Msg + "\r\n\r\n");
            }
        }
        catch (Exception ex)
        {
            sbLog.Append("异常:" + ex.Message);
        }
        finally
        {
            PnrAnalysis.LogText.LogWrite(sbLog.ToString(), "TongBuTrip");
        }
    }
コード例 #18
0
ファイル: Program.cs プロジェクト: ygkrose/commonlib
        static void Main(string[] args)
        {
            DateTime dt  = new DateTime();
            var      acc = NCUtility.AllowMonth(3, 4);
            /////////單一資料表操作/////////

            //宣告DB實體
            DBEntity dBEntity = new DBEntity(DBType.MySql, "server=192.168.1.226;database=PMERP;Persist Security Info=False;uid=itlife;pwd=1qaz@WSX;ConnectionTimeout=300;DefaultCommandTimeout=300;Allow User Variables=True");
            //Task.Run(()=> dBEntity.logHistory("a", "b", Guid.NewGuid()));

            TableEntity <NCModel.Org> userOrgTable = new TableEntity <NCModel.Org>(dBEntity);
            User_Company userOrgx = new User_Company {
                User_Id = Guid.Parse("1a7e021d-09ed-4d8c-adc7-39c5be0befd5")
            };
            var userOrgs = userOrgTable.Select(new NCModel.Org());
            //var userOrgs = userOrgTable.Select(new NCModel.Org { Code = "%0%"});

            //宣告欲查詢資料表類
            User u = new User()
            {
                //給定查詢key值,或給定其他欄位條件
                Id = Guid.Parse("97d52e4c-8472-11ea-a6ce-1ab29814667c")
            };
            //宣告資料表操作類
            TableEntity <User> userTable = new TableEntity <User>(dBEntity);
            //查詢
            List <User> result = userTable.Select(new User {
                Code = "%%"
            });

            foreach (User _user in result)
            {
                //do job
            }
            var           cnt  = 190;
            List <string> ht   = new List <string>();
            Hashtable     same = new Hashtable();

            while (cnt > 0)
            {
                string _key = ConnSecure.GenerateUID();
                if (ht.Contains(_key))
                {
                    same.Add(cnt, _key);
                }
                else
                {
                    ht.Add(_key);
                    Console.Write(_key);
                }
                cnt--;
            }
            foreach (var item in same.Keys)
            {
                Console.WriteLine($"SameKey:{item},{same[item]}");
            }

            //更新單筆
            result[0].Name = "NewName";
            //userTable.Update(result[0]);
            //更新多筆
            result[0].Name = "NewName";
            //result[1].Name = "NewName";
            //userTable.Update(result);

            //刪除單筆
            //userTable.Delete(result[0]);
            //刪除多筆
            // userTable.Delete(result);

            //自訂查詢;
            doQuery();

            Console.Read();
        }
コード例 #19
0
 public ActionResult AddUser_Company(User_Company model)
 {
     return(AddModel(model));
 }
コード例 #20
0
    /// <summary>
    /// 获取指令数据
    /// </summary>
    /// <param name="SendIns"></param>
    /// <param name="Office"></param>
    /// <param name="cpyNo">公司编号</param>
    /// <returns></returns>
    public string GetData(string SendIns, string Office, string cpyNo, string Other)
    {
        string recvData = string.Empty;

        try
        {
            ConfigParam CP = null;
            if (!string.IsNullOrEmpty(Other))
            {
                string[] strArr            = Other.Split(new string[] { "@@@@" }, StringSplitOptions.None);
                string   strHeiPingCanShu  = strHeiPingCanShu = strArr[0];
                string   strDaPeiZhiCanShu = strArr[1];
                CP = GetConfigParam(strHeiPingCanShu, strHeiPingCanShu);
            }
            if (string.IsNullOrEmpty(SendIns))
            {
                recvData = "发送指令为空";
                return(recvData);
            }
            if (CP == null)
            {
                recvData = "参数错误";
                return(recvData);
            }
            IHashObject         param       = new HashObject();
            string              sqlWhere    = string.Format("UninCode='{0}' and  RoleType in(2,3) ", cpyNo);
            User_Company        m_Company   = null;
            List <User_Company> CompanyList = baseDataManage.CallMethod("User_Company", "GetList", null, new object[] { sqlWhere }) as List <User_Company>;
            if (CompanyList != null && CompanyList.Count > 0)
            {
                //该公司实体
                m_Company = CompanyList[0];
                //该公司参数表信息
                List <Bd_Base_Parameters> db_param = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new object[] { "CpyNo='" + cpyNo + "'" }) as List <Bd_Base_Parameters>;

                string Mark = BaseParams.getParams(db_param).KongZhiXiTong;

                string bigIP = "127.0.0.1", bigPort = "391", BigOffice = "";
                string IP = "127.0.0.1", Port = "391";


                Tb_SendInsData sendins = new Tb_SendInsData();
                sendins.SendInsType = 11;  //标识为控台系统发送的指令
                sendins.UserAccount = mUser != null ? mUser.LoginName : "控台管理员";
                sendins.CpyNo       = mUser != null ? mUser.CpyNo : "控台管理员";

                //查找白屏预订Pid的IP地址
                IP = CP.WhiteScreenIP;
                //查找白屏预订Pid的端口
                Port = CP.WhiteScreenPort;
                //查找大配置IP
                bigIP = CP.BigCfgIP;
                //查找大配置Port
                bigPort = CP.BigCfgPort;
                //查找大配置Office
                BigOffice = CP.BigCfgOffice;

                //使用的IP 端口 Office
                string ServerIP   = "";
                int    ServerPort = 0;
                //是否开启大配置
                bool IsUseBigConfig = Mark.Contains("|39|");
                //是有使用新的PID
                bool IsUseNewPid = Mark.Contains("|48|");

                if (IsUseBigConfig)
                {
                    //大配置
                    int _Port = 451;
                    int.TryParse(bigPort, out _Port);
                    ServerIP   = bigIP;
                    ServerPort = _Port;
                    //大配置Office
                    Office = BigOffice;
                }
                else
                {
                    int.TryParse(Port, out ServerPort);
                    ServerIP = IP;
                }
                string[] OfficeNum  = null;
                string   tempOffice = CP.Office;//GetValue("office", db_param);
                if (Office == "")
                {
                    //空台设置的Office
                    OfficeNum = tempOffice.Split(new string[] { "|", " ", "/", ",", ",", "\\", "#", "^" }, StringSplitOptions.RemoveEmptyEntries);
                }
                else
                {
                    //空台设置的Office
                    OfficeNum = Office.Split(new string[] { "|", " ", "/", ",", ",", "\\", "#", "^" }, StringSplitOptions.RemoveEmptyEntries);
                }
                ///使用新的PID
                if (IsUseNewPid)
                {
                    //DataModel.A2 = "新的PID";
                    // WebManage.ServerIp = ServerIP;
                    // WebManage.ServerPort = ServerPort;
                    ParamObject Pm = new ParamObject();
                    Pm.ServerIP   = ServerIP;
                    Pm.ServerPort = ServerPort;


                    bool   IsPn       = false;//是否PN
                    string patternPnr = @"\s*(?<=rt|\(eas\)rt|rtx/|\(eas\)rtx/)(?=\w{6})\s*";
                    Match  mch        = Regex.Match(SendIns, patternPnr, RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase);
                    if (mch.Success)
                    {
                        IsPn = true;
                    }
                    SendIns = SendIns.ToLower().StartsWith("ig|") ? SendIns.Trim().Substring(2) : SendIns;
                    if (Office != "" && Office.IndexOf("|") == -1)
                    {
                        //发送指令数据
                        SendIns = SendIns.Replace("\n", "").Replace("\r", "^");
                        //去掉ig
                        SendIns                 = SendIns.ToLower().StartsWith("ig|") ? SendIns.Trim().Substring(3).ToLower() : SendIns.ToLower();
                        sendins.SendIns         = SendIns;
                        sendins.Office          = Office;
                        sendins.ServerIPAndPort = ServerIP + ":" + ServerPort;
                        sendins.SendTime        = System.DateTime.Now;

                        Pm.code   = SendIns;
                        Pm.IsPn   = IsPn;
                        Pm.Office = Office;
                        recvData  = SendNewPID.SendCommand(Pm);

                        //recvData = WebManage.SendCommand(SendIns, Office, IsPn, false, ServerIP, ServerPort);

                        sendins.RecvTime = System.DateTime.Now;
                        if (recvData == null)
                        {
                            recvData = "";
                        }
                        recvData         = recvData.Replace("^", "\r");
                        sendins.RecvData = recvData;
                        //添加日志
                        AddLog(sendins);
                    }
                    if (recvData.Contains("授权") || Office == "")
                    {
                        foreach (string _Office in OfficeNum)
                        {
                            if (_Office.ToLower() != Office.ToLower())
                            {
                                Office = _Office.ToLower();
                                //发送指令数据
                                SendIns = SendIns.Replace("\n", "").Replace("\r", "^");
                                //去掉ig
                                SendIns                 = SendIns.ToLower().StartsWith("ig|") ? SendIns.Trim().Substring(3).ToLower() : SendIns.ToLower();
                                sendins.SendIns         = SendIns;
                                sendins.Office          = Office;
                                sendins.ServerIPAndPort = ServerIP + ":" + ServerPort;
                                sendins.SendTime        = System.DateTime.Now;

                                Pm.code   = SendIns;
                                Pm.IsPn   = IsPn;
                                Pm.Office = Office;
                                recvData  = SendNewPID.SendCommand(Pm);

                                //recvData = WebManage.SendCommand(SendIns, _Office, IsPn, false, ServerIP, ServerPort);

                                sendins.RecvTime = System.DateTime.Now;
                                if (recvData == null)
                                {
                                    recvData = "";
                                }
                                recvData         = recvData.Replace("^", "\r");
                                sendins.RecvData = recvData;
                                //添加日志
                                AddLog(sendins);
                            }
                            if (!recvData.Contains("授权"))
                            {
                                break;
                            }
                        }
                    }
                }
                else
                {
                    Office = (Office == "" ? "" : "&" + Office.TrimEnd('$').Trim() + "$") + "#1";
                    ECParam ecParam = new ECParam();
                    ecParam.ECIP   = ServerIP;
                    ecParam.ECPort = ServerPort.ToString();
                    //ecParam.PID = supModel.PId;
                    //ecParam.KeyNo = supModel.KeyNo;

                    ecParam.UserName = mUser == null ? "控台管理员" : mUser.UserName;
                    SendEC sendec = new SendEC(ecParam);
                    if (Office != "")
                    {
                        //发送指令数据
                        //logPnr.SSContent = "[EC:" + ServerIP + ":" + ServerPort + "|" + Office + "]" + SendIns + Office;
                        sendins.Office          = Office;
                        sendins.ServerIPAndPort = ServerIP + ":" + ServerPort;
                        sendins.SendTime        = System.DateTime.Now;
                        sendins.SendIns         = SendIns + Office;
                        recvData         = sendec.SendData(SendIns + Office, out recvData);
                        sendins.RecvData = recvData;
                        sendins.RecvTime = System.DateTime.Now;
                        // logPnr.ResultContent = recvData;
                        //添加日志
                        AddLog(sendins);
                    }
                    if (recvData.Contains("授权") || Office == "" || Office == "#1")
                    {
                        tempOffice = "";
                        foreach (string _Office in OfficeNum)
                        {
                            if (_Office.ToLower() != Office.ToLower())
                            {
                                tempOffice = (_Office == "" ? "" : "&" + _Office.TrimEnd('$').Trim() + "$") + "#1";
                                //logPnr.SSContent = "[EC:" + ServerIP + ":" + ServerPort + "|" + Office + "]" + SendIns + Office;
                                //发送指令数据
                                sendins.SendIns         = SendIns + Office;
                                sendins.Office          = _Office;
                                sendins.ServerIPAndPort = ServerIP + ":" + ServerPort;
                                sendins.SendTime        = System.DateTime.Now;
                                recvData         = sendec.SendData(SendIns + tempOffice, out recvData);
                                sendins.RecvData = recvData;
                                sendins.RecvTime = System.DateTime.Now;
                                //  logPnr.ResultContent = recvData;
                                //添加日志
                                AddLog(sendins);
                            }
                            if (!recvData.Contains("授权"))
                            {
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                recvData = "该供应商不存在";
                return(recvData);
            }
        }
        catch (Exception ex)
        {
            recvData = System.DateTime.Now + ":" + ex.Message + "|" + ex.StackTrace.ToString();
        }
        return(escape(recvData));
    }
コード例 #21
0
 public ActionResult EditUser_Company(User_Company model)
 {
     return(EditModel(model));
 }
コード例 #22
0
ファイル: PTBy517.cs プロジェクト: toyslife/PiaoBaoWork3.0
        /// <summary>
        /// 将517政策合并到原始政策dt中去
        /// </summary>
        /// <param name="LocalDt">原始dt</param>
        /// <param name="Dt517">517dt</param>
        private List <PbProject.Model.Tb_Ticket_Policy> Merger517DT(DataRow[] Dr517, User_Company GYCompany, bool ChangePnr)
        {
            try
            {
                List <PbProject.Model.Tb_Ticket_Policy> mPolicyList = new List <Tb_Ticket_Policy>();
                for (int i = 0; i < Dr517.Length; i++)
                {
                    //如果不允许换编码并且政策是必须换编码出票的,则过滤掉,yyy 2013-6-7update
                    if (!ChangePnr && bool.Parse(Dr517[i]["IsChangePNRCP"].ToString()))
                    {
                        continue;
                    }
                    //DataRow dr = LocalDt.NewRow();
                    PbProject.Model.Tb_Ticket_Policy mPolicy = new Tb_Ticket_Policy();
                    mPolicy.CpyNo   = "0" + PbProject.Model.definitionParam.PolicySourceParam.b517na.ToString() + _mTopcom.UninCode;
                    mPolicy.CpyName = _mTopcom.UninName;
                    if (Dr517[i]["IsSp"].ToString() == "0")    //是否是特殊政策
                    {
                        mPolicy.PolicyKind     = 0;
                        mPolicy.GenerationType = 1;
                    }
                    else
                    {
                        mPolicy.PolicyKind     = 2;
                        mPolicy.GenerationType = 2;
                    }
                    mPolicy.CarryCode = Dr517[i]["CarryCode"].ToString();
                    if (Dr517[i]["TravelType"].ToString() == "单程")
                    {
                        mPolicy.TravelType = 1;
                    }
                    else if (Dr517[i]["TravelType"].ToString() == "单程/往返")
                    {
                        mPolicy.TravelType = 2;
                    }
                    else if (Dr517[i]["TravelType"].ToString() == "往返")
                    {
                        mPolicy.TravelType = 3;
                    }
                    else
                    {
                        mPolicy.TravelType = 4;
                    }

                    if (Dr517[i]["PolicyType"].ToString() == "1")
                    {
                        mPolicy.PolicyType = 2;
                    }
                    else
                    {
                        mPolicy.PolicyType = 1;
                    }
                    mPolicy.TeamFlag = 0;
                    if (Dr517[i]["FromCity"].ToString() == "")
                    {
                        mPolicy.StartCityNameCode = "ALL";
                    }
                    else
                    {
                        mPolicy.StartCityNameCode = Dr517[i]["FromCity"].ToString();
                    }
                    mPolicy.StartCityNameSame = 2;

                    if (Dr517[i]["ToCity"].ToString() == "")
                    {
                        mPolicy.TargetCityNameCode = "ALL";
                    }
                    else
                    {
                        mPolicy.TargetCityNameCode = Dr517[i]["FromCity"].ToString();
                    }
                    mPolicy.TargetCityNameSame = 2;
                    if (Dr517[i]["FlightType"].ToString() == "1")
                    {
                        mPolicy.ApplianceFlight = Dr517[i]["Flight"].ToString();
                    }
                    if (Dr517[i]["FlightType"].ToString() == "2")
                    {
                        mPolicy.UnApplianceFlight = Dr517[i]["Flight"].ToString();
                    }
                    if (Dr517[i]["FlightType"].ToString() == "0")
                    {
                        mPolicy.ApplianceFlightType = 1;
                    }
                    else if (Dr517[i]["FlightType"].ToString() == "1")
                    {
                        mPolicy.ApplianceFlightType = 2;
                    }
                    else
                    {
                        mPolicy.ApplianceFlightType = 3;
                    }

                    mPolicy.ScheduleConstraints = Dr517[i]["ScheduleConstraints"].ToString();
                    mPolicy.ShippingSpace       = Dr517[i]["Space"].ToString();

                    mPolicy.SpacePrice      = Convert.ToDecimal(Dr517[i]["PMFee"]);
                    mPolicy.FlightStartDate = Convert.ToDateTime(Dr517[i]["EffectDate"]);
                    mPolicy.FlightEndDate   = Convert.ToDateTime(Dr517[i]["ExpirationDate"]);
                    mPolicy.PrintStartDate  = Convert.ToDateTime(Dr517[i]["EffectDate"]);
                    mPolicy.PrintEndDate    = Convert.ToDateTime(Dr517[i]["ExpirationDate"]);
                    mPolicy.AuditDate       = DateTime.Now;
                    mPolicy.AuditType       = 1;
                    string isChangePnr = "";
                    if (bool.Parse(Dr517[i]["IsChangePNRCP"].ToString()))
                    {
                        isChangePnr = "须换编码出票.";
                    }
                    mPolicy.Remark = isChangePnr + " " + Dr517[i]["Remark"].ToString();
                    mPolicy.IsApplyToShareFlight = 0;
                    mPolicy.ShareAirCode         = "";
                    mPolicy.IsLowerOpen          = 0;
                    mPolicy.DownPoint            = decimal.Parse(Dr517[i]["Policy"].ToString());
                    mPolicy.InterPolicyId        = Dr517[i]["PolicyID"].ToString() + "~" + Dr517[i]["PolicyChildID"].ToString();
                    mPolicy._WorkTime            = WorkTimeConvert(Dr517[i]["GYOnlineTime"].ToString(), GYCompany.WorkTime);
                    mPolicy._FPGQTime            = Dr517[i]["GYFPTime"].ToString();
                    mPolicy.Office = Dr517[i]["Office"] == DBNull.Value?"":Dr517[i]["Office"].ToString();

                    mPolicyList.Add(mPolicy);
                    //dr["CarryCode"] = Dr517[i]["CarryCode"];
                    //if (Dr517[i]["FlightType"].ToString() == "1")
                    //{
                    //    dr["ApplianceFlight"] = Dr517[i]["Flight"];
                    //}
                    //if (Dr517[i]["FlightType"].ToString() == "2")
                    //{
                    //    dr["UnApplianceFlight"] = Dr517[i]["Flight"];
                    //}
                    //dr["ScheduleConstraints"] = Dr517[i]["ScheduleConstraints"];
                    //dr["Space"] = "/" + Dr517[i]["Space"] + "/";
                    //dr["OldPolicy"] = decimal.Parse(Dr517[i]["Policy"].ToString()) / 100;
                    //dr["GYPolicy"] = decimal.Parse(Dr517[i]["Policy"].ToString()) / 100;
                    //dr["FXPolicy"] = decimal.Parse(Dr517[i]["Policy"].ToString()) / 100;
                    //dr["PolicySource"] = "3";
                    //dr["PolicyId"] = Dr517[i]["PolicyID"] + "~" + Dr517[i]["PolicyChildID"];
                    //dr["PolicyType"] = Dr517[i]["PolicyType"];
                    //if (DateTime.Now.DayOfWeek != DayOfWeek.Saturday && DateTime.Now.DayOfWeek != DayOfWeek.Sunday)
                    //{
                    //    dr["WorkTime"] = WorkTimeConvert(Dr517[i]["GYOnlineTime"].ToString(), GYCompany.WorkTime);
                    //    dr["BusinessTime"] = Dr517[i]["GYFPTime"];
                    //}
                    //else
                    //{
                    //    dr["WorkTime"] = Dr517[i]["GYOutlineTime"];
                    //    dr["BusinessTime"] = Dr517[i]["GYFPTimeNew"];
                    //}
                    //dr["SpecialType"] = "0";
                    //dr["IsPause"] = "0";
                    //dr["IsLowerOpen"] = "0";
                    //dr["Remark"] = Dr517[i]["Remark"];
                    //dr["PolOffice"] = Dr517[i]["Office"];
                    //LocalDt.Rows.Add(dr);
                }

                return(mPolicyList);
            }
            finally
            { }
        }
コード例 #23
0
    /// <summary>
    /// 绑定公司,参数信息
    /// </summary>
    public void bind(string cpyno)
    {
        try
        {
            User_Company mcpy = (baseDataManage.CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + cpyno + "'" }) as List <User_Company>)[0];
            List <Bd_Base_Parameters> listParameters        = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + cpyno + "'" }) as List <Bd_Base_Parameters>;
            PbProject.Model.definitionParam.BaseSwitch pmdb = PbProject.WebCommon.Utility.BaseParams.getParams(listParameters);
            if (mcpy != null)
            {
                txtUnitName.Text   = mcpy.UninAllName;
                txtLXR.Text        = mcpy.ContactUser;
                txtLXTel.Text      = mcpy.ContactTel;
                txtFax.Text        = mcpy.Fax;
                txtUnitAddr.Text   = mcpy.UninAddress;
                txtEmail.Text      = mcpy.Email;
                txtBanGongTel.Text = mcpy.Tel;
                txtWebSite.Text    = mcpy.WebSite;
                //订单提醒设置
                ddlPromptTime.SelectedValue = mcpy.PromptTime.ToString();
                cbkPrompt.Checked           = mcpy.IsPrompt == 1 ? true : false;
                cbkEmpPrompt.Checked        = mcpy.IsEmpPrompt == 1 ? true : false;

                List <User_Company> listcpy = baseDataManage.CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + cpyno + "'" }) as List <User_Company>;
                if (listcpy != null && listcpy.Count > 0)
                {
                    ViewState["cpyid"] = listcpy[0].id;
                    if (listcpy[0].WorkTime != null && listcpy[0].WorkTime != "")
                    {
                        ddlworkHtime.SelectedValue      = listcpy[0].WorkTime.Split('-')[0].Split(':')[0];
                        ddlworkMtime.SelectedValue      = listcpy[0].WorkTime.Split('-')[0].Split(':')[1];
                        ddlafterworkHtime.SelectedValue = listcpy[0].WorkTime.Split('-')[1].Split(':')[0];
                        ddlafterworkMtime.SelectedValue = listcpy[0].WorkTime.Split('-')[1].Split(':')[1];
                    }
                    if (listcpy[0].BusinessTime != null && listcpy[0].BusinessTime != "")
                    {
                        ddlBusinessHstartTime.SelectedValue = listcpy[0].BusinessTime.Split('-')[0].Split(':')[0];
                        ddlBusinessMstartTime.SelectedValue = listcpy[0].BusinessTime.Split('-')[0].Split(':')[1];
                        ddlBusinessHendTime.SelectedValue   = listcpy[0].BusinessTime.Split('-')[1].Split(':')[0];
                        ddlBusinessMendTime.SelectedValue   = listcpy[0].BusinessTime.Split('-')[1].Split(':')[1];
                    }
                }
            }

            cksetdlfx.Checked = pmdb.IsDuLiFenXiao == "1" ? true : false;
            if (!string.IsNullOrEmpty(Request["cpyno"]))//平台进入
            {
                trdlfx.Visible    = true;
                cksetdlfx.Visible = true;
            }
            else
            {
                if (pmdb.IsDuLiFenXiao == "1")//独立分销(是否显示自己独立信息)
                {
                    trdlfx.Visible       = true;
                    ckshowdlinfo.Visible = true;
                    ckshowdlinfo.Checked = pmdb.IsShowDuLiInfo == "1" ? true : false;
                }
                if (!string.IsNullOrEmpty(mcpy.WebSite))//网址不为空时不能修改
                {
                    txtWebSite.Enabled = false;
                }
            }
            Hid_KefuValue.Value = pmdb.cssQQ;
            string s = "initxiugai('" + mcpy.Provice + "','" + mcpy.City + "');";
            ClientScript.RegisterStartupScript(this.GetType(), System.DateTime.Now.Ticks.ToString(), s, true);
        }
        catch (Exception)
        {
            throw;
        }
    }