void button1_Command(object sender, CommandEventArgs e)
        {
            if (FrameLib.CheckData(button1))
            {
                button1.ExecutePara.Success = true;

                if (button1.ExecutePara.Success)
                {
                    button1.JButtonType = JButtonType.SimpleAction;
                    FrameLib.ExecuteJButton(button1);
                }
                else
                {
                    FrameLib.ExecuteButtonInfo(button1);
                }
            }
        }
        void button1_Click(object sender, EventArgs e)
        {
            if (FrameLib.CheckData(this.button1))
            {
                Dictionary <String, object> data1 = new Dictionary <string, object>();

                data1["num"]      = this.num.Text.Trim();
                data1["lineid"]   = Request.QueryString["LineID"];
                data1["linename"] = this.LineName.Text.Trim();
                data1["jiaolu"]   = this.JiaoLu.Text;

                if (this.fee1.Text.Trim() != String.Empty)
                {
                    data1["fee1"] = int.Parse(this.fee1.Text.Trim());
                }
                else
                {
                    data1["fee1"] = 0;
                }

                if (this.fee2.Text.Trim() != String.Empty)
                {
                    data1["fee2"] = int.Parse(this.fee2.Text.Trim());
                }
                else
                {
                    data1["fee2"] = 0;
                }


                ChangJiaoFeeBU bu1  = new ChangJiaoFeeBU();
                bool           succ = bu1.UpdateData(data1);

                this.button1.ExecutePara.Success = succ;
                FrameLib.ExecuteButtonInfo(this.button1);
            }
        }
Beispiel #3
0
        void button1_Command(object sender, CommandEventArgs e)
        {
            if (FrameLib.CheckData(button1))
            {
                button1.ExecutePara.Success = true;
                if (this.Line.Text.Trim() != String.Empty)
                {
                    //检查线路的配置是否正确
                    String     traintype = this.TrainType.Text.Trim();
                    ETrainType type1     = ETrainType.空调车25T;

                    if (traintype == "动车组")
                    {
                        type1 = ETrainType.动车CRH2A;
                    }
                    else if (traintype == "空调特快")
                    {
                        type1 = ETrainType.空调车25T;
                    }
                    else if (traintype == "空调快速")
                    {
                        type1 = ETrainType.空调车25G;
                    }
                    else if (traintype == "空调普快")
                    {
                        type1 = ETrainType.空调车25G;
                    }
                    else if (traintype == "快速")
                    {
                        type1 = ETrainType.空调车25K;
                    }
                    else if (traintype == "普快")
                    {
                        type1 = ETrainType.绿皮车25B;
                    }

                    String[]  lineNodes = this.Line.Text.Trim().Replace("-", ",").Split(',');
                    TrainLine lineObj   = BusinessRule.Line.GetTrainLineByTrainTypeAndLineNoeds(type1, false, lineNodes);
                    if (lineObj != null)
                    {
                        if (lineObj.TotalMiles + "" != this.Mile.Text.Trim())
                        {
                            button1.ExecutePara.Success  = false;
                            button1.ExecutePara.FailInfo = "错误:线路的距离设置错误,应为(" + lineObj.TotalMiles + "公里)!";
                        }
                    }
                    else
                    {
                        button1.ExecutePara.Success  = false;
                        button1.ExecutePara.FailInfo = "错误:线路的配置不对或线路不存在!";
                    }
                }

                if (button1.ExecutePara.Success)
                {
                    button1.JButtonType = JButtonType.SimpleAction;
                    FrameLib.ExecuteJButton(button1);
                }
                else
                {
                    FrameLib.ExecuteButtonInfo(button1);
                }
            }
        }