/// <summary>
        /// 得到客专ID
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetKzId(HttpContext context)
        {
            string        AppNameOrWSpell = context.Request.Params["q"];
            StringBuilder builder         = new StringBuilder();

            if (String.IsNullOrEmpty(AppNameOrWSpell) == false)
            {
                CORPINFO     bu1  = new CORPINFO();
                TrainShouRu1 tsbu = new TrainShouRu1();

                List <SearchField> condition = new List <SearchField>();
                SearchField        search1   = new SearchField("ABBNAME", AppNameOrWSpell, SearchOperator.Contains);
                SearchField        search2   = new SearchField("WHOLESPELL", AppNameOrWSpell, SearchOperator.Contains);
                SearchField        search3   = new SearchField("CORPNAME", AppNameOrWSpell, SearchOperator.Contains);

                condition.Add(search1 | search2 | search3);
                int       rows = 0;
                DataTable dt   = bu1.GetListData(condition, -1, -1, out rows);
                //DataTable newdt = this.SelectDistinct(dt, "NAME1");//返回过滤后的DataTable

                foreach (DataRow dr in dt.Rows)
                {
                    DataTable dt1 = tsbu.GetkzList(dr["CORPNAME"].ToString());
                    if (dt1 != null)
                    {
                        foreach (DataRow dr1 in dt1.Rows)
                        {
                            builder.AppendLine(dr1["Title"].ToString().Trim());
                        }
                    }
                }
            }
            return(builder.ToString());
        }
Ejemplo n.º 2
0
        protected override void OnPreRenderComplete(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                String lineid1 = this.Data1.ParaItems[0].ParaValue.ToString();
                this.midstation.Text = BusinessRule.Line.GetLineMiddleStation(lineid1);
                TrainShouRu1 bu = new TrainShouRu1();

                foreach (RepeaterItem item1 in this.Repeater1.Items)
                {
                    Label        lab1  = item1.FindControl("lab1") as Label;
                    TextBox      box1  = item1.FindControl("lblcjl2") as TextBox;
                    DropDownList drop1 = item1.FindControl("dpdlkz") as DropDownList;

                    if (drop1.Items.FindByValue(lab1.Text) != null)
                    {
                        drop1.SelectedValue = lab1.Text;
                    }

                    Label labname = item1.FindControl("Lab") as Label;
                    if (box1.Text.Trim() != "")
                    {
                        labname.Text = bu.GetLineName(box1.Text.Trim());
                    }
                }
            }
            base.OnPreRenderComplete(e);
        }
Ejemplo n.º 3
0
        private void bind()
        {
            TrainShouRu1 bu = new TrainShouRu1();
            DataTable    dt = bu.GetcjlList();

            this.Repeater1.DataSource = dt;
            this.Repeater1.DataBind();
        }
Ejemplo n.º 4
0
        protected void lblcjl2_TextChanged(object sender, EventArgs e)
        {
            TextBox      textBox      = (TextBox)sender;
            RepeaterItem repeaterItem = (RepeaterItem)textBox.Parent;
            TextBox      lblcjl2      = (TextBox)repeaterItem.FindControl("lblcjl2");
            Label        lbl          = (Label)repeaterItem.FindControl("Lab");
            TrainShouRu1 bu           = new TrainShouRu1();

            lbl.Text = bu.GetLineName(lblcjl2.Text.ToString().Trim());
        }
Ejemplo n.º 5
0
        protected override void OnInit(EventArgs e)
        {
            //this.Repeater1.ItemCommand += new RepeaterCommandEventHandler(Repeater1_ItemCommand);
            this.Repeater1.ItemDataBound += new RepeaterItemEventHandler(Repeater1_ItemDataBound);
            this.Button1.Click           += new EventHandler(Button1_Click);
            this.Button2.Click           += new EventHandler(Button2_Click);
            this.dqhAll.CheckedChanged   += new EventHandler(dqhAll_CheckedChanged);
            TrainShouRu1 bu = new TrainShouRu1();

            dt = bu.GetkzList("");
            //CorpInfoBU bu = new CorpInfoBU();
            //dt = bu.GetCorpName();
            base.OnInit(e);
        }
Ejemplo n.º 6
0
        //设置票价和满员
        private void SetPriceAndPerson()
        {
            TicketPrice    ticket     = new TicketPrice();
            int            traintype1 = int.Parse(Request.QueryString["TrainType"]);
            ETrainType     traintype  = (ETrainType)traintype1;
            ECommTrainType type1      = (ECommTrainType)((int)traintype);

            int yunxingLiCheng = int.Parse(this.totalmiles.Value);

            TrainShouRu1 shour1 = null;

            if (traintype == ETrainType.绿皮车25B)
            {
                shour1 = new TrainShouRu1(yunxingLiCheng, false, EJiaKuai.其他);
            }
            else
            {
                shour1 = new TrainShouRu2(yunxingLiCheng, EJiaKuai.特快);
            }


            //设置票价
            this.p1.Value = shour1.YinZuoPrice + shour1.GetKongTiaoFee(type1, ECommCheXian.硬座) + shour1.JiaKuaiFee + "";

            this.p2.Value = shour1.YinZuoPrice + shour1.GetKongTiaoFee(type1, ECommCheXian.硬座) +
                            shour1.JiaKuaiFee + shour1.YinWoPrice1 + "";
            this.p3.Value = shour1.YinZuoPrice + shour1.GetKongTiaoFee(type1, ECommCheXian.硬座)
                            + shour1.JiaKuaiFee + shour1.YinWoPrice2 + "";
            this.p4.Value = shour1.YinZuoPrice + shour1.GetKongTiaoFee(type1, ECommCheXian.硬座)
                            + shour1.JiaKuaiFee + shour1.YinWoPrice3 + "";

            this.p5.Value = shour1.RuanZuoPrice
                            + shour1.GetKongTiaoFee(type1, ECommCheXian.软卧) + shour1.JiaKuaiFee + shour1.RuanWoPrice1 + "";
            this.p6.Value = shour1.RuanZuoPrice + shour1.GetKongTiaoFee(type1, ECommCheXian.软卧)
                            + shour1.JiaKuaiFee + shour1.RuanWoPrice2 + "";

            //设置定员
            this.m1.Value = ChexianBianZhuData.YinZuo_Pcount + "";
            this.m2.Value = (ChexianBianZhuData.YinWo1_Pcount +
                             ChexianBianZhuData.YinWo2_Pcount +
                             ChexianBianZhuData.YinWo3_Pcount) + "";
            this.m3.Value = (ChexianBianZhuData.RuanWo1_Pcount
                             + ChexianBianZhuData.RuanWo2_Pcount) + "";
            this.m4.Value = TrainProfile.SyCheXianPCount + "";
        }
