Esempio n. 1
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除

        string         strCode = e.Values["RMES_ID"].ToString();
        WorkShopEntity entSub  = WorkShopFactory.GetByNumber(strCode);

        db.Delete(entSub);

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

        string         strCode = e.OldValues["RMES_ID"].ToString();
        WorkShopEntity entSub  = WorkShopFactory.GetByNumber(strCode);

        entSub.WORKSHOP_CODE    = e.NewValues["WORKSHOP_CODE"].ToString();
        entSub.WORKSHOP_NAME    = e.NewValues["WORKSHOP_NAME"].ToString();
        entSub.WORKSHOP_ADDRESS = e.NewValues["WORKSHOP_ADDRESS"].ToString();

        db.Update(entSub);

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        setCondition();
    }