/// <summary> /// Update project purchaser customer /// </summary> /// <param name="PurchaserCustomer"></param> /// <returns></returns> public List <tbt_ProjectPurchaserCustomer> UpdateTbt_ProjectPurchaseCustomer(tbt_ProjectPurchaserCustomer PurchaserCustomer) { try { PurchaserCustomer.UpdateDate = CommonUtil.dsTransData.dtOperationData.ProcessDateTime; PurchaserCustomer.UpdateBy = CommonUtil.dsTransData.dtUserData.EmpNo; if (PurchaserCustomer != null) { List <tbt_ProjectPurchaserCustomer> lst = new List <tbt_ProjectPurchaserCustomer>(); lst.Add(PurchaserCustomer); List <tbt_ProjectPurchaserCustomer> Updated = base.UpdateTbt_ProjectPurchaseCustomer(CommonUtil.ConvertToXml_Store <tbt_ProjectPurchaserCustomer>(lst)); if (Updated.Count > 0) { // Transaction log ILogHandler logH = ServiceContainer.GetService <ILogHandler>() as ILogHandler; doTransactionLog log = new doTransactionLog(); log.TableName = TableName.C_TBL_NAME_PRJ_CUST; log.TransactionType = doTransactionLog.eTransactionType.Update; log.TableData = CommonUtil.ConvertToXml_Store <tbt_ProjectPurchaserCustomer>(Updated); logH.WriteTransactionLog(log); } } return(null); } catch (Exception) { throw; } }
/// <summary> /// Get project purchaser customer for view /// </summary> /// <param name="strProjectCode"></param> /// <returns></returns> public int InsertTbt_ProjectPurchaserCustomer(tbt_ProjectPurchaserCustomer tbtProjectPurchaser) { try { tbtProjectPurchaser.CreateBy = CommonUtil.dsTransData.dtUserData.EmpNo; tbtProjectPurchaser.CreateDate = CommonUtil.dsTransData.dtOperationData.ProcessDateTime; tbtProjectPurchaser.UpdateBy = CommonUtil.dsTransData.dtUserData.EmpNo; tbtProjectPurchaser.UpdateDate = CommonUtil.dsTransData.dtOperationData.ProcessDateTime; ILogHandler logHand = ServiceContainer.GetService <ILogHandler>() as ILogHandler; doTransactionLog log = new doTransactionLog(); List <tbt_ProjectPurchaserCustomer> lstPurchaser = new List <tbt_ProjectPurchaserCustomer>(); lstPurchaser.Add(tbtProjectPurchaser); List <tbt_ProjectPurchaserCustomer> lst = base.InsertTbt_ProjectPurchaserCustomer(CommonUtil.ConvertToXml_Store <tbt_ProjectPurchaserCustomer>(lstPurchaser)); if (lst.Count > 0) { log.TransactionType = doTransactionLog.eTransactionType.Insert; log.TableName = TableName.C_TBL_NAME_PRJ_CUST; log.TableData = CommonUtil.ConvertToXml <tbt_ProjectPurchaserCustomer>(lst); logHand.WriteTransactionLog(log); return(lst.Count); } else { return(-1); } } catch (Exception) { throw; } }