Example #1
0
        public async Task <List <T_Arrival_Header> > GetArrival(string arrno, string docno, int?arrType, int?rawMatType, DateTime?arrdateF, DateTime?arrdateT, DateTime?docdateF, DateTime?docdateT)
        {
            try
            {
                using (var context = new TransactionDbContext(contextOptions))
                {
                    MySqlParameter[] sqlParams = new MySqlParameter[] {
                        new MySqlParameter("strArrivalNo", arrno),
                        new MySqlParameter("strDocumentNo", docno),
                        new MySqlParameter("strArrivalTypeId", arrType),
                        new MySqlParameter("strRawMatTypeId", rawMatType),
                        new MySqlParameter("strArrivalDateF", arrdateF),
                        new MySqlParameter("strArrivalDateT", arrdateT),
                        new MySqlParameter("strDocRefDateF", docdateF),
                        new MySqlParameter("strDocRefDateT", docdateT),
                        new MySqlParameter("strCompanyCode", this.compCode),
                    };

                    var objList = await context.Query <T_Arrival_HeaderObj>().FromSql("call sp_arrival_hdr_gets(?, ?, ?, ?, ?, ?, ?, ?, ?)", parameters: sqlParams).ToListAsync();

                    return(objList.ConvertAll(a => new T_Arrival_Header
                    {
                        Id = a.Id,
                        ArrivalNo = a.ArrivalNo,
                        ArrivalDate = a.ArrivalDate,
                        RawMatTypeId = a.RawMatTypeId,
                        RawMatTypeName = a.RawMatTypeName,
                        VendorId = a.VendorId,
                        VendorCode = a.VendorCode,
                        VendorName = a.VendorName,
                        VendorAddress = a.VendorAddress,
                        ArrivalTypeId = a.ArrivalTypeId,
                        ArrivalTypeName = a.ArrivalTypeName,
                        PurchaseOrderNo = a.PurchaseOrderNo,
                        DocRefNo = a.DocRefNo,
                        DocRefDate = a.DocRefDate,
                        ArrivalRemark = a.ArrivalRemark,
                        CompanyCode = a.CompanyCode,
                        Is_Active = a.Is_Active,
                        Created_Date = a.Created_Date,
                        Created_By = a.Created_By,
                        Updated_Date = a.Updated_Date,
                        Updated_By = a.Updated_By
                    }));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public async Task <List <T_Arrival_Detail> > GetArrivalDetails(int?arrId)
        {
            try
            {
                using (var context = new TransactionDbContext(contextOptions))
                {
                    MySqlParameter[] sqlParams = new MySqlParameter[] {
                        new MySqlParameter("strArrivalId", arrId)
                    };

                    var objList = await context.Query <T_Arrival_DetailObj>().FromSql("call sp_arrival_dtl_get(?)", parameters: sqlParams).ToListAsync();

                    return(objList.ConvertAll(a => new T_Arrival_Detail
                    {
                        Id = a.Id,
                        ArrivalId = a.ArrivalId,
                        LineNo = a.LineNo,
                        PoLineNo = a.PoLineNo,
                        MaterialId = a.MaterialId,
                        MaterialCode = a.MaterialCode,
                        MaterialName = a.MaterialName,
                        MaterialDesc = a.MaterialDesc,
                        OrderQty = a.OrderQty,
                        RecvQty = a.RecvQty,
                        LotNo = a.LotNo,
                        LotDate = a.LotDate,
                        DetailRemark = a.DetailRemark,
                        GenLabelStatus = a.GenLabelStatus,
                        NoOfLabel = a.NoOfLabel,
                        CompanyCode = a.CompanyCode,
                        RecordFlag = a.RecordFlag,
                        Is_Active = a.Is_Active,
                        Created_Date = a.Created_Date,
                        Created_By = a.Created_By,
                        Updated_Date = a.Updated_Date,
                        Updated_By = a.Updated_By,
                        PackageStdQty = a.PackageStdQty
                    }));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public async Task <List <T_Arrival_Header> > GetArrival(int?id)
        {
            try
            {
                using (var context = new TransactionDbContext(contextOptions))
                {
                    MySqlParameter[] sqlParams = new MySqlParameter[] {
                        new MySqlParameter("strId", id)
                    };

                    var objList = await context.Query <T_Arrival_HeaderObj>().FromSql("call sp_arrival_hdr_get(?)", parameters: sqlParams).ToListAsync();

                    return(objList.ConvertAll(a => new T_Arrival_Header
                    {
                        Id = a.Id,
                        ArrivalNo = a.ArrivalNo,
                        ArrivalDate = a.ArrivalDate,
                        RawMatTypeId = a.RawMatTypeId,
                        RawMatTypeName = a.RawMatTypeName,
                        VendorId = a.VendorId,
                        VendorCode = a.VendorCode,
                        VendorName = a.VendorName,
                        VendorAddress = a.VendorAddress,
                        ArrivalTypeId = a.ArrivalTypeId,
                        ArrivalTypeName = a.ArrivalTypeName,
                        PurchaseOrderNo = a.PurchaseOrderNo,
                        DocRefNo = a.DocRefNo,
                        DocRefDate = a.DocRefDate,
                        ArrivalRemark = a.ArrivalRemark,
                        CompanyCode = a.CompanyCode,
                        Is_Active = a.Is_Active,
                        Created_Date = a.Created_Date,
                        Created_By = a.Created_By,
                        Updated_Date = a.Updated_Date,
                        Updated_By = a.Updated_By
                    }));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        public async Task <List <T_Arrival_Detail_Sub> > GetArrivalDetailSub(int?arrDtlId, int?arrDtlLine)
        {
            try
            {
                using (var context = new TransactionDbContext(contextOptions))
                {
                    MySqlParameter[] sqlParams = new MySqlParameter[] {
                        new MySqlParameter("strArrivalId", arrDtlId),
                        new MySqlParameter("strLineNo", arrDtlLine)
                    };

                    var objList = await context.Query <T_Arrival_Detail_SubObj>().FromSql("call sp_arrival_dtl_sub_get(?, ?)", parameters: sqlParams).ToListAsync();

                    return(objList.ConvertAll(a => new T_Arrival_Detail_Sub
                    {
                        Id = a.Id,
                        ArrivalId = a.ArrivalId,
                        DtlLineNo = a.DtlLineNo,
                        SubLineNo = a.SubLineNo,
                        MaterialId = a.MaterialId,
                        NoOfLabel = a.NoOfLabel,
                        LabelQty = a.LabelQty,
                        TotalQty = a.TotalQty,
                        SubDetail = a.SubDetail,
                        CompanyCode = a.CompanyCode,
                        RecordFlag = a.RecordFlag,
                        Is_Active = a.Is_Active,
                        Created_Date = a.Created_Date,
                        Created_By = a.Created_By,
                        Updated_Date = a.Updated_Date,
                        Updated_By = a.Updated_By
                    }));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }