Beispiel #1
0
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string           id     = e.Values["RMES_ID"] as string;
            StationSubEntity entity = StationSubFactory.GetByKey(id);

            StationSubFactory.Delete(entity);
        }
Beispiel #2
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除

        string           strCode = e.Values["STATION_CODE_SUB"].ToString();
        StationSubEntity entSub  = StationSubFactory.GetByKey(strCode);

        db.Delete(entSub);

        setCondition();
        e.Cancel = true;
    }
Beispiel #3
0
    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        //修改记录

        string           strCode = e.OldValues["STATION_CODE_SUB"].ToString();
        StationSubEntity entSub  = StationSubFactory.GetByKey(strCode);

        entSub.PLINE_CODE       = e.NewValues["PLINE_CODE"].ToString();
        entSub.STATION_CODE     = e.NewValues["STATION_CODE"].ToString();
        entSub.STATION_CODE_SUB = e.NewValues["STATION_CODE_SUB"].ToString();
        entSub.STATION_NAME_SUB = e.NewValues["STATION_NAME_SUB"].ToString();

        db.Update(entSub);

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        setCondition();
    }
Beispiel #4
0
    protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        //插入新纪录,应先做检查是否合法

        StationSubEntity entSub = new StationSubEntity();

        entSub.COMPANY_CODE     = theCompanyCode;
        entSub.PLINE_CODE       = e.NewValues["PLINE_CODE"].ToString();
        entSub.STATION_CODE     = e.NewValues["STATION_CODE"].ToString();
        entSub.STATION_CODE_SUB = e.NewValues["STATION_CODE_SUB"].ToString();
        entSub.STATION_NAME_SUB = e.NewValues["STATION_NAME_SUB"].ToString();

        db.Insert(entSub);

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        setCondition();
    }
Beispiel #5
0
        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            if (ASPxGridView1.IsEditing)
            {
                string           id         = e.NewValues["RMES_ID"] as string;
                string           plineCode  = e.NewValues["PLINE_CODE"] as string;
                string           station    = e.NewValues["STATION_CODE"] as string;
                string           stationSub = e.NewValues["STATION_CODE_SUB"] as string;
                StationSubEntity entity     = StationSubFactory.GetByKey(id);
                entity.PLINE_CODE       = plineCode;
                entity.STATION_CODE     = station;
                entity.STATION_CODE_SUB = stationSub;
                StationSubFactory.Update(entity);

                e.Cancel = true;
                ASPxGridView1.CancelEdit();
                setCondition();
            }
        }
Beispiel #6
0
        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            if (ASPxGridView1.IsNewRowEditing)
            {
                string           plineCode  = e.NewValues["PLINE_CODE"] as string;
                string           station    = e.NewValues["STATION_CODE"] as string;
                string           stationSub = e.NewValues["STATION_CODE_SUB"] as string;
                StationSubEntity entity     = new StationSubEntity
                {
                    COMPANY_CODE     = "01",
                    PLINE_CODE       = plineCode,
                    STATION_CODE     = station,
                    STATION_CODE_SUB = stationSub
                };
                StationSubFactory.Insert(entity);

                e.Cancel = true;
                ASPxGridView1.CancelEdit();
                setCondition();
            }
        }
Beispiel #7
0
 public static void Delete(StationSubEntity entity)
 {
     new StationSubDal().Delete(entity);
 }
Beispiel #8
0
 public static void Update(StationSubEntity entity)
 {
     new StationSubDal().Update(entity);
 }
Beispiel #9
0
 public static void Insert(StationSubEntity entity)
 {
     new StationSubDal().Insert(entity);
 }
Beispiel #10
0
 public void Delete(StationSubEntity entity)
 {
     db.Delete(entity);
 }
Beispiel #11
0
 public void Update(StationSubEntity entity)
 {
     db.Update(entity);
 }
Beispiel #12
0
 public void Insert(StationSubEntity entity)
 {
     db.Insert(entity);
 }