Ejemplo n.º 7
0
        void Button2_Click(object sender, EventArgs e)
        {
            System.Data.DataTable dt1 = new System.Data.DataTable();
            dt1.Columns.Add("Astation");
            dt1.Columns.Add("Bstation");
            dt1.Columns.Add("Miles", typeof(int));
            dt1.Columns.Add("JnFlag");
            dt1.Columns.Add("dqh");
            dt1.Columns.Add("shipflag");
            dt1.Columns.Add("KZID");
            dt1.Columns.Add("CJLID");
            dt1.Columns.Add("gtllx");

            int miles0 = 0;

            TrainShouRu1 bu = new TrainShouRu1();

            foreach (RepeaterItem item in this.Repeater1.Items)
            {
                Label        lab1  = item.FindControl("AStation") as Label;
                Label        lab2  = item.FindControl("BStation") as Label;
                TextBox      txt1  = item.FindControl("Miles") as TextBox;
                CheckBox     chk1  = item.FindControl("JnFlag") as CheckBox;
                CheckBox     dqh1  = item.FindControl("dqh") as CheckBox;
                CheckBox     ship1 = item.FindControl("SHIPFLAG") as CheckBox;
                CheckBox     gglx1 = item.FindControl("GTLLX") as CheckBox;
                DropDownList gsid  = item.FindControl("dpdlkz") as DropDownList;
                TextBox      cjlid = item.FindControl("lblcjl2") as TextBox;
                //TextBox txtFee1 = item.FindControl("Fee1") as TextBox;
                //TextBox txtFee2 = item.FindControl("Fee2") as TextBox;

                if (lab1 != null && lab2 != null && txt1 != null)
                {
                    System.Data.DataRow dr1 = dt1.NewRow();
                    dr1["Astation"] = lab1.Text;
                    dr1["Bstation"] = lab2.Text;
                    dr1["Miles"]    = int.Parse(txt1.Text);

                    if (chk1.Checked)
                    {
                        dr1["JnFlag"] = "1";
                    }
                    else
                    {
                        dr1["JnFlag"] = DBNull.Value;
                    }
                    if (dqh1.Checked)
                    {
                        dr1["dqh"] = "1";
                    }
                    else
                    {
                        dr1["dqh"] = DBNull.Value;
                    }

                    if (ship1.Checked)
                    {
                        dr1["shipflag"] = "1";
                    }
                    else
                    {
                        dr1["shipflag"] = DBNull.Value;
                    }

                    //高铁联络线
                    if (gglx1.Checked)
                    {
                        dr1["gtllx"] = "1";
                    }
                    else
                    {
                        dr1["gtllx"] = DBNull.Value;
                    }

                    dr1["KZID"] = gsid.SelectedValue;

                    if (cjlid.Text.ToString().Trim() != "")
                    {
                        dr1["CJLID"] = cjlid.Text.ToString().Trim();
                    }
                    else
                    {
                        dr1["CJLID"] = null;
                    }


                    dt1.Rows.Add(dr1);
                    miles0 = miles0 + int.Parse(txt1.Text);

                    /* if (txtFee1.Text != String.Empty)
                     * {
                     *   dr1["Fee1"] = txtFee1.Text;
                     * }
                     * else
                     * {
                     *   dr1["Fee1"] = DBNull.Value;
                     * }
                     *
                     * if (txtFee2.Text != String.Empty)
                     * {
                     *   dr1["Fee2"] = txtFee2.Text;
                     * }
                     * else
                     * {
                     *   dr1["Fee2"] = DBNull.Value;
                     * }*/
                }

                TextBox box1    = item.FindControl("lblcjl2") as TextBox;
                Label   labname = item.FindControl("Lab") as Label;
                if (box1.Text.Trim() != "")
                {
                    labname.Text = bu.GetLineName(box1.Text.Trim());
                }
            }

            if (miles0 != int.Parse(this.miles.Text))
            {
                WebFrame.Util.JAjax.Alert("错误:里程数的总和应等于" + this.miles.Text + ",请重新分配!");
                return;
            }
            else
            {
                String lineid1 = this.Data1.ParaItems[0].ParaValue.ToString();
                String error   = BusinessRule.Line.SetMiddleStation(lineid1, dt1);
                if (String.IsNullOrEmpty(error) == false)
                {
                    this.Button2.ExecutePara.Success = false;
                }
                else
                {
                    this.Button2.ExecutePara.Success = true;
                }

                WebFrame.FrameLib.ExecuteButtonInfo(this.Button2);
            }
        }