Example #1
0
    private List <SqlParameter> GetUpdateParam(ProductStatusUpdate productSort)
    {
        var cmdparams = new List <SqlParameter>();

        cmdparams.Add(SafeSQL.CreateInputParam("@SysId", SqlDbType.UniqueIdentifier, productSort.SysId));
        cmdparams.Add(SafeSQL.CreateInputParam("@EventId", SqlDbType.UniqueIdentifier, productSort.EventId));
        cmdparams.Add(SafeSQL.CreateInputParam("@ProductId", SqlDbType.Int, productSort.ProductId));
        cmdparams.Add(SafeSQL.CreateInputParam("@ProductStatus", SqlDbType.Int, productSort.ProductStatus));
        return(cmdparams);
    }
Example #2
0
    private ProductStatusUpdate MapProductStatusUpdate(Guid eventId, int pid)
    {
        var productStatus = new ProductStatusUpdate();

        productStatus.ProductId     = pid;
        productStatus.ProductStatus = int.Parse(ddlAddProductStatus.SelectedValue);
        productStatus.SysId         = Guid.NewGuid();
        productStatus.EventId       = eventId;

        return(productStatus);
    }
Example #3
0
    public List <UpdateDetails> GetBulkUpdate(Guid eventId)
    {
        var sql = @"SELECT* FROM [ScheduleEvent].[dbo].ProductStatusUpdate  WHERE EventId = @EventId AND Status=1 ";
        var cmd = new SqlCommand {
            CommandText = sql
        };

        cmd.Parameters.Add(SafeSQL.CreateInputParam("@EventId", SqlDbType.UniqueIdentifier, eventId));
        var dt   = SqlDbmanager.queryBySql(cmd);
        var list = new List <UpdateDetails>();

        foreach (DataRow dr in dt.Rows)
        {
            var pStatus = new ProductStatusUpdate();
            pStatus.ProductId     = int.Parse(dr["ProductId"].ToString());
            pStatus.ProductStatus = int.Parse(dr["ProductStatus"].ToString());
            list.Add(pStatus);
        }
        return(list);
    }