/* * @author : AC <*****@*****.**> * @date : NOV. 22, 2016 4:03 PM * @description : update transaction header */ #region UpdateHeader public bool UpdateHeader(TransactionHeaderObject transObject, string returndate) { var @params = new SqlParameter[] { new SqlParameter(parameterName: "@Id", value: transObject.Id), new SqlParameter(parameterName: "@ImpexRefNbr", value: transObject.ImpexRefNbr), new SqlParameter(parameterName: "@DepartmentCode", value: transObject.DepartmentCode), // new SqlParameter(parameterName:"@ReturnDate",value: transObject.ReturnDate), new SqlParameter(parameterName: "@ReturnDate", value: returndate), new SqlParameter(parameterName: "@TransType", value: transObject.TransType), new SqlParameter(parameterName: "@CategoryCode", value: transObject.CategoryCode), new SqlParameter(parameterName: "@TypeCode", value: transObject.TypeCode), new SqlParameter(parameterName: "@Purpose", value: transObject.Purpose), new SqlParameter(parameterName: "@IsActive", value: transObject.IsActive), new SqlParameter(parameterName: "@Status", value: transObject.Status), new SqlParameter(parameterName: "@AddedBy", value: transObject.AddedBy), new SqlParameter(parameterName: "@DateAdded", value: transObject.DateAdded), new SqlParameter(parameterName: "@IP", value: Helpers.CustomHelper.GetLocalIPAddress()), new SqlParameter(parameterName: "@MAC", value: Helpers.CustomHelper.GetMACAddress()), new SqlParameter(parameterName: "@Supplier", value: transObject.SupplierCode), new SqlParameter(parameterName: "@ContactPerson", value: transObject.ContactPersonCode), new SqlParameter(parameterName: "@Attachment", value: transObject.Attachment), new SqlParameter(parameterName: "@ApproverCode", value: transObject.DepartmentApproverCode) }; return(Library.ConnectionString.returnCon.executeQuery(strQuery: "spUpdateTransactionHeader", params_: @params, type_: CommandType.StoredProcedure)); }
public bool returnDelAttachment(TransactionHeaderObject transactionDetails) { SqlParameter[] params_ = new SqlParameter[] { new SqlParameter("@Code", transactionDetails.Code), new SqlParameter("@Id", transactionDetails.Id), new SqlParameter("@AddedBy", transactionDetails.AddedBy), new SqlParameter("@DateAdded", transactionDetails.DateAdded), new SqlParameter("@IP", transactionDetails.IP), new SqlParameter("@MAC", transactionDetails.MAC) // new SqlParameter("@table", "tblSuppliers") }; return(Library.ConnectionString.returnCon.executeQuery("spDelReturnSlipAttachment", params_, CommandType.StoredProcedure)); }
/* * @author : REN <*****@*****.**> * @date : JAN 3, 2017 * @description : addtion of attachment on return slip */ #region rherjias public bool returnAttachment(TransactionHeaderObject transactionDetails) { SqlParameter[] params_ = new SqlParameter[] { new SqlParameter("@returnAttachment", UploaderHelper.FileName), new SqlParameter("@Code", transactionDetails.Code), new SqlParameter("@Id", transactionDetails.Id), new SqlParameter("@AddedBy", transactionDetails.AddedBy), new SqlParameter("@DateAdded", transactionDetails.DateAdded), new SqlParameter("@IP", transactionDetails.IP), new SqlParameter("@MAC", transactionDetails.MAC) }; return(Library.ConnectionString.returnCon.executeQuery("spReturnSlipAttachment", params_, CommandType.StoredProcedure)); }
}// End #endregion /* * @author : AV <*****@*****.**> * @date : DEC. 15, 2016 * @description : inactive the transaction drafted */ public bool DeactivateTransDraft(TransactionHeaderObject item) { SqlParameter[] params_ = new SqlParameter[] { new SqlParameter("@Id", item.Id), new SqlParameter("@IsActive", item.IsActive), new SqlParameter("@AddedBy", item.AddedBy), new SqlParameter("@DateAdded", item.DateAdded), new SqlParameter("@IP", Helpers.CustomHelper.GetLocalIPAddress()), new SqlParameter("@MAC", Helpers.CustomHelper.GetMACAddress()), // new SqlParameter("@table", "tblSuppliers") }; return(Library.ConnectionString.returnCon.executeQuery("spDeactivate_TransactionsDraft", params_, CommandType.StoredProcedure)); }// End
}// End #endregion /* * @author : AV <*****@*****.**> * @date : DEC. 15, 2016 * @description : update the transaction header */ #region UpdateTransHeader public bool UpdateTransHeader(TransactionHeaderObject HeaderComp, string returndate) { SqlParameter[] params_ = new SqlParameter[] { new SqlParameter("@Id", HeaderComp.Id), new SqlParameter("@ImpexRefNbr", HeaderComp.ImpexRefNbr), //new SqlParameter("@ReturnDate", HeaderComp.ReturnDate), new SqlParameter("@ReturnDate", returndate), new SqlParameter("@TransType", HeaderComp.TransType), new SqlParameter("@Purpose", HeaderComp.Purpose), new SqlParameter("@DateAdded", HeaderComp.DateAdded), new SqlParameter("@AddedBy", HeaderComp.AddedBy), new SqlParameter("@IP", Helpers.CustomHelper.GetLocalIPAddress()), new SqlParameter("@MAC", Helpers.CustomHelper.GetMACAddress()), new SqlParameter("@Attachment", HeaderComp.Attachment), new SqlParameter("@Supplier", HeaderComp.SupplierCode), new SqlParameter("@ContactPerson", HeaderComp.ContactPersonCode), new SqlParameter("@ApproverCode", HeaderComp.DepartmentApproverCode) }; return(Library.ConnectionString.returnCon.executeQuery("spUpdateTransHeaderDraft", params_, CommandType.StoredProcedure)); }// End
/* * @author : AV <*****@*****.**> * @date : DEC. 15, 2016 * @description : addition of header info of gate pass */ #region AddHeader public string AddHeader(TransactionHeaderObject trans_object, string rdate) { string attachment; //return Library.ConnectionString.returnCon.executeQuery("spAddUser", params_, CommandType.StoredProcedure); if (trans_object.Attachment == "") { attachment = ""; } else { attachment = UploaderHelper.FileName; } return(Library.ConnectionString.returnCon.executeScalarQuery("exec spAddTransactionHeader " + " @SessionId = '" + trans_object.SessionId + "'," + " @ImpexRefNbr = '" + trans_object.ImpexRefNbr + "'," + " @SupplierCode = '" + trans_object.SupplierCode + "'," + " @ContactPersonCode = '" + trans_object.ContactPersonCode + "'," + " @DepartmentCode = '" + trans_object.DepartmentCode + "'," + // " @ReturnDate = '" + trans_object.ReturnDate.ToString() + "'," + " @ReturnDate = '" + rdate + "'," + " @TransType = '" + trans_object.TransType + "'," + " @CategoryCode = '" + trans_object.CategoryCode + "'," + " @TypeCode = '" + trans_object.TypeCode + "'," + " @Purpose = '" + trans_object.Purpose + "'," + " @IsActive = '" + trans_object.IsActive + "'," + " @Status = '" + trans_object.Status + "'," + " @AddedBy = '" + trans_object.AddedBy + "'," + " @UserCode = '" + trans_object.UserCode + "'," + " @ApproverCode = '" + trans_object.DepartmentApproverCode + "'," + " @DateAdded = '" + trans_object.DateAdded.ToString() + "'," + " @IP = '" + Helpers.CustomHelper.GetLocalIPAddress() + "'," + " @MAC = '" + Helpers.CustomHelper.GetMACAddress() + "'," + " @ReturnSlipStatus = '" + trans_object.ReturnSlipStatus + "'," + " @Comment = '" + "Test Comment Incomplete data" + "'," + " @Attachment = '" + attachment + "'", CommandType.Text).ToString()); }// End