Ejemplo n.º 1
0
    private List <SqlParameter> GetUpdateParam(ProductDateUpdate productEvent)
    {
        var cmdparams = new List <SqlParameter>();

        cmdparams.Add(SafeSQL.CreateInputParam("@SysId", SqlDbType.UniqueIdentifier, productEvent.SysId));
        cmdparams.Add(SafeSQL.CreateInputParam("@EventId", SqlDbType.UniqueIdentifier, productEvent.EventId));
        cmdparams.Add(SafeSQL.CreateInputParam("@ProductId", SqlDbType.Int, productEvent.ProductId));
        cmdparams.Add(SafeSQL.CreateInputParam("@StartDate", SqlDbType.DateTime, productEvent.StartDate));
        cmdparams.Add(SafeSQL.CreateInputParam("@EndDate", SqlDbType.DateTime, productEvent.EndDate));
        return(cmdparams);
    }
Ejemplo n.º 2
0
    private ProductDateUpdate MapProductDateUpdate(Guid eventId, int pid)
    {
        var productDate = new ProductDateUpdate();

        productDate.ProductId = pid;
        productDate.StartDate = DateTime.Parse(txtAddProductSDate.Text);
        productDate.EndDate   = DateTime.Parse(txtAddProductEDate.Text);
        productDate.SysId     = Guid.NewGuid();
        productDate.EventId   = eventId;

        return(productDate);
    }
Ejemplo n.º 3
0
    public List <UpdateDetails> GetBulkUpdate(Guid eventId)
    {
        var sql = @"SELECT* FROM [ScheduleEvent].[dbo].ProductDateUpdate  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 pDate = new ProductDateUpdate();
            pDate.ProductId = int.Parse(dr["ProductId"].ToString());
            pDate.StartDate = DateTime.Parse(dr["StartDate"].ToString());
            pDate.EndDate   = DateTime.Parse(dr["EndDate"].ToString());
            list.Add(pDate);
        }
        return(list);
    }