public ICReceive ICReject(ICReceive iCReceive) { DAL objDAL = new DAL(); ICReceive result = objDAL.ICReject(iCReceive); return(result); }
public ICReceive ICConfirm(ICReceive iCReceive) { DAL objDAL = new DAL(); ICReceive result = objDAL.ICConfirm(iCReceive); return(result); }
public ICReceive GetPODO(string Company, int PO, string DO) { DAL objDAL = new DAL(); ICReceive result = objDAL.GetPODO(Company, PO, DO); return(result); }
public ICReceive ICReject(ICReceive iCReceive) { string msg = "Success"; ICReceive ICReturn = iCReceive; string Key = MaxKeyUD26(iCReceive.Company); try { UD26Services receipt = new UD26Services(); ICReceiveUD26 recDM = new ICReceiveUD26(); List <ICReceiveDtlUD26> recDMDtl = new List <ICReceiveDtlUD26>(); recDM.Company = iCReceive.Company; ICReceiveDtlUD26 dtl = new ICReceiveDtlUD26(); foreach (ICReceiveDtl det in iCReceive.Detail) { dtl = new ICReceiveDtlUD26(); dtl.LineNo = det.LineNo; dtl.LotNum = det.LotNum; dtl.PartNum = det.PartNum; dtl.Qty = det.Qty; dtl.SUOM = det.SUOM; recDMDtl.Add(dtl); } recDM.Detail = recDMDtl; recDM.DONum = iCReceive.DONum; recDM.intQue = iCReceive.intQue; recDM.PONum = iCReceive.PONum; recDM.RejComment = iCReceive.RejComment; recDM.TranStatus = iCReceive.TranStatus; recDM.VendorNum = iCReceive.VendorNum; recDM.SupName = iCReceive.SupName; receipt.Begin(recDM, Key); } catch (Exception ex) { msg = ex.Message; } ICReturn.TranStatus = msg; return(ICReturn); }
public HttpResponseMessage Get(string Company = null, int PONum = 0, string DONum = null) { if (!string.IsNullOrEmpty(Company) || !string.IsNullOrEmpty(DONum) || PONum == 0) { BusinessLayer BL = new BusinessLayer(); ICReceive entity = BL.GetPODO(Company, PONum, DONum); if (entity != null) { return(Request.CreateResponse(HttpStatusCode.OK, entity)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, $"Not Found")); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"Company is Null or PO is zero or DO Num is null !")); } }
public HttpResponseMessage Post(ICReceive iCReceive) { if (!string.IsNullOrEmpty(iCReceive.Company) || !string.IsNullOrEmpty(iCReceive.DONum) || iCReceive.PONum == 0) { BusinessLayer BL = new BusinessLayer(); ICReceive entity = BL.ICConfirm(iCReceive); if (entity != null) { return(Request.CreateResponse(HttpStatusCode.OK, entity)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, $"Not Found")); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"Company is Null or PO is zero or DO Num is null !")); } }
public ICReceive GetPODO(string Company, int PO, string DO) { ICReceive iCReceive = new ICReceive(); iCReceive.Company = Company; iCReceive.PONum = PO; iCReceive.DONum = DO; int recCount = 0; int IntQueID = 0; int vendorNum = 0; string vendorName = string.Empty; ICReceiveDtl iCReceiveDtl = new ICReceiveDtl(); List <ICReceiveDtl> iCReceiveDtls = new List <ICReceiveDtl>(); try { using (SqlConnection Conn = new SqlConnection(EpicorConStr)) { Conn.Open(); StringBuilder strQry = null; strQry = new StringBuilder(); strQry.Append($" select a.IntQueID, b.PartNum, b.VendorQty, c.UOM, b.LotNum,a.VendorNum, d.Name "); strQry.Append($" from IM.IMRcvHead a "); strQry.Append($" inner join IM.IMRcvDtl b on(a.Company = b.Company and a.IntQueID = b.IntQueID) "); strQry.Append($" inner join ERP.PODetail c on(b.Company = c.Company and b.PONum = c.PONUM and b.POLine = c.POLine) "); strQry.Append($" inner join ERP.Vendor d on (a.Company=d.Company and a.VendorNum=d.VendorNum) "); strQry.Append($" where a.Company = '{Company}' and A.PONum = {PO} and A.PackSlip = '{DO}' and "); strQry.Append($" A.IncomingOutgoing = 'I' and "); strQry.Append($" a.IntQueID NOT IN(SELECT IntQueID_c from UD26 where company='{Company}' and FS_Status_c='')"); SqlCommand command = new SqlCommand(strQry.ToString(), Conn); using (SqlDataReader reader = command.ExecuteReader()) { int Counter = 1; while (reader.Read()) { iCReceiveDtl = new ICReceiveDtl(); iCReceiveDtl.LineNo = Counter; iCReceiveDtl.LotNum = reader["LotNum"].ToString(); iCReceiveDtl.PartNum = reader["PartNum"].ToString(); iCReceiveDtl.Qty = Convert.ToDecimal(reader["VendorQty"].ToString()); iCReceiveDtl.SUOM = reader["UOM"].ToString(); IntQueID = Convert.ToInt16(reader["IntQueID"].ToString()); vendorNum = Convert.ToInt16(reader["VendorNum"].ToString()); vendorName = reader["Name"].ToString(); Counter++; iCReceiveDtls.Add(iCReceiveDtl); } recCount = Counter; } } } catch (Exception ex) { iCReceive.TranStatus = ex.Message.ToString(); } finally { } if (recCount != 1) { iCReceive.intQue = IntQueID; iCReceive.TranStatus = "Success"; iCReceive.Detail = iCReceiveDtls; iCReceive.VendorNum = vendorNum; iCReceive.SupName = vendorName; } else { iCReceive.TranStatus = "PO & DO Combination Not Found !"; } return(iCReceive); }