zoukankan      html  css  js  c++  java
  • 删除判断

    JS

    function SupplierProductte(id) {
    var record = Store2.getById(id);
    Store2.remove(record);
    SupplierProductSave.setDisabled(false);
    }

    //SupplierProduct Qty与Delete
    function Supplier_ProductDelete(e, a, d, f, g, c) {
    if (e == "Detail") {
    QtyHideId.setValue(a.data.ID);
    SupplierProductInventoryQty.show();
    Store3.reload();
    }
    else if (e == "Delete") {
    Ext.Msg.confirm('Delete', 'Are you sure to delete this SupplierName?', function (result) {
    if (result == 'yes') {
    Ecom.JudgeSupplierProductDelete(a.data.ID);
    }
    });
    }
    return true;
    }

    前台

    <ext:CommandColumn Width="120">
    <Commands>
    <ext:GridCommand Icon="NoteDelete" Text="Delete" CommandName="Delete">
    <ToolTip Text="Delete" />
    </ext:GridCommand>
    <ext:GridCommand Icon="Note" Text="Detail" CommandName="Detail">
    <ToolTip Text="Detail" />
    </ext:GridCommand>
    </Commands>
    </ext:CommandColumn>

    后台

    /// <summary>
    /// Product删除字段判断
    /// </summary>
    /// <param name="id"></param>
    [DirectMethod(Namespace = "Ecom")]
    public void JudgeSupplierProductDelete(int ID)
    {
    List<IDataParameter> pList = new List<IDataParameter>();
    pList.Add(DataProvider.Instance().NewParameter("@Type", DbType.String, 400, "DeleteProduce"));
    pList.Add(DataProvider.Instance().NewParameter("@SupplierName", DbType.String, 400, ""));
    pList.Add(DataProvider.Instance().NewParameter("@FieldOne", DbType.String, 400, ID));
    pList.Add(DataProvider.Instance().NewParameter("@FieldTwo", DbType.String, 400, ""));
    DataSet ds = DataProvider.Instance().ExecProcedure("R_Supplier_ProductDataJudge", pList);
    string ReturnMes = ds.Tables[0].Rows[0][0].ToString();
    if (ReturnMes == "0")
    {
    X.Msg.Show(new MessageBoxConfig
    {
    Title = "",
    Message = "The data are using cannot be deleted!",
    Icon = Ext.Net.MessageBox.Icon.INFO,
    Buttons = Ext.Net.MessageBox.Button.OK
    });
    return;
    }
    else if (ReturnMes == "1")
    {
    X.Js.AddScript("SupplierProductte({0});", ID);
    }
    }

    SQL存储过程

    Create PROCEDURE [dbo].[R_Supplier_ProductDataJudge]
    @Type Nvarchar(400),
    @SupplierName nvarchar(400),
    @FieldOne nvarchar(400),
    @FieldTwo nvarchar(400)
    AS
    BEGIN
    if(@Type = 'InsertProduce')
    begin
    DECLARE @F int,@H int,@G int
    SELECT @F=ID FROM Supplier WHERE SupplierName = @SupplierName
    SELECT @H=ID FROM Supplier_Product WHERE SupplierID = @F and SupplierPartNumber=@FieldOne
    IF(@H > 0)
    select '0'
    ELSE
    begin
    SELECT @G=ID FROM Supplier_Product WHERE SupplierID = @F and HMNUM=@FieldTwo
    if(@G > 0)
    select '0'
    else
    select '1'
    end
    end
    -------------------------------------------------------------------------------------
    else if(@Type = 'DeleteProduce')
    begin
    Declare @InventoryID int
    SELECT @InventoryID=ID FROM Supplier_Inventory WHERE S_ProductID=@FieldOne
    if(@InventoryID>0)
    select '0'
    else
    select '1'
    end
    END

  • 相关阅读:
    matlab在图像中画长方形(框)
    将matlab的figure保存为pdf,避免图片太大缺失
    机器学习经典书籍
    2008年北大核心有效期 计算机类核心(2011-01-31 15:02:46)
    解决Matlab画图直接保存.eps格式而导致图不全的问题
    matlab从文件夹名中获得该文件夹下所图像文件名
    获取图片中感兴趣区域的信息(Matlab实现)
    Eclipse 浏览(Navigate)菜单
    Eclipse 查找
    Eclipse 悬浮提示
  • 原文地址:https://www.cnblogs.com/dwuge/p/5301924.html
Copyright © 2011-2022 走看看